Signed-off-by: Avi Kivity <avi.kiv...@gmail.com>
---
 arch/x86/kvm/emulate.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index a706e52..2f895c2 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -847,6 +847,8 @@ FASTOP2W(bts);
 FASTOP2W(btr);
 FASTOP2W(btc);
 
+FASTOP2(xadd);
+
 static u8 test_cc(unsigned int condition, unsigned long flags)
 {
        u8 rc;
@@ -3824,7 +3826,7 @@ static const struct opcode twobyte_table[256] = {
        F(DstReg | SrcMem | ModRM, em_bsf), F(DstReg | SrcMem | ModRM, em_bsr),
        D(DstReg | SrcMem8 | ModRM | Mov), D(DstReg | SrcMem16 | ModRM | Mov),
        /* 0xC0 - 0xC7 */
-       D2bv(DstMem | SrcReg | ModRM | Lock),
+       F2bv(DstMem | SrcReg | ModRM | SrcWrite | Lock, em_xadd),
        N, D(DstMem | SrcReg | ModRM | Mov),
        N, N, N, GD(0, &group9),
        /* 0xC8 - 0xCF */
@@ -4643,12 +4645,6 @@ twobyte_insn:
                ctxt->dst.val = (ctxt->src.bytes == 1) ? (s8) ctxt->src.val :
                                                        (s16) ctxt->src.val;
                break;
-       case 0xc0 ... 0xc1:     /* xadd */
-               fastop(ctxt, em_add);
-               /* Write back the register source. */
-               ctxt->src.val = ctxt->dst.orig_val;
-               write_register_operand(&ctxt->src);
-               break;
        case 0xc3:              /* movnti */
                ctxt->dst.bytes = ctxt->op_bytes;
                ctxt->dst.val = (ctxt->op_bytes == 4) ? (u32) ctxt->src.val :
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to