提交 ef014aae 编写于 作者: Z Zhenzhong Duan 提交者: Thomas Gleixner

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.
Suggested-by: NPeter Zijlstra <peterz@infradead.org>
Signed-off-by: NZhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Borislav Petkov <bp@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: <srinivas.eeda@oracle.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/f06f0a89-5587-45db-8ed2-0a9d6638d5c0@default
上级 4cd24de3
...@@ -221,8 +221,6 @@ ...@@ -221,8 +221,6 @@
/* The Spectre V2 mitigation variants */ /* The Spectre V2 mitigation variants */
enum spectre_v2_mitigation { enum spectre_v2_mitigation {
SPECTRE_V2_NONE, SPECTRE_V2_NONE,
SPECTRE_V2_RETPOLINE_MINIMAL,
SPECTRE_V2_RETPOLINE_MINIMAL_AMD,
SPECTRE_V2_RETPOLINE_GENERIC, SPECTRE_V2_RETPOLINE_GENERIC,
SPECTRE_V2_RETPOLINE_AMD, SPECTRE_V2_RETPOLINE_AMD,
SPECTRE_V2_IBRS_ENHANCED, SPECTRE_V2_IBRS_ENHANCED,
......
...@@ -135,8 +135,6 @@ enum spectre_v2_mitigation_cmd { ...@@ -135,8 +135,6 @@ enum spectre_v2_mitigation_cmd {
static const char *spectre_v2_strings[] = { static const char *spectre_v2_strings[] = {
[SPECTRE_V2_NONE] = "Vulnerable", [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_GENERIC] = "Mitigation: Full generic retpoline",
[SPECTRE_V2_RETPOLINE_AMD] = "Mitigation: Full AMD retpoline", [SPECTRE_V2_RETPOLINE_AMD] = "Mitigation: Full AMD retpoline",
[SPECTRE_V2_IBRS_ENHANCED] = "Mitigation: Enhanced IBRS", [SPECTRE_V2_IBRS_ENHANCED] = "Mitigation: Enhanced IBRS",
...@@ -250,11 +248,6 @@ static void __init spec2_print_if_secure(const char *reason) ...@@ -250,11 +248,6 @@ static void __init spec2_print_if_secure(const char *reason)
pr_info("%s selected on command line.\n", 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) static inline bool match_option(const char *arg, int arglen, const char *opt)
{ {
int len = strlen(opt); int len = strlen(opt);
...@@ -417,14 +410,12 @@ static void __init spectre_v2_select_mitigation(void) ...@@ -417,14 +410,12 @@ static void __init spectre_v2_select_mitigation(void)
pr_err("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n"); pr_err("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n");
goto retpoline_generic; goto retpoline_generic;
} }
mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_AMD : mode = SPECTRE_V2_RETPOLINE_AMD;
SPECTRE_V2_RETPOLINE_MINIMAL_AMD;
setup_force_cpu_cap(X86_FEATURE_RETPOLINE_AMD); setup_force_cpu_cap(X86_FEATURE_RETPOLINE_AMD);
setup_force_cpu_cap(X86_FEATURE_RETPOLINE); setup_force_cpu_cap(X86_FEATURE_RETPOLINE);
} else { } else {
retpoline_generic: retpoline_generic:
mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_GENERIC : mode = SPECTRE_V2_RETPOLINE_GENERIC;
SPECTRE_V2_RETPOLINE_MINIMAL;
setup_force_cpu_cap(X86_FEATURE_RETPOLINE); setup_force_cpu_cap(X86_FEATURE_RETPOLINE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册