aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-08-18 11:25:25 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:12 -0400
commitf3a1b9f49647133e8c6eb6a68399ed8dbd61554a (patch)
tree7535212f90ac78a2695d998d1e27150a768ab277 /arch/x86/kvm/emulate.c
parent40ece7c7297da90e54e147d3bfbb4531f9fbc570 (diff)
KVM: x86 emulator: implement IMUL REG, R/M, imm8 (opcode 6B)
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 9e58f5054c39..618386f80518 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2264,6 +2264,15 @@ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt)
2264 return X86EMUL_CONTINUE; 2264 return X86EMUL_CONTINUE;
2265} 2265}
2266 2266
2267static int em_imul_3op(struct x86_emulate_ctxt *ctxt)
2268{
2269 struct decode_cache *c = &ctxt->decode;
2270
2271 c->dst.val = c->src2.val;
2272 emulate_2op_SrcV_nobyte("imul", c->src, c->dst, ctxt->eflags);
2273 return X86EMUL_CONTINUE;
2274}
2275
2267#define D(_y) { .flags = (_y) } 2276#define D(_y) { .flags = (_y) }
2268#define N D(0) 2277#define N D(0)
2269#define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) } 2278#define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) }
@@ -2371,7 +2380,8 @@ static struct opcode opcode_table[256] = {
2371 N, N, N, N, 2380 N, N, N, N,
2372 /* 0x68 - 0x6F */ 2381 /* 0x68 - 0x6F */
2373 I(SrcImm | Mov | Stack, em_push), N, 2382 I(SrcImm | Mov | Stack, em_push), N,
2374 I(SrcImmByte | Mov | Stack, em_push), N, 2383 I(SrcImmByte | Mov | Stack, em_push),
2384 I(DstReg | SrcMem | ModRM | Src2ImmByte, em_imul_3op),
2375 D(DstDI | ByteOp | Mov | String), D(DstDI | Mov | String), /* insb, insw/insd */ 2385 D(DstDI | ByteOp | Mov | String), D(DstDI | Mov | String), /* insb, insw/insd */
2376 D(SrcSI | ByteOp | ImplicitOps | String), D(SrcSI | ImplicitOps | String), /* outsb, outsw/outsd */ 2386 D(SrcSI | ByteOp | ImplicitOps | String), D(SrcSI | ImplicitOps | String), /* outsb, outsw/outsd */
2377 /* 0x70 - 0x7F */ 2387 /* 0x70 - 0x7F */