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

[PATCH v3 04/22] xen/arm: Introduce CONFIG_DEVICE_TREE_NUMA config option


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Fri, 19 Jun 2026 16:49:52 +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=w5eM+J/7ubhVIxsE8BzSDXPV5iMSGeqFPP4HDzWpfNc=; b=dLxwv708/wci1AG2ZfnMcFk7QWwhzIe3VeC4wxme3/Tsw9L292eBcXx0g3PSugR7Amu/kO6QJ8zlYZuOVu51SnbIUOpN89V6q7FgcScRGWAMVxHNm0foizAQAk7Z8eqnqy7ExpGnhwF4Z6YXqeWGFcwug7cSNUc+m3P+iAOYcpKG9LkFaDUypSNVZVcqIrQaqgGW663H/5R3LfJiP24XiqxZDSqmnhWY6jNDyo9HfSzfNkfrHp0qBxyvLlwrlw3NhEduoWOBOQghbB+IRFgz9j3ayx9n+8o43MEgx005mCSTmXZqKzmkMVUpODIgnI/aovV6+ESYRqdnSuH+snBuAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MMl72c6ps+r/cVCHAoXLcuPm+HSclKf31FELp8VfbkOSVn2WZaunYDHeEf/ugXrYf8GWv5HyAiehkshaix1JsUmzzZ2Gd2Lyc/R+kICav7/l+rCRVXYgbNLFGePlFX8yB7hVT5WyLG3J7VlU9KdLaTQQK0+533AfiLrdUCewYd6I/tYf13Fb3aVhdPbJY5IYNDn9Q3hiphlvf25JR/tX8K5y3M2VAbWflZji5R2SKQFMaq8574kU+Nqu31Cw3IGIbQeIr6nqG7E6NOrDivoQjtG4cSQoGjuZ9kkqGCcw1N/paqnZ8pKUhm1FSuYPXhZPhjmapFVds+DauoJlkLPbIA==
  • 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: Fri, 19 Jun 2026 07:50:38 +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_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.

Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
---
 xen/arch/arm/Kconfig   | 8 ++++++++
 xen/arch/arm/setup.c   | 4 ++++
 xen/arch/arm/smpboot.c | 2 ++
 xen/common/Kconfig     | 8 ++++++++
 4 files changed, 22 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 5fa89fcb24..c0c03cbd47 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..bfb3a3c007 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -188,6 +188,14 @@ config VM_EVENT
 config NEEDS_LIBELF
        bool
 
+config NUMA_DISTANCE_MAP
+       bool
+
+config DEVICE_TREE_NUMA
+       bool
+       select NUMA
+       select NUMA_DISTANCE_MAP
+
 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®.