From: Gleb Natapov Date: Wed, 24 Apr 2013 10:38:36 +0000 (+0300) Subject: KVM: X86 emulator: fix source operand decoding for 8bit mov[zs]x instructions X-Git-Tag: v3.8.12~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b63018273bb6c505777a7ddccb8120f08111a6c0;p=thirdparty%2Fkernel%2Fstable.git KVM: X86 emulator: fix source operand decoding for 8bit mov[zs]x instructions commit 660696d1d16a71e15549ce1bf74953be1592bcd3 upstream. Source operand for one byte mov[zs]x is decoded incorrectly if it is in high byte register. Fix that. Signed-off-by: Gleb Natapov Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index a27e763711087..d330b3c619f8f 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -4030,6 +4030,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;