[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251013143444.3999-14-david.kaplan@amd.com>
Date: Mon, 13 Oct 2025 09:34:01 -0500
From: David Kaplan <david.kaplan@....com>
To: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>, Josh Poimboeuf <jpoimboe@...nel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>, Ingo Molnar
<mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
<x86@...nel.org>, "H . Peter Anvin" <hpa@...or.com>
CC: Alexander Graf <graf@...zon.com>, Boris Ostrovsky
<boris.ostrovsky@...cle.com>, <linux-kernel@...r.kernel.org>
Subject: [RFC PATCH 13/56] x86/bugs: Reset SRSO mitigations
Add function to reset SRSO mitigations back to their boot-time defaults.
Signed-off-by: David Kaplan <david.kaplan@....com>
---
arch/x86/kernel/cpu/bugs.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 9a9d5309aa56..112553058ccc 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -3312,6 +3312,21 @@ static void __init srso_apply_mitigation(void)
}
}
+#ifdef CONFIG_DYNAMIC_MITIGATIONS
+static void srso_reset_mitigation(void)
+{
+ setup_clear_cpu_cap(X86_FEATURE_RETHUNK);
+ setup_clear_cpu_cap(X86_FEATURE_UNRET);
+ setup_clear_cpu_cap(X86_FEATURE_SRSO_ALIAS);
+ setup_clear_cpu_cap(X86_FEATURE_SRSO);
+ setup_clear_cpu_cap(X86_FEATURE_ENTRY_IBPB);
+ setup_clear_cpu_cap(X86_FEATURE_IBPB_ON_VMEXIT);
+ x86_pred_cmd = PRED_CMD_IBPB;
+ x86_return_thunk = __x86_return_thunk;
+ srso_mitigation = SRSO_MITIGATION_AUTO;
+}
+#endif
+
#undef pr_fmt
#define pr_fmt(fmt) "VMSCAPE: " fmt
@@ -3925,5 +3940,6 @@ void arch_cpu_reset_mitigations(void)
mds_reset_mitigation();
mmio_reset_mitigation();
srbds_reset_mitigation();
+ srso_reset_mitigation();
}
#endif
--
2.34.1
Powered by blists - more mailing lists