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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Mon, 1 Jun 2026 07:47:33 +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=LE6FuAerqw6orzqzu04p0kLbWxovloaphAeAZjKcIaM=; b=BLEvkN4y7G72GnrjmO6tIUDLJPSGucfFWcSSOM12slbD2A8a7XAgPdF1hGOm6u0+eEzL5dBLkg9YF8ilAujpdN8OLOgKxAn6Yq2gVT+EYuChQGYqq/+UPrHrbfh438pU91j8nr6aUuEXL7kso4Nw0HUSvt9kLY/FY1xRCjZy/X2FTCeuRhcSp93TjtDcFXj/fZZV85bzwZFR1MFRDGi2ONKSIzkoE42vwQkWdcBGVVe7ceAXOTuLKfwGzHPEz8w5LfK2kWOrI42RNlXjab/U1oetIcU7njYZt4Pmzyu8VICxea4kDf8xFoj2NuaK/EVW0zJbadRM9DCk/OhLiyWeSw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A9haRMnW71ErQtKS09RyRZIN8yMlyMURA/o6+icTpkKp6dUeoOatFX6IGJD02ss64LH+XHsajk0d5mXvgSfYxXb6yEDX+zsT+Eey0GiIGmbYG19OS/lk2+8LHNlffII4SXLoGJZeLcrrwSmgSjOyUijqOmvWCLu5NK494vHHFwi5iWbIi1dEJVVcXslkViSQ/TmyyZQXrc2BH/wrq+Y8DR6nsikiDC8456SQDAat4tHd3hBLSKlcRKkNs6rfkwuBD9PxaEmnHsWC8qjaN0KaSdSIxd9gk7qJvytwF0oFtxs2lS4gdwyKqn3McBop2+xCfzWBk+OD9AwDRdm57BrTrA==
  • 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: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Sun, 31 May 2026 22:48:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Introduce the CONFIG_CONFIG_DEVICE_TREE_NUMA configuration option for
Device Tree-based NUMA support. Selecting CONFIG_ARM_NUMA enables
CONFIG_DEVICE_TREE_NUMA, which in turn 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/Kconfig   | 8 ++++++++
 xen/arch/arm/setup.c   | 4 ++++
 xen/arch/arm/smpboot.c | 2 ++
 xen/common/Kconfig     | 4 ++++
 4 files changed, 18 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 79622b46a1..e67219e949 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -99,6 +99,14 @@ config MPU
          systems supporting EL2. (UNSUPPORTED)
 endchoice
 
+config ARM_NUMA
+       bool "Device tree based NUMA support (UNSUPPORTED)" if UNSUPPORTED
+    select DEVICE_TREE_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.
+
 source "arch/Kconfig"
 
 config ACPI
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..89fa7d10c7 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -188,6 +188,10 @@ config VM_EVENT
 config NEEDS_LIBELF
        bool
 
+config DEVICE_TREE_NUMA
+       select NUMA
+       bool
+
 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®.