Commit 4f511739 authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Ingo Molnar

x86/bugs: Replace CONFIG_SPECTRE_BHI_{ON,OFF} with CONFIG_MITIGATION_SPECTRE_BHI

For consistency with the other CONFIG_MITIGATION_* options, replace the
CONFIG_SPECTRE_BHI_{ON,OFF} options with a single
CONFIG_MITIGATION_SPECTRE_BHI option.

[ mingo: Fix ]
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nikolay Borisov <nik.borisov@suse.com>
Link: https://lore.kernel.org/r/3833812ea63e7fdbe36bf8b932e63f70d18e2a2a.1712813475.git.jpoimboe@kernel.org
parent 36d4fe14
...@@ -2633,27 +2633,16 @@ config MITIGATION_RFDS ...@@ -2633,27 +2633,16 @@ config MITIGATION_RFDS
stored in floating point, vector and integer registers. stored in floating point, vector and integer registers.
See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst> See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst>
choice config MITIGATION_SPECTRE_BHI
prompt "Clear branch history" bool "Mitigate Spectre-BHB (Branch History Injection)"
depends on CPU_SUP_INTEL depends on CPU_SUP_INTEL
default SPECTRE_BHI_ON default y
help help
Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks
where the branch history buffer is poisoned to speculatively steer where the branch history buffer is poisoned to speculatively steer
indirect branches. indirect branches.
See <file:Documentation/admin-guide/hw-vuln/spectre.rst> See <file:Documentation/admin-guide/hw-vuln/spectre.rst>
config SPECTRE_BHI_ON
bool "on"
help
Equivalent to setting spectre_bhi=on command line parameter.
config SPECTRE_BHI_OFF
bool "off"
help
Equivalent to setting spectre_bhi=off command line parameter.
endchoice
endif endif
config ARCH_HAS_ADD_PAGES config ARCH_HAS_ADD_PAGES
......
...@@ -1628,7 +1628,7 @@ enum bhi_mitigations { ...@@ -1628,7 +1628,7 @@ enum bhi_mitigations {
}; };
static enum bhi_mitigations bhi_mitigation __ro_after_init = static enum bhi_mitigations bhi_mitigation __ro_after_init =
IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF; IS_ENABLED(CONFIG_MITIGATION_SPECTRE_BHI) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF;
static int __init spectre_bhi_parse_cmdline(char *str) static int __init spectre_bhi_parse_cmdline(char *str)
{ {
......
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