Commit 5c82aa29 authored by Avi Kivity's avatar Avi Kivity

KVM: x86 emulator: implement IMUL REG, R/M (opcode 0F AF)

Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent f3a1b9f4
...@@ -2264,15 +2264,22 @@ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt) ...@@ -2264,15 +2264,22 @@ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt)
return X86EMUL_CONTINUE; return X86EMUL_CONTINUE;
} }
static int em_imul_3op(struct x86_emulate_ctxt *ctxt) static int em_imul(struct x86_emulate_ctxt *ctxt)
{ {
struct decode_cache *c = &ctxt->decode; struct decode_cache *c = &ctxt->decode;
c->dst.val = c->src2.val;
emulate_2op_SrcV_nobyte("imul", c->src, c->dst, ctxt->eflags); emulate_2op_SrcV_nobyte("imul", c->src, c->dst, ctxt->eflags);
return X86EMUL_CONTINUE; return X86EMUL_CONTINUE;
} }
static int em_imul_3op(struct x86_emulate_ctxt *ctxt)
{
struct decode_cache *c = &ctxt->decode;
c->dst.val = c->src2.val;
return em_imul(ctxt);
}
#define D(_y) { .flags = (_y) } #define D(_y) { .flags = (_y) }
#define N D(0) #define N D(0)
#define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) } #define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) }
...@@ -2488,7 +2495,7 @@ static struct opcode twobyte_table[256] = { ...@@ -2488,7 +2495,7 @@ static struct opcode twobyte_table[256] = {
N, D(DstMem | SrcReg | ModRM | BitOp | Lock), N, D(DstMem | SrcReg | ModRM | BitOp | Lock),
D(DstMem | SrcReg | Src2ImmByte | ModRM), D(DstMem | SrcReg | Src2ImmByte | ModRM),
D(DstMem | SrcReg | Src2CL | ModRM), D(DstMem | SrcReg | Src2CL | ModRM),
D(ModRM), N, D(ModRM), I(DstReg | SrcMem | ModRM, em_imul),
/* 0xB0 - 0xB7 */ /* 0xB0 - 0xB7 */
D(ByteOp | DstMem | SrcReg | ModRM | Lock), D(DstMem | SrcReg | ModRM | Lock), D(ByteOp | DstMem | SrcReg | ModRM | Lock), D(DstMem | SrcReg | ModRM | Lock),
N, D(DstMem | SrcReg | ModRM | BitOp | Lock), N, D(DstMem | SrcReg | ModRM | BitOp | Lock),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment