x86: consolidate legacy FPU state loading
authorJan Beulich <jbeulich@suse.com>
Mon, 9 Jul 2018 08:52:50 +0000 (10:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 9 Jul 2018 08:52:50 +0000 (10:52 +0200)
commit0339b7704d1710cc31238bf91da0bee8af13f837
tree2a9ff554216b4e38c7472162dfb6d044975d45c9
parent8b77e779caa4b03961dc56abb1079fa6d77c60b9
x86: consolidate legacy FPU state loading

First of all introduce a helper function instead of replicating almost
the same code for PV and HVM. The differences between the two pieces of
code actually points out an issue (which is also addressed here): In
the HVM case FCW would not have been set to FCW_RESET in certain cases
(note for example that XRSTOR loads FCW_DEFAULT rather then FCW_RESET
when the respective xstate_bv bit is clear).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/domain.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/i387.c
xen/include/asm-x86/i387.h