From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aurelien Jarno Subject: [PATCH]: KVM: Fix cmpxchg for writeback changes Date: Wed, 25 Jul 2007 11:25:06 +0200 Message-ID: <20070725092506.GA19697@hall.aurel32.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org KVM: Fix writeback for cmpxchg instruction The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) broke cmpxchg emulation. The patch below fixes that. Signed-off-by: Aurelien Jarno diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index 21ce977..9d30d10 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c @@ -1275,7 +1275,7 @@ twobyte_insn: src.val = _regs[VCPU_REGS_RAX]; emulate_2op_SrcV("cmp", src, dst, _eflags); /* Always write back. The question is: where to? */ - d |= Mov; + no_wb = 0; if (_eflags & EFLG_ZF) { /* Success: write back to memory. */ dst.val = src.orig_val; -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org | aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org `- people.debian.org/~aurel32 | www.aurel32.net ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/