KVM: x86 emulator: cleanup xchg emulation
authorGleb Natapov <gleb@redhat.com>
Wed, 28 Apr 2010 16:15:24 +0000 (19:15 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 1 Aug 2010 07:35:29 +0000 (10:35 +0300)
Dst operand is already initialized during decoding stage. No need to
reinitialize.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/emulate.c

index a81e6bfcade72fd5dd6515384f29f025671c7398..a99d49cc893466ed86e9e40ad775299a3f79a4d4 100644 (file)
@@ -2804,8 +2804,8 @@ special_insn:
                        break;
                }
        case 0x91 ... 0x97: /* xchg reg,rax */
-               c->src.type = c->dst.type = OP_REG;
-               c->src.bytes = c->dst.bytes = c->op_bytes;
+               c->src.type = OP_REG;
+               c->src.bytes = c->op_bytes;
                c->src.ptr = (unsigned long *) &c->regs[VCPU_REGS_RAX];
                c->src.val = *(c->src.ptr);
                goto xchg;