aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/x86_emulate.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index b4f439cfc66e..2b94d16e9d23 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -83,7 +83,7 @@ static u8 opcode_table[256] = {
83 /* 0x20 - 0x27 */ 83 /* 0x20 - 0x27 */
84 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 84 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
85 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 85 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
86 0, 0, 0, 0, 86 SrcImmByte, SrcImm, 0, 0,
87 /* 0x28 - 0x2F */ 87 /* 0x28 - 0x2F */
88 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 88 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
89 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 89 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
@@ -882,10 +882,27 @@ done_prefixes:
882 sbb: /* sbb */ 882 sbb: /* sbb */
883 emulate_2op_SrcV("sbb", src, dst, _eflags); 883 emulate_2op_SrcV("sbb", src, dst, _eflags);
884 break; 884 break;
885 case 0x20 ... 0x25: 885 case 0x20 ... 0x23:
886 and: /* and */ 886 and: /* and */
887 emulate_2op_SrcV("and", src, dst, _eflags); 887 emulate_2op_SrcV("and", src, dst, _eflags);
888 break; 888 break;
889 case 0x24: /* and al imm8 */
890 dst.type = OP_REG;
891 dst.ptr = &_regs[VCPU_REGS_RAX];
892 dst.val = *(u8 *)dst.ptr;
893 dst.bytes = 1;
894 dst.orig_val = dst.val;
895 goto and;
896 case 0x25: /* and ax imm16, or eax imm32 */
897 dst.type = OP_REG;
898 dst.bytes = op_bytes;
899 dst.ptr = &_regs[VCPU_REGS_RAX];
900 if (op_bytes == 2)
901 dst.val = *(u16 *)dst.ptr;
902 else
903 dst.val = *(u32 *)dst.ptr;
904 dst.orig_val = dst.val;
905 goto and;
889 case 0x28 ... 0x2d: 906 case 0x28 ... 0x2d:
890 sub: /* sub */ 907 sub: /* sub */
891 emulate_2op_SrcV("sub", src, dst, _eflags); 908 emulate_2op_SrcV("sub", src, dst, _eflags);