Skip to content

Commit

Permalink
KVM: x86 emulator: simplify two-byte opcode check
Browse files Browse the repository at this point in the history
Two-byte opcode always start with 0x0F and the decode flags
of opcode 0xF0 is always 0, so remove dup check.

Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
Wei Yongjun authored and avikivity committed Oct 24, 2010
1 parent a58ddea commit d3ad624
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2375,13 +2375,11 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt)

/* Opcode byte(s). */
opcode = opcode_table[c->b];
if (opcode.flags == 0) {
/* Two-byte opcode? */
if (c->b == 0x0f) {
c->twobyte = 1;
c->b = insn_fetch(u8, 1, c->eip);
opcode = twobyte_table[c->b];
}
/* Two-byte opcode? */
if (c->b == 0x0f) {
c->twobyte = 1;
c->b = insn_fetch(u8, 1, c->eip);
opcode = twobyte_table[c->b];
}
c->d = opcode.flags;

Expand Down

0 comments on commit d3ad624

Please sign in to comment.