From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: [PATCH] KVM: x86 emulator: fix unlocked CMPXCHG8B emulation. Date: Sun, 21 Mar 2010 16:58:36 +0200 Message-ID: <20100321145836.GH13522@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: avi@redhat.com, mtosatti@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:15681 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753121Ab0CUO6i (ORCPT ); Sun, 21 Mar 2010 10:58:38 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2LEwbuo026756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 21 Mar 2010 10:58:38 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: When CMPXCHG8B is executed without LOCK prefix it is racy. Preserve this behaviour in emulator too. Signed-off-by: Gleb Natapov --- This patch goes on top of my previous "KVM: x86 emulator: add decoding of CMPXCHG8B dst operand." patch. diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 904351e..e2bbb9c 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1724,7 +1724,6 @@ static inline int emulate_grp9(struct x86_emulate_ctxt *ctxt, (u32) c->regs[VCPU_REGS_RBX]; ctxt->eflags |= EFLG_ZF; - c->lock_prefix = 1; } return X86EMUL_CONTINUE; } -- Gleb.