test_x86_emulate: extend EFLAGS check of CMPXCHG test
authorEugene Korenevsky <ekorenevsky@gmail.com>
Mon, 4 May 2015 09:56:21 +0000 (11:56 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 May 2015 10:03:19 +0000 (12:03 +0200)
CMPXCHG: in the case of inequality of the rAX and the operand,
need to check CF, PF, AF, SF and OF flags as well.

This adjustment covers the fix of incorrect comparison during
CMPXCHG emulation.

Signed-off-by: Eugene Korenevsky <ekorenevsky@gmail.com>
tools/tests/x86_emulator/test_x86_emulator.c

index 66d5eff163dab296a5824d716865497b516c6e67..b789edf0cafc0549b6fbe1476a9394c59f9de325 100644 (file)
@@ -288,7 +288,7 @@ int main(int argc, char **argv)
     rc = x86_emulate(&ctxt, &emulops);
     if ( (rc != X86EMUL_OKAY) || 
          (*res != 0x923456AA) || 
-         ((regs.eflags&0x240) != 0x200) ||
+         ((regs.eflags&0xad5) != 0xa91) ||
          (regs.eax != 0xAABBCCAA) ||
          (regs.ecx != 0xFF) ||
          (regs.eip != (unsigned long)&instr[4]) )