aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-04-24 13:38:36 +0300
committerSteven Rostedt <rostedt@goodmis.org>2013-05-16 11:18:36 -0400
commit09b057981fd3f569fe4acb1c712e3c921f121c3d (patch)
treebdf1a4a88401617adeb211aeb73c736921685c5f /arch
parent5a4e292f761722e450bd05724c06ed214cf33474 (diff)
KVM: X86 emulator: fix source operand decoding for 8bit mov[zs]x instructions
[ Upstream commit 660696d1d16a71e15549ce1bf74953be1592bcd3 ] 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> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/emulate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index a3b57a27be88..238620947b4f 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3970,6 +3970,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;