Skip to content

Commit e9fbc47

Browse files
committed
x86/srso: Disable the mitigation on unaffected configurations
Skip the srso cmd line parsing which is not needed on Zen1/2 with SMT disabled and with the proper microcode applied (latter should be the case anyway) as those are not affected. Fixes: 5a15d83 ("x86/srso: Tie SBPB bit setting to microcode patch detection") Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f58d6fb commit e9fbc47

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2418,8 +2418,10 @@ static void __init srso_select_mitigation(void)
24182418
* IBPB microcode has been applied.
24192419
*/
24202420
if ((boot_cpu_data.x86 < 0x19) &&
2421-
(!cpu_smt_possible() || (cpu_smt_control == CPU_SMT_DISABLED)))
2421+
(!cpu_smt_possible() || (cpu_smt_control == CPU_SMT_DISABLED))) {
24222422
setup_force_cpu_cap(X86_FEATURE_SRSO_NO);
2423+
return;
2424+
}
24232425
}
24242426

24252427
if (retbleed_mitigation == RETBLEED_MITIGATION_IBPB) {
@@ -2696,6 +2698,9 @@ static ssize_t retbleed_show_state(char *buf)
26962698

26972699
static ssize_t srso_show_state(char *buf)
26982700
{
2701+
if (boot_cpu_has(X86_FEATURE_SRSO_NO))
2702+
return sysfs_emit(buf, "Not affected\n");
2703+
26992704
return sysfs_emit(buf, "%s%s\n",
27002705
srso_strings[srso_mitigation],
27012706
(cpu_has_ibpb_brtype_microcode() ? "" : ", no microcode"));

0 commit comments

Comments
 (0)