mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Nadav Amit <namit@cs.technion.ac.il>
Subject: Re: [PATCH] KVM: x86: emulate: correct page fault error code for NoWrite instructions
Date: Tue, 10 Feb 2015 19:56:10 -0500	[thread overview]
Message-ID: <934F9FF2-D571-485C-9117-CC6B6F617C32@gmail.com> (raw)
In-Reply-To: <1423472611-5104-1-git-send-email-pbonzini@redhat.com>

Sorry for that. I’ll try to run some few more tests next week.

Nadav

Paolo Bonzini <pbonzini@redhat.com> wrote:

> NoWrite instructions (e.g. cmp or test) never set the "write access"
> bit in the error code, even if one of the operands is treated as a
> destination.
> 
> Fixes: c205fb7d7d4f81e46fc577b707ceb9e356af1456
> Cc: Nadav Amit <namit@cs.technion.ac.il>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> arch/x86/kvm/emulate.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 81dcf7964701..a943bf0c06d0 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -4954,7 +4954,8 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
> 		rc = segmented_read(ctxt, ctxt->dst.addr.mem,
> 				   &ctxt->dst.val, ctxt->dst.bytes);
> 		if (rc != X86EMUL_CONTINUE) {
> -			if (rc == X86EMUL_PROPAGATE_FAULT &&
> +			if (!(ctxt->d & NoWrite) &&
> +			    rc == X86EMUL_PROPAGATE_FAULT &&
> 			    ctxt->exception.vector == PF_VECTOR)
> 				ctxt->exception.error_code |= PFERR_WRITE_MASK;
> 			goto done;
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



  reply	other threads:[~2015-02-11  0:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09  9:03 Paolo Bonzini
2015-02-11  0:56 ` Nadav Amit [this message]
2015-11-20  2:52 ` Wanpeng Li
2015-11-20  3:27   ` Wanpeng Li
2015-11-20  7:46     ` Nadav Amit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=934F9FF2-D571-485C-9117-CC6B6F617C32@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namit@cs.technion.ac.il \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®