Re: [PATCH 1/2] KVM: x86 emulator: Disable writeback for CMP emulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/28/2011 06:32 PM, Takuya Yoshikawa wrote:
From: Takuya Yoshikawa<yoshikawa.takuya@xxxxxxxxxxxxx>

This stops "CMP r/m, reg" to write back the data into memory.
Pointed out by Avi.

Signed-off-by: Takuya Yoshikawa<yoshikawa.takuya@xxxxxxxxxxxxx>
---
  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 */

Why not disable writeback here? As a prelude to having em_cmp() which does everything?

I see SCAS also does a 'goto cmp', but it also benefits from disabling writeback.

  		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;


--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux