retpolines: Remove the minimal stuff of retpoline support
Subsystems (2)
PATCH v3 2/2 retpolines: Remove the minimal stuff of retpoline support
Now that CONFIG_RETPOLINE hard depends on compiler support, there is no reason for minimal stuff to still exist.
--- arch/x86/include/asm/nospec-branch.h | 2 -- arch/x86/kernel/cpu/bugs.c | 13 ++----------- 2 files changed, 2 insertions(+), 13 deletions(-)
arch/x86/include/asm/nospec-branch.h +0 -2
@@ -221,8 +221,6 @@/* The Spectre V2 mitigation variants */ enum spectre_v2_mitigation {SPECTRE_V2_NONE , -SPECTRE_V2_RETPOLINE_MINIMAL , -SPECTRE_V2_RETPOLINE_MINIMAL_AMD ,SPECTRE_V2_RETPOLINE_GENERIC ,SPECTRE_V2_RETPOLINE_AMD ,SPECTRE_V2_IBRS_ENHANCED ,
arch/x86/kernel/cpu/bugs.c +2 -11
@@ -135,8 +135,6 @@ enum spectre_v2_mitigation_cmd {static const char *spectre_v2_strings[] = { [SPECTRE_V2_NONE ] ="Vulnerable" , - [SPECTRE_V2_RETPOLINE_MINIMAL ] ="Vulnerable: Minimal generic ASM retpoline" , - [SPECTRE_V2_RETPOLINE_MINIMAL_AMD ] ="Vulnerable: Minimal AMD ASM retpoline" , [SPECTRE_V2_RETPOLINE_GENERIC ] ="Mitigation: Full generic retpoline" , [SPECTRE_V2_RETPOLINE_AMD ] ="Mitigation: Full AMD retpoline" , [SPECTRE_V2_IBRS_ENHANCED ] ="Mitigation: Enhanced IBRS" ,
@@ -250,11 +248,6 @@ static void __init spec2_print_if_secure(const char *reason)pr_info ("%s selected on command line.\n" , reason); } -static inline bool retp_compiler (void ) -{ -return __is_defined (CONFIG_RETPOLINE ); -} -static inline bool match_option (const char *arg,int arglen,const char *opt) {int len =strlen (opt);
@@ -417,14 +410,12 @@ static void __init spectre_v2_select_mitigation(void)pr_err ("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n" ); goto retpoline_generic; } - mode =retp_compiler () ?SPECTRE_V2_RETPOLINE_AMD : -SPECTRE_V2_RETPOLINE_MINIMAL_AMD ; + mode =SPECTRE_V2_RETPOLINE_AMD ;setup_force_cpu_cap (X86_FEATURE_RETPOLINE_AMD );setup_force_cpu_cap (X86_FEATURE_RETPOLINE ); }else { retpoline_generic: - mode =retp_compiler () ?SPECTRE_V2_RETPOLINE_GENERIC : -SPECTRE_V2_RETPOLINE_MINIMAL ; + mode =SPECTRE_V2_RETPOLINE_GENERIC ;setup_force_cpu_cap (X86_FEATURE_RETPOLINE ); }
Signature · 1 line
1.8.3.1
tip-bot for Zhenzhong Duan
merge bot[tip:x86/pti] x86/retpoline: Remove minimal retpoline support
x86/retpoline: Remove minimal retpoline support
Commit-ID: aa0bb5a223720948bdd54d4c7bd48b147502e214 Gitweb: https://git.kernel.org/tip/aa0bb5a223720948bdd54d4c7bd48b147502e214 Author: Zhenzhong Duan <[email protected]> AuthorDate: Fri, 2 Nov 2018 01:45:41 -0700 Committer: Thomas Gleixner <[email protected]> CommitDate: Tue, 6 Nov 2018 21:46:20 +0100
x86/retpoline: Remove minimal retpoline support
Now that CONFIG_RETPOLINE hard depends on compiler support, there is no reason to keep the minimal retpoline support around which only provided basic protection in the assembly files.
--- arch/x86/include/asm/nospec-branch.h | 2 -- arch/x86/kernel/cpu/bugs.c | 13 ++----------- 2 files changed, 2 insertions(+), 13 deletions(-)
arch/x86/include/asm/nospec-branch.h +0 -2
@@ -221,8 +221,6 @@/* The Spectre V2 mitigation variants */ enum spectre_v2_mitigation {SPECTRE_V2_NONE , -SPECTRE_V2_RETPOLINE_MINIMAL , -SPECTRE_V2_RETPOLINE_MINIMAL_AMD ,SPECTRE_V2_RETPOLINE_GENERIC ,SPECTRE_V2_RETPOLINE_AMD ,SPECTRE_V2_IBRS_ENHANCED ,
arch/x86/kernel/cpu/bugs.c +2 -11
@@ -135,8 +135,6 @@ enum spectre_v2_mitigation_cmd {static const char *spectre_v2_strings[] = { [SPECTRE_V2_NONE ] ="Vulnerable" , - [SPECTRE_V2_RETPOLINE_MINIMAL ] ="Vulnerable: Minimal generic ASM retpoline" , - [SPECTRE_V2_RETPOLINE_MINIMAL_AMD ] ="Vulnerable: Minimal AMD ASM retpoline" , [SPECTRE_V2_RETPOLINE_GENERIC ] ="Mitigation: Full generic retpoline" , [SPECTRE_V2_RETPOLINE_AMD ] ="Mitigation: Full AMD retpoline" , [SPECTRE_V2_IBRS_ENHANCED ] ="Mitigation: Enhanced IBRS" ,
@@ -250,11 +248,6 @@ static void __init spec2_print_if_secure(const char *reason)pr_info ("%s selected on command line.\n" , reason); } -static inline bool retp_compiler (void ) -{ -return __is_defined (CONFIG_RETPOLINE ); -} -static inline bool match_option (const char *arg,int arglen,const char *opt) {int len =strlen (opt);
@@ -417,14 +410,12 @@ retpoline_auto:pr_err ("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n" ); goto retpoline_generic; } - mode =retp_compiler () ?SPECTRE_V2_RETPOLINE_AMD : -SPECTRE_V2_RETPOLINE_MINIMAL_AMD ; + mode =SPECTRE_V2_RETPOLINE_AMD ;setup_force_cpu_cap (X86_FEATURE_RETPOLINE_AMD );setup_force_cpu_cap (X86_FEATURE_RETPOLINE ); }else { retpoline_generic: - mode =retp_compiler () ?SPECTRE_V2_RETPOLINE_GENERIC : -SPECTRE_V2_RETPOLINE_MINIMAL ; + mode =SPECTRE_V2_RETPOLINE_GENERIC ;setup_force_cpu_cap (X86_FEATURE_RETPOLINE ); }
tip-bot for Zhenzhong Duan
merge bot[tip:x86/pti] x86/retpoline: Remove minimal retpoline support
In reply to Zhenzhong Duanx86/retpoline: Remove minimal retpoline support
Commit-ID: ef014aae8f1cd2793e4e014bbb102bed53f852b7 Gitweb: https://git.kernel.org/tip/ef014aae8f1cd2793e4e014bbb102bed53f852b7 Author: Zhenzhong Duan <[email protected]> AuthorDate: Fri, 2 Nov 2018 01:45:41 -0700 Committer: Thomas Gleixner <[email protected]> CommitDate: Wed, 28 Nov 2018 11:57:03 +0100
x86/retpoline: Remove minimal retpoline support
Now that CONFIG_RETPOLINE hard depends on compiler support, there is no reason to keep the minimal retpoline support around which only provided basic protection in the assembly files.
--- arch/x86/include/asm/nospec-branch.h | 2 -- arch/x86/kernel/cpu/bugs.c | 13 ++----------- 2 files changed, 2 insertions(+), 13 deletions(-)
arch/x86/include/asm/nospec-branch.h +0 -2
@@ -221,8 +221,6 @@/* The Spectre V2 mitigation variants */ enum spectre_v2_mitigation {SPECTRE_V2_NONE , -SPECTRE_V2_RETPOLINE_MINIMAL , -SPECTRE_V2_RETPOLINE_MINIMAL_AMD ,SPECTRE_V2_RETPOLINE_GENERIC ,SPECTRE_V2_RETPOLINE_AMD ,SPECTRE_V2_IBRS_ENHANCED ,
arch/x86/kernel/cpu/bugs.c +2 -11
@@ -135,8 +135,6 @@ enum spectre_v2_mitigation_cmd {static const char *spectre_v2_strings[] = { [SPECTRE_V2_NONE ] ="Vulnerable" , - [SPECTRE_V2_RETPOLINE_MINIMAL ] ="Vulnerable: Minimal generic ASM retpoline" , - [SPECTRE_V2_RETPOLINE_MINIMAL_AMD ] ="Vulnerable: Minimal AMD ASM retpoline" , [SPECTRE_V2_RETPOLINE_GENERIC ] ="Mitigation: Full generic retpoline" , [SPECTRE_V2_RETPOLINE_AMD ] ="Mitigation: Full AMD retpoline" , [SPECTRE_V2_IBRS_ENHANCED ] ="Mitigation: Enhanced IBRS" ,
@@ -250,11 +248,6 @@ static void __init spec2_print_if_secure(const char *reason)pr_info ("%s selected on command line.\n" , reason); } -static inline bool retp_compiler (void ) -{ -return __is_defined (CONFIG_RETPOLINE ); -} -static inline bool match_option (const char *arg,int arglen,const char *opt) {int len =strlen (opt);
@@ -417,14 +410,12 @@ retpoline_auto:pr_err ("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n" ); goto retpoline_generic; } - mode =retp_compiler () ?SPECTRE_V2_RETPOLINE_AMD : -SPECTRE_V2_RETPOLINE_MINIMAL_AMD ; + mode =SPECTRE_V2_RETPOLINE_AMD ;setup_force_cpu_cap (X86_FEATURE_RETPOLINE_AMD );setup_force_cpu_cap (X86_FEATURE_RETPOLINE ); }else { retpoline_generic: - mode =retp_compiler () ?SPECTRE_V2_RETPOLINE_GENERIC : -SPECTRE_V2_RETPOLINE_MINIMAL ; + mode =SPECTRE_V2_RETPOLINE_GENERIC ;setup_force_cpu_cap (X86_FEATURE_RETPOLINE ); }