x86: introduce and use setup_force_cpu_cap()
authorJan Beulich <jbeulich@suse.com>
Wed, 6 Sep 2017 10:32:00 +0000 (12:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 6 Sep 2017 10:32:00 +0000 (12:32 +0200)
commit0829a6bdbdc6b79990bd0668e847275b6a2717e5
tree80a8b00d49855e1c954db984b0c21ff9847e23cf
parentfd903a35daf3e7e6bfa782b18dfd43746f940bed
x86: introduce and use setup_force_cpu_cap()

For XEN_SMEP and XEN_SMAP to not be cleared while bringing up APs we'd
need to clone the respective hack used for CPUID_FAULTING. Introduce an
inverse of setup_clear_cpu_cap() instead, but let clearing of features
overrule forced setting of them.

XEN_SMAP being wrong post-boot is a problem specifically for live
patching, as a live patch may need alternative instruction patching
keyed off of that feature flag.

Reported-by: Sarah Newman <security@prgmr.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/apic.c
xen/arch/x86/cpu/common.c
xen/arch/x86/cpu/intel.c
xen/arch/x86/setup.c
xen/include/asm-x86/processor.h