Commit 32f7af70 authored by Gleb Natapov's avatar Gleb Natapov Committed by Greg Kroah-Hartman

KVM: X86 emulator: fix source operand decoding for 8bit mov[zs]x instructions

commit 660696d1 upstream.

Source operand for one byte mov[zs]x is decoded incorrectly if it is in
high byte register. Fix that.
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 69f1a527
...@@ -4162,6 +4162,10 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op, ...@@ -4162,6 +4162,10 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
break; break;
case OpMem8: case OpMem8:
ctxt->memop.bytes = 1; 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; goto mem_common;
case OpMem16: case OpMem16:
ctxt->memop.bytes = 2; ctxt->memop.bytes = 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment