diff options
author | Avi Kivity <avi.kivity@gmail.com> | 2013-02-09 04:31:51 -0500 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-05-21 08:43:24 -0400 |
commit | e47a5f5fb715b90b40747e9e235de557c6abd56c (patch) | |
tree | 92283dc4e419898b3cfdcd6597a6e05065c24e26 | |
parent | 203831e8e4bd9ab3b2f9f86c73c74fe912e06ac5 (diff) |
KVM: x86 emulator: convert XADD to fastop
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
-rw-r--r-- | arch/x86/kvm/emulate.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index d71aac0bf32f..9ebe95c5836e 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -853,6 +853,8 @@ FASTOP2W(bts); | |||
853 | FASTOP2W(btr); | 853 | FASTOP2W(btr); |
854 | FASTOP2W(btc); | 854 | FASTOP2W(btc); |
855 | 855 | ||
856 | FASTOP2(xadd); | ||
857 | |||
856 | static u8 test_cc(unsigned int condition, unsigned long flags) | 858 | static u8 test_cc(unsigned int condition, unsigned long flags) |
857 | { | 859 | { |
858 | u8 rc; | 860 | u8 rc; |
@@ -3861,7 +3863,7 @@ static const struct opcode twobyte_table[256] = { | |||
3861 | F(DstReg | SrcMem | ModRM, em_bsf), F(DstReg | SrcMem | ModRM, em_bsr), | 3863 | F(DstReg | SrcMem | ModRM, em_bsf), F(DstReg | SrcMem | ModRM, em_bsr), |
3862 | D(DstReg | SrcMem8 | ModRM | Mov), D(DstReg | SrcMem16 | ModRM | Mov), | 3864 | D(DstReg | SrcMem8 | ModRM | Mov), D(DstReg | SrcMem16 | ModRM | Mov), |
3863 | /* 0xC0 - 0xC7 */ | 3865 | /* 0xC0 - 0xC7 */ |
3864 | D2bv(DstMem | SrcReg | ModRM | Lock), | 3866 | F2bv(DstMem | SrcReg | ModRM | SrcWrite | Lock, em_xadd), |
3865 | N, D(DstMem | SrcReg | ModRM | Mov), | 3867 | N, D(DstMem | SrcReg | ModRM | Mov), |
3866 | N, N, N, GD(0, &group9), | 3868 | N, N, N, GD(0, &group9), |
3867 | /* 0xC8 - 0xCF */ | 3869 | /* 0xC8 - 0xCF */ |
@@ -4698,12 +4700,6 @@ twobyte_insn: | |||
4698 | ctxt->dst.val = (ctxt->src.bytes == 1) ? (s8) ctxt->src.val : | 4700 | ctxt->dst.val = (ctxt->src.bytes == 1) ? (s8) ctxt->src.val : |
4699 | (s16) ctxt->src.val; | 4701 | (s16) ctxt->src.val; |
4700 | break; | 4702 | break; |
4701 | case 0xc0 ... 0xc1: /* xadd */ | ||
4702 | fastop(ctxt, em_add); | ||
4703 | /* Write back the register source. */ | ||
4704 | ctxt->src.val = ctxt->dst.orig_val; | ||
4705 | write_register_operand(&ctxt->src); | ||
4706 | break; | ||
4707 | case 0xc3: /* movnti */ | 4703 | case 0xc3: /* movnti */ |
4708 | ctxt->dst.bytes = ctxt->op_bytes; | 4704 | ctxt->dst.bytes = ctxt->op_bytes; |
4709 | ctxt->dst.val = (ctxt->op_bytes == 4) ? (u32) ctxt->src.val : | 4705 | ctxt->dst.val = (ctxt->op_bytes == 4) ? (u32) ctxt->src.val : |