Skip to content

Commit 36d4fe1

Browse files
jpoimboeIngo Molnar
authored andcommitted
x86/bugs: Remove CONFIG_BHI_MITIGATION_AUTO and spectre_bhi=auto
Unlike most other mitigations' "auto" options, spectre_bhi=auto only mitigates newer systems, which is confusing and not particularly useful. Remove it. Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Nikolay Borisov <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lore.kernel.org/r/412e9dc87971b622bbbaf64740ebc1f140bff343.1712813475.git.jpoimboe@kernel.org
1 parent 5f882f3 commit 36d4fe1

File tree

4 files changed

+1
-21
lines changed

4 files changed

+1
-21
lines changed

Documentation/admin-guide/hw-vuln/spectre.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,6 @@ kernel command line.
669669
needed.
670670
off
671671
Disable the mitigation.
672-
auto
673-
Enable the HW mitigation if needed, but
674-
*don't* enable the SW mitigation except for KVM.
675-
The system may be vulnerable.
676672

677673
For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt
678674

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6072,9 +6072,6 @@
60726072
on - (default) Enable the HW or SW mitigation
60736073
as needed.
60746074
off - Disable the mitigation.
6075-
auto - Enable the HW mitigation if needed, but
6076-
*don't* enable the SW mitigation except
6077-
for KVM. The system may be vulnerable.
60786075

60796076
spectre_v2= [X86,EARLY] Control mitigation of Spectre variant 2
60806077
(indirect branch speculation) vulnerability.

arch/x86/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,11 +2651,6 @@ config SPECTRE_BHI_OFF
26512651
bool "off"
26522652
help
26532653
Equivalent to setting spectre_bhi=off command line parameter.
2654-
config SPECTRE_BHI_AUTO
2655-
bool "auto"
2656-
depends on BROKEN
2657-
help
2658-
Equivalent to setting spectre_bhi=auto command line parameter.
26592654

26602655
endchoice
26612656

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,13 +1625,10 @@ static bool __init spec_ctrl_bhi_dis(void)
16251625
enum bhi_mitigations {
16261626
BHI_MITIGATION_OFF,
16271627
BHI_MITIGATION_ON,
1628-
BHI_MITIGATION_AUTO,
16291628
};
16301629

16311630
static enum bhi_mitigations bhi_mitigation __ro_after_init =
1632-
IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON :
1633-
IS_ENABLED(CONFIG_SPECTRE_BHI_OFF) ? BHI_MITIGATION_OFF :
1634-
BHI_MITIGATION_AUTO;
1631+
IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF;
16351632

16361633
static int __init spectre_bhi_parse_cmdline(char *str)
16371634
{
@@ -1642,8 +1639,6 @@ static int __init spectre_bhi_parse_cmdline(char *str)
16421639
bhi_mitigation = BHI_MITIGATION_OFF;
16431640
else if (!strcmp(str, "on"))
16441641
bhi_mitigation = BHI_MITIGATION_ON;
1645-
else if (!strcmp(str, "auto"))
1646-
bhi_mitigation = BHI_MITIGATION_AUTO;
16471642
else
16481643
pr_err("Ignoring unknown spectre_bhi option (%s)", str);
16491644

@@ -1673,9 +1668,6 @@ static void __init bhi_select_mitigation(void)
16731668
setup_force_cpu_cap(X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT);
16741669
pr_info("Spectre BHI mitigation: SW BHB clearing on vm exit\n");
16751670

1676-
if (bhi_mitigation == BHI_MITIGATION_AUTO)
1677-
return;
1678-
16791671
/* Mitigate syscalls when the mitigation is forced =on */
16801672
setup_force_cpu_cap(X86_FEATURE_CLEAR_BHB_LOOP);
16811673
pr_info("Spectre BHI mitigation: SW BHB clearing on syscall\n");

0 commit comments

Comments
 (0)