public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: Fix MOVSX emulation
@ 2012-01-14 18:34 Nadav Amit
  2012-01-15  9:56 ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Nadav Amit @ 2012-01-14 18:34 UTC (permalink / raw)
  To: Avi Kivity
  Cc: Marcelo Tosatti, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86, kvm, linux-kernel, Nadav Amit, Nadav Amit

The destination register of MOVSX should be decoded similarily to MOVZX.

Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
---
 arch/x86/kvm/emulate.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 05a562b..7644a83 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3553,7 +3553,8 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
 	case OpReg:
 		decode_register_operand(ctxt, op,
 			 op == &ctxt->dst &&
-			 ctxt->twobyte && (ctxt->b == 0xb6 || ctxt->b == 0xb7));
+			 ctxt->twobyte && ((ctxt->b & 0xfe) == 0xb6 ||
+				(ctxt->b & 0xfe) == 0xbe));
 		break;
 	case OpImmUByte:
 		rc = decode_imm(ctxt, op, 1, false);
-- 
1.7.4.1


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

end of thread, other threads:[~2012-01-15 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-14 18:34 [PATCH] KVM: Fix MOVSX emulation Nadav Amit
2012-01-15  9:56 ` Avi Kivity
2012-01-15 15:02   ` Nadav Amit

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