Commit d3ad6243 authored by Wei Yongjun's avatar Wei Yongjun Committed by Avi Kivity

KVM: x86 emulator: simplify two-byte opcode check

Two-byte opcode always start with 0x0F and the decode flags
of opcode 0xF0 is always 0, so remove dup check.
Signed-off-by: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent a58ddea5
...@@ -2375,14 +2375,12 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt) ...@@ -2375,14 +2375,12 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt)
/* Opcode byte(s). */ /* Opcode byte(s). */
opcode = opcode_table[c->b]; opcode = opcode_table[c->b];
if (opcode.flags == 0) {
/* Two-byte opcode? */ /* Two-byte opcode? */
if (c->b == 0x0f) { if (c->b == 0x0f) {
c->twobyte = 1; c->twobyte = 1;
c->b = insn_fetch(u8, 1, c->eip); c->b = insn_fetch(u8, 1, c->eip);
opcode = twobyte_table[c->b]; opcode = twobyte_table[c->b];
} }
}
c->d = opcode.flags; c->d = opcode.flags;
if (c->d & Group) { if (c->d & Group) {
......
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