Skip to content

Commit a823da6

Browse files
jpoimboegregkh
authored andcommitted
x86/bugs: Remove CONFIG_BHI_MITIGATION_AUTO and spectre_bhi=auto
commit 36d4fe1 upstream. 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 Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9c9cd01 commit a823da6

File tree

4 files changed

+1
-20
lines changed

4 files changed

+1
-20
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
@@ -5929,9 +5929,6 @@
59295929
on - (default) Enable the HW or SW mitigation
59305930
as needed.
59315931
off - Disable the mitigation.
5932-
auto - Enable the HW mitigation if needed, but
5933-
*don't* enable the SW mitigation except
5934-
for KVM. The system may be vulnerable.
59355932

59365933
spectre_v2= [X86] Control mitigation of Spectre variant 2
59375934
(indirect branch speculation) vulnerability.

arch/x86/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,10 +2584,6 @@ config SPECTRE_BHI_OFF
25842584
bool "off"
25852585
help
25862586
Equivalent to setting spectre_bhi=off command line parameter.
2587-
config SPECTRE_BHI_AUTO
2588-
bool "auto"
2589-
help
2590-
Equivalent to setting spectre_bhi=auto command line parameter.
25912587

25922588
endchoice
25932589

arch/x86/kernel/cpu/bugs.c

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

16301629
static enum bhi_mitigations bhi_mitigation __ro_after_init =
1631-
IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON :
1632-
IS_ENABLED(CONFIG_SPECTRE_BHI_OFF) ? BHI_MITIGATION_OFF :
1633-
BHI_MITIGATION_AUTO;
1630+
IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF;
16341631

16351632
static int __init spectre_bhi_parse_cmdline(char *str)
16361633
{
@@ -1641,8 +1638,6 @@ static int __init spectre_bhi_parse_cmdline(char *str)
16411638
bhi_mitigation = BHI_MITIGATION_OFF;
16421639
else if (!strcmp(str, "on"))
16431640
bhi_mitigation = BHI_MITIGATION_ON;
1644-
else if (!strcmp(str, "auto"))
1645-
bhi_mitigation = BHI_MITIGATION_AUTO;
16461641
else
16471642
pr_err("Ignoring unknown spectre_bhi option (%s)", str);
16481643

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

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

0 commit comments

Comments
 (0)