KVM: x86 emulator: fix 'and AL,imm8' instruction decoding
authorWei Yongjun <yjwei@cn.fujitsu.com>
Tue, 6 Jul 2010 08:51:09 +0000 (16:51 +0800)
committerAvi Kivity <avi@redhat.com>
Mon, 2 Aug 2010 03:40:24 +0000 (06:40 +0300)
'and AL,imm8' should be mask as ByteOp, otherwise the dest operand
length will no correct and we may fill the full EAX when writeback.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/emulate.c

index ad8d7cdd1eb95d83ec4b630c0ce781f9f3d9115c..59568ad21ab3b2525f7284d2762f1e7219a6f6d5 100644 (file)
@@ -123,7 +123,7 @@ static u32 opcode_table[256] = {
        /* 0x20 - 0x27 */
        ByteOp | DstMem | SrcReg | ModRM | Lock, DstMem | SrcReg | ModRM | Lock,
        ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
-       DstAcc | SrcImmByte, DstAcc | SrcImm, 0, 0,
+       ByteOp | DstAcc | SrcImmByte, DstAcc | SrcImm, 0, 0,
        /* 0x28 - 0x2F */
        ByteOp | DstMem | SrcReg | ModRM | Lock, DstMem | SrcReg | ModRM | Lock,
        ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,