summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2008-06-16 06:13:41 +0200
committerAvi Kivity <avi@qumranet.com>2008-07-20 11:42:33 +0200
commit8684c0af0b2bab770c257e2a04e1546eed35fa56 (patch)
treece11e5f74ed45db49aeeee616f856f1059206c8f /arch
parentKVM: x86 emulator: emulate nop and xchg reg, acc (opcodes 0x90 - 0x97) (diff)
downloadlinux-8684c0af0b2bab770c257e2a04e1546eed35fa56.tar.xz
linux-8684c0af0b2bab770c257e2a04e1546eed35fa56.zip
KVM: x86 emulator: handle undecoded rex.b with r/m = 5 in certain cases
x86_64 does not decode rex.b in certain cases, where the r/m field = 5. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/x86_emulate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index 28082913919e..3721cfddc973 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -750,6 +750,7 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
switch (base_reg) {
case 5:
+ case 13:
if (c->modrm_mod != 0)
c->modrm_ea += c->regs[base_reg];
else
@@ -767,6 +768,7 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
}
break;
case 5:
+ case 13:
if (c->modrm_mod != 0)
c->modrm_ea += c->regs[c->modrm_rm];
else if (ctxt->mode == X86EMUL_MODE_PROT64)