Browse Source

KVM: x86 emulator: fix faulty check for two-byte opcode

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>
Avi Kivity 18 years ago
parent
commit
394b6e5944
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/kvm/x86_emulate.c

+ 1 - 1
drivers/kvm/x86_emulate.c

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