diff options
author | Avi Kivity <avi@redhat.com> | 2010-01-20 11:09:23 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:56:59 -0400 |
commit | aa97bb4891b1f1b35e7abef8d1e2bbd3dda07159 (patch) | |
tree | 08b52f1eafc1fab26012b423fb1cfa362d1dbf50 | |
parent | 1253791df91b064c039282feea094e5943294924 (diff) |
KVM: x86 emulator: implement movdqu instruction (f3 0f 6f, f3 0f 7f)
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/x86/kvm/emulate.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 4e11102f5603..2b6c24e572d4 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2415,11 +2415,19 @@ static int em_mov(struct x86_emulate_ctxt *ctxt) | |||
2415 | return X86EMUL_CONTINUE; | 2415 | return X86EMUL_CONTINUE; |
2416 | } | 2416 | } |
2417 | 2417 | ||
2418 | static int em_movdqu(struct x86_emulate_ctxt *ctxt) | ||
2419 | { | ||
2420 | struct decode_cache *c = &ctxt->decode; | ||
2421 | memcpy(&c->dst.vec_val, &c->src.vec_val, c->op_bytes); | ||
2422 | return X86EMUL_CONTINUE; | ||
2423 | } | ||
2424 | |||
2418 | #define D(_y) { .flags = (_y) } | 2425 | #define D(_y) { .flags = (_y) } |
2419 | #define N D(0) | 2426 | #define N D(0) |
2420 | #define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) } | 2427 | #define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) } |
2421 | #define GD(_f, _g) { .flags = ((_f) | Group | GroupDual), .u.gdual = (_g) } | 2428 | #define GD(_f, _g) { .flags = ((_f) | Group | GroupDual), .u.gdual = (_g) } |
2422 | #define I(_f, _e) { .flags = (_f), .u.execute = (_e) } | 2429 | #define I(_f, _e) { .flags = (_f), .u.execute = (_e) } |
2430 | #define GP(_f, _g) { .flags = ((_f) | Prefix), .u.gprefix = (_g) } | ||
2423 | 2431 | ||
2424 | #define D2bv(_f) D((_f) | ByteOp), D(_f) | 2432 | #define D2bv(_f) D((_f) | ByteOp), D(_f) |
2425 | #define I2bv(_f, _e) I((_f) | ByteOp, _e), I(_f, _e) | 2433 | #define I2bv(_f, _e) I((_f) | ByteOp, _e), I(_f, _e) |
@@ -2484,6 +2492,10 @@ static struct opcode group11[] = { | |||
2484 | I(DstMem | SrcImm | ModRM | Mov, em_mov), X7(D(Undefined)), | 2492 | I(DstMem | SrcImm | ModRM | Mov, em_mov), X7(D(Undefined)), |
2485 | }; | 2493 | }; |
2486 | 2494 | ||
2495 | static struct gprefix pfx_0f_6f_0f_7f = { | ||
2496 | N, N, N, I(Sse, em_movdqu), | ||
2497 | }; | ||
2498 | |||
2487 | static struct opcode opcode_table[256] = { | 2499 | static struct opcode opcode_table[256] = { |
2488 | /* 0x00 - 0x07 */ | 2500 | /* 0x00 - 0x07 */ |
2489 | D6ALU(Lock), | 2501 | D6ALU(Lock), |
@@ -2608,9 +2620,15 @@ static struct opcode twobyte_table[256] = { | |||
2608 | /* 0x50 - 0x5F */ | 2620 | /* 0x50 - 0x5F */ |
2609 | N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, | 2621 | N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, |
2610 | /* 0x60 - 0x6F */ | 2622 | /* 0x60 - 0x6F */ |
2611 | N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, | 2623 | N, N, N, N, |
2624 | N, N, N, N, | ||
2625 | N, N, N, N, | ||
2626 | N, N, N, GP(SrcMem | DstReg | ModRM | Mov, &pfx_0f_6f_0f_7f), | ||
2612 | /* 0x70 - 0x7F */ | 2627 | /* 0x70 - 0x7F */ |
2613 | N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, | 2628 | N, N, N, N, |
2629 | N, N, N, N, | ||
2630 | N, N, N, N, | ||
2631 | N, N, N, GP(SrcReg | DstMem | ModRM | Mov, &pfx_0f_6f_0f_7f), | ||
2614 | /* 0x80 - 0x8F */ | 2632 | /* 0x80 - 0x8F */ |
2615 | X16(D(SrcImm)), | 2633 | X16(D(SrcImm)), |
2616 | /* 0x90 - 0x9F */ | 2634 | /* 0x90 - 0x9F */ |
@@ -2654,6 +2672,7 @@ static struct opcode twobyte_table[256] = { | |||
2654 | #undef G | 2672 | #undef G |
2655 | #undef GD | 2673 | #undef GD |
2656 | #undef I | 2674 | #undef I |
2675 | #undef GP | ||
2657 | 2676 | ||
2658 | #undef D2bv | 2677 | #undef D2bv |
2659 | #undef I2bv | 2678 | #undef I2bv |