From: Takuya Yoshikawa Subject: [PATCH 1/2] KVM: x86 emulator: Disable writeback for CMP emulation Date: Tue, 29 Mar 2011 01:32:29 +0900 Message-ID: <20110329013229.20e6168f.takuya.yoshikawa@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp, gleb@redhat.com To: avi@redhat.com, mtosatti@redhat.com Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:48746 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932115Ab1C1Qch (ORCPT ); Mon, 28 Mar 2011 12:32:37 -0400 Received: by wya21 with SMTP id 21so3002786wya.19 for ; Mon, 28 Mar 2011 09:32:36 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: From: Takuya Yoshikawa This stops "CMP r/m, reg" to write back the data into memory. Pointed out by Avi. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/emulate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 14c5ad5..8a73805 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3084,6 +3084,7 @@ special_insn: emulate_2op_SrcV("xor", c->src, c->dst, ctxt->eflags); break; case 0x38 ... 0x3d: + c->dst.type = OP_NONE; /* Disable writeback. */ cmp: /* cmp */ emulate_2op_SrcV("cmp", c->src, c->dst, ctxt->eflags); break; @@ -3138,6 +3139,7 @@ special_insn: case 6: goto xor; case 7: + c->dst.type = OP_NONE; /* Disable writeback. */ goto cmp; } break; -- 1.7.1