From: Jan Beulich Date: Wed, 29 Aug 2018 14:29:42 +0000 (+0200) Subject: x86: drop NO_XPTI synthetic feature X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3370 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=56e619b4d34475abfa31b59dc138328c097ea571;p=xen.git x86: drop NO_XPTI synthetic feature With there not being any patching done based on it, we don't need this. Non-patching conditionals can use opt_xpti instead. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c index 0d550f9e93..8f04fc08d5 100644 --- a/xen/arch/x86/flushtlb.c +++ b/xen/arch/x86/flushtlb.c @@ -14,6 +14,7 @@ #include #include #include +#include /* Debug builds: Wrap frequently to stress-test the wrap logic. */ #ifdef NDEBUG @@ -180,7 +181,7 @@ unsigned int flush_area_local(const void *va, unsigned int flags) */ invpcid_flush_one(PCID_PV_PRIV, addr); invpcid_flush_one(PCID_PV_USER, addr); - if ( !cpu_has_no_xpti ) + if ( opt_xpti ) { invpcid_flush_one(PCID_PV_PRIV | PCID_PV_XPTI, addr); invpcid_flush_one(PCID_PV_USER | PCID_PV_XPTI, addr); diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 7e76cc3d68..e4e12aad78 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -789,7 +789,7 @@ static int setup_cpu_root_pgt(unsigned int cpu) unsigned int off; int rc; - if ( cpu_has_no_xpti ) + if ( !opt_xpti ) return 0; rpt = alloc_xen_pagetable(); diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c index 1ec0f728a6..f28a98b2f5 100644 --- a/xen/arch/x86/spec_ctrl.c +++ b/xen/arch/x86/spec_ctrl.c @@ -873,11 +873,6 @@ void __init init_speculation_mitigations(void) if ( opt_xpti == -1 ) xpti_init_default(caps); - if ( opt_xpti == 0 ) - setup_force_cpu_cap(X86_FEATURE_NO_XPTI); - else - setup_clear_cpu_cap(X86_FEATURE_NO_XPTI); - l1tf_calculations(caps); /* diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h index 4bc6c91ecd..5343ddc3c3 100644 --- a/xen/include/asm-x86/cpufeature.h +++ b/xen/include/asm-x86/cpufeature.h @@ -111,7 +111,6 @@ #define cpu_has_cpuid_faulting boot_cpu_has(X86_FEATURE_CPUID_FAULTING) #define cpu_has_aperfmperf boot_cpu_has(X86_FEATURE_APERFMPERF) #define cpu_has_lfence_dispatch boot_cpu_has(X86_FEATURE_LFENCE_DISPATCH) -#define cpu_has_no_xpti boot_cpu_has(X86_FEATURE_NO_XPTI) #define cpu_has_xen_lbr boot_cpu_has(X86_FEATURE_XEN_LBR) enum _cache_type { diff --git a/xen/include/asm-x86/cpufeatures.h b/xen/include/asm-x86/cpufeatures.h index 249fa6e531..f2a1fa1eb3 100644 --- a/xen/include/asm-x86/cpufeatures.h +++ b/xen/include/asm-x86/cpufeatures.h @@ -30,6 +30,5 @@ XEN_CPUFEATURE(SC_MSR_PV, (FSCAPINTS+0)*32+16) /* MSR_SPEC_CTRL used by Xe XEN_CPUFEATURE(SC_MSR_HVM, (FSCAPINTS+0)*32+17) /* MSR_SPEC_CTRL used by Xen for HVM */ XEN_CPUFEATURE(SC_RSB_PV, (FSCAPINTS+0)*32+18) /* RSB overwrite needed for PV */ XEN_CPUFEATURE(SC_RSB_HVM, (FSCAPINTS+0)*32+19) /* RSB overwrite needed for HVM */ -XEN_CPUFEATURE(NO_XPTI, (FSCAPINTS+0)*32+20) /* XPTI mitigation not in use */ XEN_CPUFEATURE(SC_MSR_IDLE, (FSCAPINTS+0)*32+21) /* (SC_MSR_PV || SC_MSR_HVM) && default_xen_spec_ctrl */ XEN_CPUFEATURE(XEN_LBR, (FSCAPINTS+0)*32+22) /* Xen uses MSR_DEBUGCTL.LBR */