diff options
author | Gleb Natapov <gleb@redhat.com> | 2013-04-24 06:38:36 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-04-25 03:03:50 -0400 |
commit | 660696d1d16a71e15549ce1bf74953be1592bcd3 (patch) | |
tree | 376a0701d4e8b4d148d87a5a5e8bcb7668fc360f /arch/x86 | |
parent | d1fa0352a151a597e8749e7be84121a1ff0d3502 (diff) |
KVM: X86 emulator: fix source operand decoding for 8bit mov[zs]x instructions
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/emulate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 46f63b8d09f4..8e517bba6a7c 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, | |||
4172 | break; | 4172 | break; |
4173 | case OpMem8: | 4173 | case OpMem8: |
4174 | ctxt->memop.bytes = 1; | 4174 | ctxt->memop.bytes = 1; |
4175 | if (ctxt->memop.type == OP_REG) { | ||
4176 | ctxt->memop.addr.reg = decode_register(ctxt, ctxt->modrm_rm, 1); | ||
4177 | fetch_register_operand(&ctxt->memop); | ||
4178 | } | ||
4175 | goto mem_common; | 4179 | goto mem_common; |
4176 | case OpMem16: | 4180 | case OpMem16: |
4177 | ctxt->memop.bytes = 2; | 4181 | ctxt->memop.bytes = 2; |