|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] xen/arm: fix spurious SMT warning on CPUs with MT=1 encoding convention
From: Peng Fan <peng.fan@xxxxxxx>
Some ARM processors, such as Cortex-A55, set MPIDR.MT=1 as a topology
encoding convention to indicate that Aff0 represents thread IDs, without
actually implementing multithreading (SMT). This caused Xen to
unconditionally emit a security warning and incur a 3-second boot delay
via warning_print() on all such platforms.
Fix the detection by verifying that at least one CPU has a non-zero Aff0
affinity level in its cpu_logical_map entry. A non-zero Aff0 is the only
reliable indication that multiple threads share a physical core. Platforms
like Cortex-A55 where all CPUs have Aff0=0 will no longer trigger the
warning.
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
xen/arch/arm/smpboot.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 2fc6c36ca1d3..05fab1fe5174 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -309,9 +309,30 @@ void __init smp_init_cpus(void)
"It has implications on the security and stability of the
system,\n"
"unless the cpu affinity of all domains is specified.\n");
- if ( system_cpuinfo.mpidr.mt == 1 )
- warning_add("WARNING: MULTITHREADING HAS BEEN DETECTED ON THE
PROCESSOR.\n"
- "It might impact the security of the system.\n");
+ /*
+ * MT=1 means Aff0 encodes thread IDs, but some CPUs (e.g. Cortex-A55)
+ * set MT=1 as a topology encoding convention without implementing SMT.
+ * Only warn if Aff0 is non-zero for any CPU, indicating real threads.
+ */
+ if ( system_cpuinfo.mpidr.mt )
+ {
+ unsigned int cpu;
+ bool real_smt = false;
+
+ for_each_possible_cpu ( cpu )
+ {
+ if ( MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 0) != 0 )
+ {
+ real_smt = true;
+ break;
+ }
+ }
+
+ if ( real_smt )
+ warning_add("WARNING: MULTITHREADING HAS BEEN DETECTED ON THE
PROCESSOR.\n"
+ "It might impact the security of the system.\n");
+ }
+
}
unsigned int __init smp_get_max_cpus(void)
---
base-commit: a1bb3efd35c2ea04c861f53df602795abb52038a
change-id: 20261204-a55-mt-e5950b5392ef
Best regards,
--
Peng Fan <peng.fan@xxxxxxx>
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |