Skip to content

Commit b0c6499

Browse files
committed
x86/bugs: Remove uses of cpu_mitigations_off()
JIRA: https://issues.redhat.com/browse/RHEL-119227 commit 440d201 Author: David Kaplan <david.kaplan@amd.com> Date: Mon, 15 Sep 2025 08:47:03 -0500 x86/bugs: Remove uses of cpu_mitigations_off() cpu_mitigations_off() is no longer needed because all bugs use attack vector controls to select a mitigation, and cpu_mitigations_off() is equivalent to no attack vectors being selected. Remove the few remaining unnecessary uses of this function in this file. Signed-off-by: David Kaplan <david.kaplan@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 2d713e9 commit b0c6499

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,7 @@ static const char * const mmio_strings[] = {
687687

688688
static void __init mmio_select_mitigation(void)
689689
{
690-
if (!boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA) ||
691-
cpu_mitigations_off()) {
690+
if (!boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA)) {
692691
mmio_mitigation = MMIO_MITIGATION_OFF;
693692
return;
694693
}
@@ -3125,14 +3124,15 @@ static void __init srso_select_mitigation(void)
31253124

31263125
static void __init srso_update_mitigation(void)
31273126
{
3127+
if (!boot_cpu_has_bug(X86_BUG_SRSO))
3128+
return;
3129+
31283130
/* If retbleed is using IBPB, that works for SRSO as well */
31293131
if (retbleed_mitigation == RETBLEED_MITIGATION_IBPB &&
31303132
boot_cpu_has(X86_FEATURE_IBPB_BRTYPE))
31313133
srso_mitigation = SRSO_MITIGATION_IBPB;
31323134

3133-
if (boot_cpu_has_bug(X86_BUG_SRSO) &&
3134-
!cpu_mitigations_off())
3135-
pr_info("%s\n", srso_strings[srso_mitigation]);
3135+
pr_info("%s\n", srso_strings[srso_mitigation]);
31363136
}
31373137

31383138
static void __init srso_apply_mitigation(void)

0 commit comments

Comments
 (0)