[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251013143444.3999-17-david.kaplan@amd.com>
Date: Mon, 13 Oct 2025 09:34:04 -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 16/56] x86/bugs: Reset ITS mitigation
Add function to reset ITS mitigation back to boot-time default.
Signed-off-by: David Kaplan <david.kaplan@....com>
---
arch/x86/kernel/cpu/bugs.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 67561e5c2154..bf5de097e1a9 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1744,6 +1744,17 @@ static void __init its_apply_mitigation(void)
}
}
+#ifdef CONFIG_DYNAMIC_MITIGATIONS
+static void its_reset_mitigation(void)
+{
+ setup_clear_cpu_cap(X86_FEATURE_INDIRECT_THUNK_ITS);
+ setup_clear_cpu_cap(X86_FEATURE_RETHUNK);
+ x86_return_thunk = __x86_return_thunk;
+ its_mitigation = IS_ENABLED(CONFIG_MITIGATION_ITS) ?
+ ITS_MITIGATION_AUTO : ITS_MITIGATION_OFF;
+}
+#endif
+
#undef pr_fmt
#define pr_fmt(fmt) "Transient Scheduler Attacks: " fmt
@@ -3966,5 +3977,6 @@ void arch_cpu_reset_mitigations(void)
srso_reset_mitigation();
gds_reset_mitigation();
bhi_reset_mitigation();
+ its_reset_mitigation();
}
#endif
--
2.34.1
Powered by blists - more mailing lists