x86/emul: Fix sarx emulation test
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 24 Feb 2017 18:12:19 +0000 (18:12 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 27 Feb 2017 10:07:54 +0000 (10:07 +0000)
commit4f888208147432d6f7cc0a1f8d5445c927549d7b
tree8a63410d3b9be7df4d6257e7f1b42547cd548a3c
parent45ac805f7f21c5994b000eba9ab2669cbbec8c9d
x86/emul: Fix sarx emulation test

The emulation tests run `sarx %edx,(%ecx),%ebx` with 0xfedcba98 pointed at by
%ecx, and 0xff13 in %rdx.

As the instruction uses a 32bit operand size, the expected result is
0x00000000ffffffdb in %rbx (rather than 0xffffffffffffffdb), due to usual
behaviour of 32bit operations on 64bit registers.

The test harness was incorrectly sign extending from 32 bits to 64 bits rather
than zero extending when checking the result of emulation, causing a false
negative failure.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
tools/tests/x86_emulator/test_x86_emulator.c