Skip to content

Commit ab9f238

Browse files
pa1guptabp3tk0v
authored andcommitted
x86/bugs: Allow ITS stuffing in eIBRS+retpoline mode also
After a recent restructuring of the ITS mitigation, RSB stuffing can no longer be enabled in eIBRS+Retpoline mode. Before ITS, retbleed mitigation only allowed stuffing when eIBRS was not enabled. This was perfectly fine since eIBRS mitigates retbleed. However, RSB stuffing mitigation for ITS is still needed with eIBRS. The restructuring solely relies on retbleed to deploy stuffing, and does not allow it when eIBRS is enabled. This behavior is different from what was before the restructuring. Fix it by allowing stuffing in eIBRS+retpoline mode also. Fixes: 61ab72c ("x86/bugs: Restructure ITS mitigation") Closes: https://lore.kernel.org/lkml/20250519235101.2vm6sc5txyoykb2r@desk/ 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/20250611-eibrs-fix-v4-7-5ff86cac6c61@linux.intel.com
1 parent e2a9c03 commit ab9f238

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

arch/x86/kernel/cpu/bugs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,8 @@ static inline bool cdt_possible(enum spectre_v2_mitigation mode)
11261126
!IS_ENABLED(CONFIG_MITIGATION_RETPOLINE))
11271127
return false;
11281128

1129-
if (mode == SPECTRE_V2_RETPOLINE)
1129+
if (mode == SPECTRE_V2_RETPOLINE ||
1130+
mode == SPECTRE_V2_EIBRS_RETPOLINE)
11301131
return true;
11311132

11321133
return false;
@@ -1281,7 +1282,7 @@ static void __init retbleed_update_mitigation(void)
12811282

12821283
if (retbleed_mitigation == RETBLEED_MITIGATION_STUFF &&
12831284
!cdt_possible(spectre_v2_enabled)) {
1284-
pr_err("WARNING: retbleed=stuff depends on spectre_v2=retpoline\n");
1285+
pr_err("WARNING: retbleed=stuff depends on retpoline\n");
12851286
retbleed_mitigation = RETBLEED_MITIGATION_NONE;
12861287
}
12871288

@@ -1454,6 +1455,7 @@ static void __init its_update_mitigation(void)
14541455
its_mitigation = ITS_MITIGATION_OFF;
14551456
break;
14561457
case SPECTRE_V2_RETPOLINE:
1458+
case SPECTRE_V2_EIBRS_RETPOLINE:
14571459
/* Retpoline+CDT mitigates ITS */
14581460
if (retbleed_mitigation == RETBLEED_MITIGATION_STUFF)
14591461
its_mitigation = ITS_MITIGATION_RETPOLINE_STUFF;

0 commit comments

Comments
 (0)