Skip to content

Commit

Permalink
KVM: x86 emulator: add JrCXZ instruction emulation
Browse files Browse the repository at this point in the history
Add JrCXZ instruction emulation (opcode 0xe3)
Used by FreeBSD boot loader.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
Wei Yongjun authored and Avi Kivity committed Oct 24, 2010
1 parent 09b5f4d commit e4abac6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,7 @@ static struct opcode opcode_table[256] = {
/* 0xD8 - 0xDF */
N, N, N, N, N, N, N, N,
/* 0xE0 - 0xE7 */
X3(D(SrcImmByte)), N,
X4(D(SrcImmByte)),
D(ByteOp | SrcImmUByte | DstAcc), D(SrcImmUByte | DstAcc),
D(ByteOp | SrcAcc | DstImmUByte), D(SrcAcc | DstImmUByte),
/* 0xE8 - 0xEF */
Expand Down Expand Up @@ -3285,6 +3285,10 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
(c->b == 0xe2 || test_cc(c->b ^ 0x5, ctxt->eflags)))
jmp_rel(c, c->src.val);
break;
case 0xe3: /* jcxz/jecxz/jrcxz */
if (address_mask(c, c->regs[VCPU_REGS_RCX]) == 0)
jmp_rel(c, c->src.val);
break;
case 0xe4: /* inb */
case 0xe5: /* in */
goto do_io_in;
Expand Down

0 comments on commit e4abac6

Please sign in to comment.