Skip to content

Commit a8cf700

Browse files
jpoimboebp3tk0v
authored andcommitted
x86/srso: Fix srso_show_state() side effect
Reading the 'spec_rstack_overflow' sysfs file can trigger an unnecessary MSR write, and possibly even a (handled) exception if the microcode hasn't been updated. Avoid all that by just checking X86_FEATURE_IBPB_BRTYPE instead, which gets set by srso_select_mitigation() if the updated microcode exists. Fixes: fb3bd91 ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Nikolay Borisov <nik.borisov@suse.com> Acked-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/27d128899cb8aee9eb2b57ddc996742b0c1d776b.1693889988.git.jpoimboe@kernel.org
1 parent 10f4c9b commit a8cf700

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2717,7 +2717,7 @@ static ssize_t srso_show_state(char *buf)
27172717

27182718
return sysfs_emit(buf, "%s%s\n",
27192719
srso_strings[srso_mitigation],
2720-
(cpu_has_ibpb_brtype_microcode() ? "" : ", no microcode"));
2720+
boot_cpu_has(X86_FEATURE_IBPB_BRTYPE) ? "" : ", no microcode");
27212721
}
27222722

27232723
static ssize_t gds_show_state(char *buf)

0 commit comments

Comments
 (0)