Commit ebd47390 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Greg Kroah-Hartman

x86/speculation: Unify conditional spectre v2 print functions

commit 495d470e upstream

There is no point in having two functions and a conditional at the call
Signed-off-by: default avatarThomas Gleixner <>
Reviewed-by: default avatarIngo Molnar <>
Cc: Peter Zijlstra <>
Cc: Andy Lutomirski <>
Cc: Linus Torvalds <>
Cc: Jiri Kosina <>
Cc: Tom Lendacky <>
Cc: Josh Poimboeuf <>
Cc: Andrea Arcangeli <>
Cc: David Woodhouse <>
Cc: Tim Chen <>
Cc: Andi Kleen <>
Cc: Dave Hansen <>
Cc: Casey Schaufler <>
Cc: Asit Mallick <>
Cc: Arjan van de Ven <>
Cc: Jon Masters <>
Cc: Waiman Long <>
Cc: Greg KH <>
Cc: Dave Stewart <>
Cc: Kees Cook <>
Link: default avatarGreg Kroah-Hartman <>
parent 95d41f13
......@@ -256,15 +256,9 @@ static const struct {
{ "auto", SPECTRE_V2_CMD_AUTO, false },
static void __init spec2_print_if_insecure(const char *reason)
static void __init spec_v2_print_cond(const char *reason, bool secure)
if (boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
pr_info("%s selected on command line.\n", reason);
static void __init spec2_print_if_secure(const char *reason)
if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
if (boot_cpu_has_bug(X86_BUG_SPECTRE_V2) != secure)
pr_info("%s selected on command line.\n", reason);
......@@ -307,11 +301,8 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
if (mitigation_options[i].secure)
return cmd;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment