Commit 8684c0af authored by Avi Kivity's avatar Avi Kivity

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: default avatarAvi Kivity <avi@qumranet.com>
parent b13354f8
...@@ -750,6 +750,7 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt, ...@@ -750,6 +750,7 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
switch (base_reg) { switch (base_reg) {
case 5: case 5:
case 13:
if (c->modrm_mod != 0) if (c->modrm_mod != 0)
c->modrm_ea += c->regs[base_reg]; c->modrm_ea += c->regs[base_reg];
else else
...@@ -767,6 +768,7 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt, ...@@ -767,6 +768,7 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
} }
break; break;
case 5: case 5:
case 13:
if (c->modrm_mod != 0) if (c->modrm_mod != 0)
c->modrm_ea += c->regs[c->modrm_rm]; c->modrm_ea += c->regs[c->modrm_rm];
else if (ctxt->mode == X86EMUL_MODE_PROT64) else if (ctxt->mode == X86EMUL_MODE_PROT64)
......
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