public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix source operand decoding for 8bit mov[zs]x instructions
@ 2013-04-24 10:38 Gleb Natapov
  0 siblings, 0 replies; only message in thread
From: Gleb Natapov @ 2013-04-24 10:38 UTC (permalink / raw)
  To: kvm; +Cc: mtosatti, pbonzini, stable

Source operand for one byte mov[zs]x is decoded incorrectly if it is in high byte
register. Fix that.

Cc: stable@vger.kernel.org
Signed-off-by: Gleb Natapov <gleb@redhat.com>

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 46f63b8..8e517bb 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4172,6 +4172,10 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
 		break;
 	case OpMem8:
 		ctxt->memop.bytes = 1;
+		if (ctxt->memop.type == OP_REG) {
+			ctxt->memop.addr.reg = decode_register(ctxt, ctxt->modrm_rm, 1);
+			fetch_register_operand(&ctxt->memop);
+		}
 		goto mem_common;
 	case OpMem16:
 		ctxt->memop.bytes = 2;
--
			Gleb.

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-24 10:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 10:38 [PATCH] fix source operand decoding for 8bit mov[zs]x instructions Gleb Natapov

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