[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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Peng Fan (OSS)" <peng.fan@xxxxxxxxxxx>
  • Date: Fri, 04 Dec 2026 08:58:49 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ckm/bSNOQ5NemUWfU9b/nbHhne3+71UAydOihr1DSrk=; b=IYOjzp499T+dYEPb1gJVdqc9MGDI3cHs+2yb6GOUT85bsBr1itNFyTzuVARitC5eULLAmztcIQIV7N9jX2lC/cPUUKNaKTyryiXfYRv0cXDibm7V6VcwCCAHsKGgUnXCqjruE1eYzo2XkIcNrXGc+18O0ccvT8u/sT7Wbwt2q/ag/M/xW+Xpvgbb9BAXYWKT52WnBxqddHKY2dUMVKs2QZ0YJPFqS+cv/XYf/TSvnaI489wxRgD3O/W2PYnQf7bGGQ80q2MJcADiKT3vQHLvFvgX/nNqzrDDUPGtnzTF9wnc9OyW4Ke7Re8JR9bx2pPq+sH5XM6e8Q45rQdTazOJlA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wipH/P07TTZHZZPT8LBCo4T5r24riFMlHzPkbqbSZY2V/rJpznqbVkpofYPPUVeWN5slwTb4NDR1NKmkTSso1/c8R2P4bRhabWQBBGHF9dW2gEOW0VCmxZd6glf6KwSkL8VUsijtfC60fs0RtU3Rche+dCD/frJdPKpMxMURS2WvtpoZjjJ0CzuZwglT55gVz2gmmbsuNoMPGcrSNA8G97Jk1RAPBCRKLGN1Lm6hTdtGcrXKTuCXQf5kp/z/HoTsiQO6xvbMcJnUH81V/Y0+2VG9CWwkPGJYq059JrXfyQE//VYixDaWLmhombXJW7PIaAJzcgPGl7ifIqhWyhZGqg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1-NXP1-onmicrosoft-com header.d=NXP1.onmicrosoft.com header.i="@NXP1.onmicrosoft.com" header.h="From:Date:Subject:Message-Id:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Peng Fan <peng.fan@xxxxxxx>
  • Delivery-date: Fri, 04 Dec 2026 01:02:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.