From: Alejandro Jimenez Date: Thu, 13 Sep 2018 16:53:03 +0000 (-0400) Subject: x86/spectre_v2: Remove remaining references to lfence mitigation X-Git-Tag: v4.1.12-124.31.3~482 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9af21ef340f7b1f62afc62e2fadc87c5572f594b;p=users%2Fjedix%2Flinux-maple.git x86/spectre_v2: Remove remaining references to lfence mitigation The LFENCE mitigation alone was deemed to be insufficient and the related code was mostly removed by commit cf3b86bc07619 (Revert "x86/spec_ctrl: Add 'nolfence' knob to disable fallback for spectre_v2 mitigation") This patch cleans up two additional references that still exist. Orabug: 28631590 CVE: CVE-2018-15572 Signed-off-by: Alejandro Jimenez Reviewed-by: Mark Kanda Reviewed-by: Darren Kenny Reviewed-by: Boris Ostrovsky Signed-off-by: Brian Maly --- diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 182dc7bc88a6..117bd5b11bb0 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -169,7 +169,6 @@ enum spectre_v2_mitigation { SPECTRE_V2_RETPOLINE_GENERIC, SPECTRE_V2_RETPOLINE_AMD, SPECTRE_V2_IBRS, - SPECTRE_V2_IBRS_LFENCE, }; extern void x86_spec_ctrl_set(u64); diff --git a/arch/x86/kernel/cpu/bugs_64.c b/arch/x86/kernel/cpu/bugs_64.c index 809f85a36be9..4029abe7a8f6 100644 --- a/arch/x86/kernel/cpu/bugs_64.c +++ b/arch/x86/kernel/cpu/bugs_64.c @@ -675,7 +675,7 @@ out: * or deactivated in favour of retpolines the RSB fill on context * switch is required. */ - if (((mode != SPECTRE_V2_IBRS) && (mode != SPECTRE_V2_IBRS_LFENCE)) && + if ((mode != SPECTRE_V2_IBRS) && ((!boot_cpu_has(X86_FEATURE_PTI) && !boot_cpu_has(X86_FEATURE_SMEP)) || is_skylake_era())) { setup_force_cpu_cap(X86_FEATURE_RSB_CTXSW);