All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3 v2] KVM: x86 emulator: Disable writeback for CMP emulation
@ 2011-04-12 15:24 Takuya Yoshikawa
  2011-04-12 15:29 ` [PATCH 2/3 v2] KVM: x86 emulator: Make emulate_push() store the value directly Takuya Yoshikawa
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Takuya Yoshikawa @ 2011-04-12 15:24 UTC (permalink / raw)
  To: avi, mtosatti; +Cc: kvm, yoshikawa.takuya, gleb

From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>

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

The writeback suppression now covers CMP, CMPS, SCAS.

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
---
 Changelog v1->v2: moved the line just after the cmp label.

 arch/x86/kvm/emulate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 3e8b4ab..db48e91 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3671,6 +3671,7 @@ special_insn:
 		break;
 	case 0x38 ... 0x3d:
 	      cmp:		/* cmp */
+		c->dst.type = OP_NONE; /* Disable writeback. */
 		emulate_2op_SrcV("cmp", c->src, c->dst, ctxt->eflags);
 		break;
 	case 0x40 ... 0x47: /* inc r16/r32 */
@@ -3797,7 +3798,6 @@ special_insn:
 		rc = emulate_popf(ctxt, ops, &c->dst.val, c->op_bytes);
 		break;
 	case 0xa6 ... 0xa7:	/* cmps */
-		c->dst.type = OP_NONE; /* Disable writeback. */
 		goto cmp;
 	case 0xa8 ... 0xa9:	/* test ax, imm */
 		goto test;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-17  9:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-12 15:24 [PATCH 1/3 v2] KVM: x86 emulator: Disable writeback for CMP emulation Takuya Yoshikawa
2011-04-12 15:29 ` [PATCH 2/3 v2] KVM: x86 emulator: Make emulate_push() store the value directly Takuya Yoshikawa
2011-04-12 15:31 ` [PATCH 3/3 new] KVM: x86 emulator: Use em_push() instead of emulate_push() Takuya Yoshikawa
2011-04-13 11:08 ` [PATCH 1/3 v2] KVM: x86 emulator: Disable writeback for CMP emulation Avi Kivity
2011-04-17  9:06   ` Avi Kivity

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.