diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2010-08-05 04:34:39 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:50:59 -0400 |
commit | d3ad6243293d92c82530a50c77d71bb0a0a42fdc (patch) | |
tree | 203846ec7528cef3086a417a84ea646344db0b86 | |
parent | a58ddea556f8877ccf7caa046b6d6b32982f5b1d (diff) |
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: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/x86/kvm/emulate.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index ddbad15c9486..a9a4a0b78a7d 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2375,13 +2375,11 @@ done_prefixes: | |||
2375 | 2375 | ||
2376 | /* Opcode byte(s). */ | 2376 | /* Opcode byte(s). */ |
2377 | opcode = opcode_table[c->b]; | 2377 | opcode = opcode_table[c->b]; |
2378 | if (opcode.flags == 0) { | 2378 | /* Two-byte opcode? */ |
2379 | /* Two-byte opcode? */ | 2379 | if (c->b == 0x0f) { |
2380 | if (c->b == 0x0f) { | 2380 | c->twobyte = 1; |
2381 | c->twobyte = 1; | 2381 | c->b = insn_fetch(u8, 1, c->eip); |
2382 | c->b = insn_fetch(u8, 1, c->eip); | 2382 | opcode = twobyte_table[c->b]; |
2383 | opcode = twobyte_table[c->b]; | ||
2384 | } | ||
2385 | } | 2383 | } |
2386 | c->d = opcode.flags; | 2384 | c->d = opcode.flags; |
2387 | 2385 | ||