test_x86_emulate: adjust CMPXCHG test
PATCH 2/2 test_x86_emulate: adjust CMPXCHG test
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 <[email protected]>
--- tools/tests/x86_emulator/test_x86_emulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/tests/x86_emulator/test_x86_emulator.c +1 -1
@@ -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&0x8d5 ) !=0x891 ) || (regs.eax !=0xAABBCCAA ) || (regs.ecx !=0xFF ) || (regs.eip != (unsigned long )&instr[4 ]) )
Signature · 1 line
2.0.5
tools/tests/x86_emulator/test_x86_emulator.c int main(int argc, char **argv) · line 291
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Eugene Korenevsky <[email protected]> 04/28/15 11:54 PM >>>
tools/tests/x86_emulator/test_x86_emulator.c +0
-0@@ -288,7 +288,7 @@ int main(int argc, char **argv) rc =x86_emulate (&ctxt, &emulops);if ( (rc !=
X86EMUL_OKAY) ||
(*res !=0x923456AA) ||tools/tests/x86_emulator/test_x86_emulator.c +1
-1- ((regs.eflags&0x240) != 0x200) || + ((regs.eflags&0x8d5) != 0x891) ||
While not a big problem, without saying so in the commit message the checking that IF didn't accidentally get cleared shouldn't be removed. I'll try to remember to fix this up before committing.
Jan