aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorMohammed Gamal <m.gamal005@gmail.com>2010-05-11 15:22:40 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:35:43 -0400
commitdfb507c41d0d12fc69820abb7f040d31fcf015fe (patch)
treed1340e151a7c3c9e783ffd59afe8e07971a94a94 /arch/x86/kvm/emulate.c
parent24955b6c906045382b67f3e6beba7e5df4a4a045 (diff)
KVM: x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9)
This adds test acc, imm instruction to the x86 emulator Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b43ac98ef790..35dd57c5a7fd 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -181,7 +181,7 @@ static u32 opcode_table[256] = {
181 ByteOp | SrcSI | DstDI | Mov | String, SrcSI | DstDI | Mov | String, 181 ByteOp | SrcSI | DstDI | Mov | String, SrcSI | DstDI | Mov | String,
182 ByteOp | SrcSI | DstDI | String, SrcSI | DstDI | String, 182 ByteOp | SrcSI | DstDI | String, SrcSI | DstDI | String,
183 /* 0xA8 - 0xAF */ 183 /* 0xA8 - 0xAF */
184 0, 0, ByteOp | DstDI | Mov | String, DstDI | Mov | String, 184 DstAcc | SrcImmByte | ByteOp, DstAcc | SrcImm, ByteOp | DstDI | Mov | String, DstDI | Mov | String,
185 ByteOp | SrcSI | DstAcc | Mov | String, SrcSI | DstAcc | Mov | String, 185 ByteOp | SrcSI | DstAcc | Mov | String, SrcSI | DstAcc | Mov | String,
186 ByteOp | DstDI | String, DstDI | String, 186 ByteOp | DstDI | String, DstDI | String,
187 /* 0xB0 - 0xB7 */ 187 /* 0xB0 - 0xB7 */
@@ -2754,6 +2754,7 @@ special_insn:
2754 } 2754 }
2755 break; 2755 break;
2756 case 0x84 ... 0x85: 2756 case 0x84 ... 0x85:
2757 test:
2757 emulate_2op_SrcV("test", c->src, c->dst, ctxt->eflags); 2758 emulate_2op_SrcV("test", c->src, c->dst, ctxt->eflags);
2758 break; 2759 break;
2759 case 0x86 ... 0x87: /* xchg */ 2760 case 0x86 ... 0x87: /* xchg */
@@ -2852,6 +2853,8 @@ special_insn:
2852 c->dst.type = OP_NONE; /* Disable writeback. */ 2853 c->dst.type = OP_NONE; /* Disable writeback. */
2853 DPRINTF("cmps: mem1=0x%p mem2=0x%p\n", c->src.ptr, c->dst.ptr); 2854 DPRINTF("cmps: mem1=0x%p mem2=0x%p\n", c->src.ptr, c->dst.ptr);
2854 goto cmp; 2855 goto cmp;
2856 case 0xa8 ... 0xa9: /* test ax, imm */
2857 goto test;
2855 case 0xaa ... 0xab: /* stos */ 2858 case 0xaa ... 0xab: /* stos */
2856 c->dst.val = c->regs[VCPU_REGS_RAX]; 2859 c->dst.val = c->regs[VCPU_REGS_RAX];
2857 break; 2860 break;