Skip to content

Commit

Permalink
KVM: x86 emulator: handle undecoded rex.b with r/m = 5 in certain cases
Browse files Browse the repository at this point in the history
x86_64 does not decode rex.b in certain cases, where the r/m field = 5.

Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Avi Kivity committed Jul 20, 2008
1 parent b13354f commit 8684c0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/kvm/x86_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 8684c0a

Please sign in to comment.