[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 03/21] xen/arm: Introduce CONFIG_DEVICE_TREE_NUMA config option


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Sun, 24 May 2026 09:01:51 +0900
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=valinux.co.jp; dmarc=pass action=none header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; 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=g2lrdoLMqmg98r42qC1DD889Q8lEgAE6Jpi+XHGPJaI=; b=hZai01O1ZyxiyrZbVlD2mhixtjb6F1Czlbs57qMnO0O/NNzKdgtMstXG0MX9Bmj8ONEWtQhdVQ6L6NtcbAL7Upd9sbhbf1WcIA00mHmVCmnBVShQWUaJX6uZ8tQtlOvhVFI+FNzqV3isH5pNxZ1adbsBfPSsflI4hgpCkcW/FKq7bTPFtH4pI2XeXl869YrqmEcFHPOJr9o0Iz8N17wThE7dlZatZH1VH0o1gtn0ISFrsXeN+uXpuXSJZrlVm9dmbZKDfZZBwozkvzQJNC0jWfT0wC7JGwLLmG+JQBRcPjH4BP+Ets/t50MXV8okFGuF8A6kMi1ZkXKqN8fFYPda0Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XKvETBGUOdA6bhyCSqI5xwvCDstWAXnLlgT3e3fl/AENn8pLfofdz4Rx0HzyN7b+z0BPPG1+3pyPGxdEc1fOtLuFtHro5eOJknm1yoSfBLe7CS1bv/osM5QoFYMSqJmKiio4m5DHtUTIOi8RUchxde8boaSHktb2a4j8LdosAC0vmPr5vKsGNGQawa+h628M11oLKowvU2bqSJz57m+rNiJ4CmqyYkX84lp23rwrQ0gIb5byhrSYfNB/p8hzrUwcdVKIXYL7xPXFpo8HRAvzTviS0IIv2Meby023AR83SeSg+cEXVAl6Tx/qfOb8tcS5mix5XtXq+ZHrXwTPPlIPkQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=valinux.co.jp;
  • Cc: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, michal.orzel@xxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx, jgross@xxxxxxxx, bertrand.marquis@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, dfaggioli@xxxxxxxx, gwd@xxxxxxxxxxxxxx, Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Delivery-date: Sun, 24 May 2026 00:02:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Introduce the CONFIG_DEVICE_TREE_NUMA configuration option for
Device Tree-based NUMA support. Selecting CONFIG_DEVICE_TREE_NUMA
automatically selects CONFIG_NUMA. While this option is currently
restricted to the ARM architecture, it is designed to be selectable
for RISC-V and PPC in the future. This patch also includes the
necessary compilation fixes required when building with CONFIG_NUMA,
and creates a single fake NUMA node to ensure Xen can boot
successfully at this stage.
---
 xen/arch/arm/setup.c   | 4 ++++
 xen/arch/arm/smpboot.c | 2 ++
 xen/common/Kconfig     | 9 +++++++++
 3 files changed, 15 insertions(+)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 6310a47d68..c0202d9ff6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -351,6 +351,10 @@ void asmlinkage __init noreturn start_xen(unsigned long 
fdt_paddr)
     /* Parse the ACPI tables for possible boot-time configuration */
     acpi_boot_table_init();
 
+#ifdef CONFIG_NUMA
+    numa_initmem_init(0x0UL, 0x1UL << (PADDR_BITS - 12));
+#endif /* CONFIG_NUMA */
+
     end_boot_allocator();
 
     /*
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 7f3cfa812e..d1651fe7dd 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -47,8 +47,10 @@ integer_param("maxcpus", max_cpus);
 /* CPU logical map: map xen cpuid to an MPIDR */
 register_t __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = MPIDR_INVALID };
 
+#ifndef CONFIG_NUMA
 /* Fake one node for now. See also xen/numa.h */
 nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
+#endif /* CONFIG_NUMA */
 
 /* Xen stack for bringing up the first CPU. */
 static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 5ff71480ee..2365b421bf 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -188,6 +188,15 @@ config VM_EVENT
 config NEEDS_LIBELF
        bool
 
+config DEVICE_TREE_NUMA
+       bool "Device tree based NUMA support (UNSUPPORTED)" if UNSUPPORTED && 
ARM
+       depends on HAS_DEVICE_TREE_DISCOVERY
+       select NUMA
+       help
+         Device tree based NUMA support. The "numa-node-id" property in
+         the CPU and memory nodes of a Device Tree defines the NUMA node
+         to which they belong.
+
 config NUMA
        bool
 
-- 
2.43.0




 


Rackspace

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