x86emul: fix FXRSTOR test for most AMD CPUs
authorJan Beulich <jbeulich@suse.com>
Mon, 6 Jul 2020 15:14:24 +0000 (17:14 +0200)
committerWei Liu <wl@xen.org>
Mon, 6 Jul 2020 18:12:22 +0000 (18:12 +0000)
commitf97f99c8d88ebc108f6adc3ba74e87d53ba57c70
tree682ad6a1edbf499ddedebf43e8266b665027fa8e
parent158912a532fe98f448c688d3571241c9033553bd
x86emul: fix FXRSTOR test for most AMD CPUs

AMD CPUs that we classify as X86_BUG_FPU_PTRS don't touch the selector/
offset portion of the save image during FXSAVE unless an unmasked
exception is pending. Hence the selector zapping done between the
initial FXSAVE and the emulated FXRSTOR needs to be mirrored onto the
second FXSAVE, output of which gets fed into memcmp() to compare with
the input image.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Paul Durrant <paul@xen.org>
tools/tests/x86_emulator/test_x86_emulator.c