]> xenbits.xensource.com Git - xen.git/commit
x86_emulate: fix EFLAGS setting of CMPXCHG emulation
authorEugene Korenevsky <ekorenevsky@gmail.com>
Mon, 4 May 2015 09:55:41 +0000 (11:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 May 2015 09:55:41 +0000 (11:55 +0200)
commit2232628ecbab42e7700287204daad71a3ce2208c
treef234b383d09ffdf7f8de8edd332add64cc9e25aa
parent375a90b7de02a72263615a82f800e4fef689f7f0
x86_emulate: fix EFLAGS setting of CMPXCHG emulation

CMPXCHG sets CF, PF, AF, SF, and OF flags according to the results of the
comparison the rAX with the operand of the instruction.
rAX must be the first argument of the comparison (a minuend), the operand
must be the second one (a subtrahend).

Due to improper order of comparison arguments, CF, PF, AF, SF and OF flags were
set incorrectly in the case of inequality. Need to swap them.

Signed-off-by: Eugene Korenevsky <ekorenevsky@gmail.com>
xen/arch/x86/x86_emulate/x86_emulate.c