public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] KVM: x86 emulator: Disable writeback for CMP emulation
@ 2011-03-28 16:32 Takuya Yoshikawa
  2011-03-28 16:34 ` [RFC PATCH 2/2] KVM: x86 emulator: Cleanup emulate_push() writebacks Takuya Yoshikawa
  2011-04-03 14:42 ` [PATCH 1/2] KVM: x86 emulator: Disable writeback for CMP emulation Avi Kivity
  0 siblings, 2 replies; 9+ messages in thread
From: Takuya Yoshikawa @ 2011-03-28 16:32 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.

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
---
 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


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

end of thread, other threads:[~2011-04-03 16:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 16:32 [PATCH 1/2] KVM: x86 emulator: Disable writeback for CMP emulation Takuya Yoshikawa
2011-03-28 16:34 ` [RFC PATCH 2/2] KVM: x86 emulator: Cleanup emulate_push() writebacks Takuya Yoshikawa
2011-03-30  6:51   ` Takuya Yoshikawa
2011-04-03 14:50   ` Avi Kivity
2011-04-03 15:59     ` Takuya Yoshikawa
2011-04-03 16:04       ` Avi Kivity
2011-04-03 16:09         ` Takuya Yoshikawa
2011-04-03 16:11           ` Avi Kivity
2011-04-03 14:42 ` [PATCH 1/2] KVM: x86 emulator: Disable writeback for CMP emulation Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox