x86/boot: Remove cached CPUID data from the trampoline
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 9 Sep 2019 10:43:33 +0000 (11:43 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 21 Nov 2019 15:49:52 +0000 (15:49 +0000)
commit9678167db9ac2562ce7365dfc613db73cd50c8c7
treedd7029d11f45a3f02939dfe0bd53ee98fc12efec
parent7059afb202ff0d82a6fa94f7ef84e4bb3139914e
x86/boot: Remove cached CPUID data from the trampoline

We have a cached cpuid_ext_features in the trampoline which is kept in sync by
various pieces of boot logic.  This is complicated, and all it is actually
used for is to derive whether NX is safe to use.

Replace it with a canned value to load into EFER.

trampoline_setup() and efi_arch_cpu() now tweak trampoline_efer at the point
that they are stashing the main copy of CPUID data.  Similarly,
early_init_intel() needs to tweak if it has re-enabled the use of NX.

This simplifies the AP boot and S3 resume paths by using trampoline_efer
directly, rather than locally turning FEATURE_NX into EFER_NX.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/boot/head.S
xen/arch/x86/boot/trampoline.S
xen/arch/x86/boot/wakeup.S
xen/arch/x86/cpu/common.c
xen/arch/x86/cpu/intel.c
xen/arch/x86/efi/efi-boot.h
xen/include/asm-x86/processor.h