From: Paolo Bonzini <pbonzini@redhat.com>
To: Nadav Amit <namit@cs.technion.ac.il>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: Fix cmpxchg with two 32-bit registers
Date: Mon, 27 Apr 2015 15:37:10 +0200 [thread overview]
Message-ID: <553E3B86.2000709@redhat.com> (raw)
In-Reply-To: <1430061048-14958-1-git-send-email-namit@cs.technion.ac.il>
On 26/04/2015 17:10, Nadav Amit wrote:
> The emulation of CMPXCHG with two register operands in 64-bit mistakenly masks
> the high 32-bits as it performs assignment. Fix it.
>
> Fixes: 2fcf5c8ae244b4c298d2111a288d410a719ac626
>
> Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
> ---
> arch/x86/kvm/emulate.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 630bcb0..84c132b 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -2242,6 +2242,8 @@ static int em_cmpxchg(struct x86_emulate_ctxt *ctxt)
> ctxt->src.val = ctxt->dst.orig_val;
> /* Create write-cycle to dest by writing the same value */
> ctxt->dst.val = ctxt->dst.orig_val;
> + if (ctxt->dst.type != OP_MEM)
> + ctxt->dst.type = OP_NONE;
> }
> return X86EMUL_CONTINUE;
> }
>
Applied, thanks.
Paolo
prev parent reply other threads:[~2015-04-27 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-26 15:10 [PATCH] KVM: x86: Fix cmpxchg with two 32-bit registers Nadav Amit
2015-04-27 13:37 ` Paolo Bonzini [this message]
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=553E3B86.2000709@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=namit@cs.technion.ac.il \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.