|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen stable-4.21] x86/spec-ctrl: Mitigate the new TSA-Fill variant
commit 9acf6bcf75520a6054aed4e3ecf6643be429d832
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Nov 7 15:00:32 2025 +0000
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue Nov 10 18:10:20 2026 +0000
x86/spec-ctrl: Mitigate the new TSA-Fill variant
A new variant of TSA has been found, affecting only Zen5 CPUs.
Updated microcode has been issued. Unlike the original TSA, this microcode
does enumerate VERW_CLEAR, so Xen does not need a table of microcode
revisions. The handling of VERW_CLEAR for guests is the same as before.
A new CPUID bit, TSA_FILL_NO, indicates that the system is unaffected. It
is
expected to be set on all Zen6 and later systems. Zen4 and older are
believed
to be unaffected, and need to synthesise the bit for guests.
This is CVE-2026-0004, part of XSA-525.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
(cherry picked from commit d44b131ce954905205a478e19c8422aa2ec9e399)
---
xen/arch/x86/include/asm/cpufeature.h | 1 +
xen/arch/x86/spec_ctrl.c | 33 +++++++++++++++++++++++++++--
xen/include/public/arch-x86/cpufeatureset.h | 1 +
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/include/asm/cpufeature.h
b/xen/arch/x86/include/asm/cpufeature.h
index b6cf0c8dfc..ee4d567c39 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -284,6 +284,7 @@ static inline bool boot_cpu_has(unsigned int feat)
/* CPUID level 0x80000021.ecx */
#define cpu_has_tsa_sq_no boot_cpu_has(X86_FEATURE_TSA_SQ_NO)
#define cpu_has_tsa_l1_no boot_cpu_has(X86_FEATURE_TSA_L1_NO)
+#define cpu_has_tsa_fill_no boot_cpu_has(X86_FEATURE_TSA_FILL_NO)
/* Synthesized. */
#define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON)
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index c1d2cee78d..6c424792ce 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -515,7 +515,7 @@ static void __init print_details(enum ind_thunk thunk)
* Hardware read-only information, stating immunity to certain issues, or
* suggestions of which mitigation to use.
*/
- printk(" Hardware
hints:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ printk(" Hardware
hints:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
(caps & ARCH_CAPS_RDCL_NO) ? " RDCL_NO"
: "",
(caps & ARCH_CAPS_EIBRS) ? " EIBRS"
: "",
(caps & ARCH_CAPS_RSBA) ? " RSBA"
: "",
@@ -542,7 +542,8 @@ static void __init print_details(enum ind_thunk thunk)
(e21a & cpufeat_mask(X86_FEATURE_SRSO_NO)) ? " SRSO_NO"
: "",
(e21a & cpufeat_mask(X86_FEATURE_SRSO_US_NO)) ? " SRSO_US_NO"
: "",
(e21c & cpufeat_mask(X86_FEATURE_TSA_SQ_NO)) ? " TSA_SQ_NO"
: "",
- (e21c & cpufeat_mask(X86_FEATURE_TSA_L1_NO)) ? " TSA_L1_NO"
: "");
+ (e21c & cpufeat_mask(X86_FEATURE_TSA_L1_NO)) ? " TSA_L1_NO"
: "",
+ (e21c & cpufeat_mask(X86_FEATURE_TSA_FILL_NO)) ? " TSA_FILL_NO"
: "");
/* Hardware features which need driving to mitigate issues. */
printk(" Hardware features:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
@@ -1600,6 +1601,33 @@ static void __init tsa_sq_l1_calculations(void)
setup_force_cpu_cap(X86_FEATURE_VERW_CLEAR);
}
+/*
+ * Transient Scheduler Attacks (L1-Fill)
+ *
+ *
https://www.amd.com/content/dam/amd/en/documents/resources/bulletin/technical-guidance-for-mitigating-transient-scheduler-attacks.pdf
+ */
+static void __init tsa_fill_calculations(void)
+{
+ /* TSA is only known to affect AMD processors at this time. */
+ if ( boot_cpu_data.vendor != X86_VENDOR_AMD )
+ return;
+
+ /* If we're virtualised, don't attempt to synthesise anything. */
+ if ( cpu_has_hypervisor )
+ return;
+
+ /*
+ * Zen6 and later CPUs are expected to enumerate TSA_FILL_NO.
+ *
+ * Zen5 CPUs are vulnerable and get VERW_CLEAR in microcode.
+ *
+ * Zen4 and earlier are not believed to be affected, but do not enumerate
+ * TSA_FILL_NO. Synthesise it.
+ */
+ if ( boot_cpu_data.family < 0x1a )
+ setup_force_cpu_cap(X86_FEATURE_TSA_FILL_NO);
+}
+
static bool __init cpu_has_gds(void)
{
/*
@@ -2345,6 +2373,7 @@ void __init init_speculation_mitigations(void)
mds_calculations();
rfds_calculations();
tsa_sq_l1_calculations();
+ tsa_fill_calculations();
/*
* Parts which enumerate FB_CLEAR are those with now-updated microcode
diff --git a/xen/include/public/arch-x86/cpufeatureset.h
b/xen/include/public/arch-x86/cpufeatureset.h
index cdef24eb79..eb655e84af 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -402,6 +402,7 @@ XEN_CPUFEATURE(ITS_NO, 16*32+62) /*!A No
Indirect Target Selection *
/* AMD-defined CPU features, CPUID level 0x80000021.ecx, word 18 */
XEN_CPUFEATURE(TSA_SQ_NO, 18*32+ 1) /*!A No Store Queue Transitive
Scheduler Attacks */
XEN_CPUFEATURE(TSA_L1_NO, 18*32+ 2) /*!A No L1D Transitive Scheduler
Attacks */
+XEN_CPUFEATURE(TSA_FILL_NO, 18*32+ 7) /*A No L1D-Fill Transitive
Scheduler Attacks */
#endif /* XEN_CPUFEATURE */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |