]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: x86 emulator: fix faulty check for two-byte opcode
authorAvi Kivity <avi@qumranet.com>
Sun, 22 Jul 2007 12:51:58 +0000 (15:51 +0300)
committerAvi Kivity <avi@qumranet.com>
Sun, 22 Jul 2007 12:51:58 +0000 (15:51 +0300)
Right now, the bug is harmless as we never emulate one-byte 0xb6 or 0xb7.
But things may change.

Noted by the mysterious Gabriel C.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/x86_emulate.c

index ee16d694e046a8dbf25a704307127b382aae2b5c..21ce977899371c310fe01855c6a7092b2e0816b3 100644 (file)
@@ -819,7 +819,7 @@ done_prefixes:
        case DstReg:
                dst.type = OP_REG;
                if ((d & ByteOp)
-                   && !(twobyte_table && (b == 0xb6 || b == 0xb7))) {
+                   && !(twobyte && (b == 0xb6 || b == 0xb7))) {
                        dst.ptr = decode_register(modrm_reg, _regs,
                                                  (rex_prefix == 0));
                        dst.val = *(u8 *) dst.ptr;