x86emul: abstract out XCRn accesses
authorJan Beulich <jbeulich@suse.com>
Thu, 22 Mar 2018 09:35:50 +0000 (10:35 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 22 Mar 2018 09:35:50 +0000 (10:35 +0100)
commit8ea908be6135005514c2932dcddd96a2899ebee8
tree36ef4ea4e697420e22e1d28953e3ef3efc6195cc
parentea9070190315d26c7eb90555041033ae4a21cfe7
x86emul: abstract out XCRn accesses

Use hooks, just like done for other special purpose registers.

This includes moving XCR0 checks from hvmemul_get_fpu() to the emulator
itself as well as adding support for XGETBV emulation.

For now fuzzer reads will obtain the real values (minus the fuzzing of
the hook pointer itself).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com> [tracing parts]
12 files changed:
tools/fuzz/x86_instruction_emulator/fuzz-emul.c
tools/tests/x86_emulator/test_x86_emulator.c
tools/tests/x86_emulator/x86-emulate.c
tools/tests/x86_emulator/x86-emulate.h
xen/arch/x86/hvm/emulate.c
xen/arch/x86/pv/emul-priv-op.c
xen/arch/x86/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.h
xen/include/asm-x86/hvm/trace.h
xen/include/asm-x86/xstate.h
xen/include/public/trace.h