• Nadav Amit's avatar
    KVM: x86: Wrong emulation on 'xadd X, X' · ee212297
    Nadav Amit authored
    The emulator does not emulate the xadd instruction correctly if the two
    operands are the same.  In this (unlikely) situation the result should be the
    sum of X and X (2X) when it is currently X.  The solution is to first perform
    writeback to the source, before writing to the destination.  The only
    instruction which should be affected is xadd, as the other instructions that
    perform writeback to the source use the extended accumlator (e.g., RAX:RDX).
    Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    ee212297
emulate.c 124 KB