Skip to content

Commit 6a7c3c2

Browse files
pa1guptabp3tk0v
authored andcommitted
x86/bugs: Fix spectre_v2 mitigation default on Intel
Commit 480e803 ("x86/bugs: Restructure spectre_v2 mitigation") inadvertently changed the spectre-v2 mitigation default from eIBRS to IBRS on Intel. While splitting the spectre_v2 mitigation in select/update/apply functions, eIBRS and IBRS selection logic was separated in select and update. This caused IBRS selection to not consider that eIBRS mitigation is already selected, fix it. Fixes: 480e803 ("x86/bugs: Restructure spectre_v2 mitigation") Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/20250520-eibrs-fix-v1-1-91bacd35ed09@linux.intel.com
1 parent 61ab72c commit 6a7c3c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,8 @@ static void __init spectre_v2_select_mitigation(void)
21052105

21062106
static void __init spectre_v2_update_mitigation(void)
21072107
{
2108-
if (spectre_v2_cmd == SPECTRE_V2_CMD_AUTO) {
2108+
if (spectre_v2_cmd == SPECTRE_V2_CMD_AUTO &&
2109+
!spectre_v2_in_eibrs_mode(spectre_v2_enabled)) {
21092110
if (IS_ENABLED(CONFIG_MITIGATION_IBRS_ENTRY) &&
21102111
boot_cpu_has_bug(X86_BUG_RETBLEED) &&
21112112
retbleed_mitigation != RETBLEED_MITIGATION_NONE &&

0 commit comments

Comments
 (0)