Skip to content

Commit e2a9c03

Browse files
pa1guptabp3tk0v
authored andcommitted
x86/bugs: Remove its=stuff dependency on retbleed
Allow ITS to enable stuffing independent of retbleed. The dependency is only on retpoline. It is a valid case for retbleed to be mitigated by eIBRS while ITS deploys stuffing at the same time. 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-6-5ff86cac6c61@linux.intel.com
1 parent 8374a27 commit e2a9c03

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

arch/x86/kernel/cpu/bugs.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,13 +1467,8 @@ static void __init its_update_mitigation(void)
14671467
break;
14681468
}
14691469

1470-
/*
1471-
* retbleed_update_mitigation() will try to do stuffing if its=stuff.
1472-
* If it can't, such as if spectre_v2!=retpoline, then fall back to
1473-
* aligned thunks.
1474-
*/
14751470
if (its_mitigation == ITS_MITIGATION_RETPOLINE_STUFF &&
1476-
retbleed_mitigation != RETBLEED_MITIGATION_STUFF)
1471+
!cdt_possible(spectre_v2_enabled))
14771472
its_mitigation = ITS_MITIGATION_ALIGNED_THUNKS;
14781473

14791474
pr_info("%s\n", its_strings[its_mitigation]);
@@ -1485,8 +1480,6 @@ static void __init its_apply_mitigation(void)
14851480
case ITS_MITIGATION_OFF:
14861481
case ITS_MITIGATION_AUTO:
14871482
case ITS_MITIGATION_VMEXIT_ONLY:
1488-
/* its=stuff forces retbleed stuffing and is enabled there. */
1489-
case ITS_MITIGATION_RETPOLINE_STUFF:
14901483
break;
14911484
case ITS_MITIGATION_ALIGNED_THUNKS:
14921485
if (!boot_cpu_has(X86_FEATURE_RETPOLINE))
@@ -1495,6 +1488,11 @@ static void __init its_apply_mitigation(void)
14951488
setup_force_cpu_cap(X86_FEATURE_RETHUNK);
14961489
set_return_thunk(its_return_thunk);
14971490
break;
1491+
case ITS_MITIGATION_RETPOLINE_STUFF:
1492+
setup_force_cpu_cap(X86_FEATURE_RETHUNK);
1493+
setup_force_cpu_cap(X86_FEATURE_CALL_DEPTH);
1494+
set_return_thunk(call_depth_return_thunk);
1495+
break;
14981496
}
14991497
}
15001498

0 commit comments

Comments
 (0)