Skip to content

Commit 4f51173

Browse files
jpoimboeIngo Molnar
authored andcommitted
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: Josh Poimboeuf <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Nikolay Borisov <[email protected]> Link: https://lore.kernel.org/r/3833812ea63e7fdbe36bf8b932e63f70d18e2a2a.1712813475.git.jpoimboe@kernel.org
1 parent 36d4fe1 commit 4f51173

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

arch/x86/Kconfig

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,27 +2633,16 @@ config MITIGATION_RFDS
26332633
stored in floating point, vector and integer registers.
26342634
See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst>
26352635

2636-
choice
2637-
prompt "Clear branch history"
2636+
config MITIGATION_SPECTRE_BHI
2637+
bool "Mitigate Spectre-BHB (Branch History Injection)"
26382638
depends on CPU_SUP_INTEL
2639-
default SPECTRE_BHI_ON
2639+
default y
26402640
help
26412641
Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks
26422642
where the branch history buffer is poisoned to speculatively steer
26432643
indirect branches.
26442644
See <file:Documentation/admin-guide/hw-vuln/spectre.rst>
26452645

2646-
config SPECTRE_BHI_ON
2647-
bool "on"
2648-
help
2649-
Equivalent to setting spectre_bhi=on command line parameter.
2650-
config SPECTRE_BHI_OFF
2651-
bool "off"
2652-
help
2653-
Equivalent to setting spectre_bhi=off command line parameter.
2654-
2655-
endchoice
2656-
26572646
endif
26582647

26592648
config ARCH_HAS_ADD_PAGES

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ enum bhi_mitigations {
16281628
};
16291629

16301630
static enum bhi_mitigations bhi_mitigation __ro_after_init =
1631-
IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF;
1631+
IS_ENABLED(CONFIG_MITIGATION_SPECTRE_BHI) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF;
16321632

16331633
static int __init spectre_bhi_parse_cmdline(char *str)
16341634
{

0 commit comments

Comments
 (0)