KVM: x86 emulator: simplify two-byte opcode check
authorWei Yongjun <yjwei@cn.fujitsu.com>
Thu, 5 Aug 2010 08:34:39 +0000 (16:34 +0800)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:50:59 +0000 (10:50 +0200)
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>
arch/x86/kvm/emulate.c

index ddbad15c94867921b662e025c7da32d73e39269e..a9a4a0b78a7d1a4a066b5cf979d2e294f0dd00c4 100644 (file)
@@ -2375,13 +2375,11 @@ done_prefixes:
 
        /* 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;