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

[PATCH v3 03/22] xen/arm: NUMA helper functions via Device Tree helpers


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Fri, 19 Jun 2026 16:49: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=61LMVP4jRTDvsJV5c8jFg3V5iNl05Shx6hWCtT3eNHQ=; b=bJ4OE3UhNKTtg2QKkXAGsOi7Zbk9Wy6U8LrKZ55dNCDgdZHmTBI2piCj+I1UMV0jkJ0n4ruUgJH0J2uHk/ZyFuEcPlCypyE614Pnki0vq3rSTvFKc3UyUprwZZ536xhbJqSbAIH9n02k+q71+ejnWARivQFK593RudXMA+lvjM2f2LHKLeCcrBOFXka/PJNIG32ymYRC975gUJgWLznl3M5dJqKQI8NzWCwQ/pAxmNCoA2LzVc4VZTkwcSXQd3o5oHV6NvjVVpd/+nVUbfs1YORVTAwQRpcUl5mPFuZqAW6YtWjSV4IXnzcK9ZZw1besu6x1KNMjFNQeUlZxeOfD4w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i+EGGOtU64Oob4wpmwj/yUyLfzeQNMcmg/FrDHQglIZYTROQUHRep4bqQye0W7OV1EC+k0Vf0xQI/y+XWxLPs0q9g66mCcdz/2/YdWEmisp0nxtKg2Ks6bh+eQNCZP/LTZAMZCApAtl8UyHMuWf1RpWhcUw0yC8rY49A4D7sDMUli7JmhysgU+nBtLzDrnIU8Y4gJA7ri2bx73Cv3awM/eMdjZ2w80FP4nsAQwdHGW/W8zQZ5ISC9C6GJHzo/bGpEakV+jGpp/Y5e/DB7WCQ0oN4AmNCo70sVUEDl9TTk9t32bl8Ak9NhgOWa/x8bRSj0HIpVzKjpzf0tCCQX7oeXw==
  • 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>
  • Delivery-date: Fri, 19 Jun 2026 07:50:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Implement the NUMA helper functions for ARM Xen by invoking
the Device Tree-based NUMA helper functions.

Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
---
 xen/arch/arm/Makefile           |  1 +
 xen/arch/arm/include/asm/numa.h | 19 +++++++++++++
 xen/arch/arm/numa.c             | 50 +++++++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 xen/arch/arm/include/asm/numa.h
 create mode 100644 xen/arch/arm/numa.c

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 84c4062b30..10d20e3a84 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -51,6 +51,7 @@ obj-y += setup.o
 obj-y += shutdown.o
 obj-y += smp.o
 obj-y += smpboot.o
+obj-$(CONFIG_NUMA) += numa.o
 obj-$(CONFIG_SYSCTL) += sysctl.o
 obj-y += time.o
 obj-y += traps.o
diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h
new file mode 100644
index 0000000000..8c46048ac8
--- /dev/null
+++ b/xen/arch/arm/include/asm/numa.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_ARM_NUMA_H
+#define _ASM_ARM_NUMA_H 1
+
+#include <xen/types.h>
+#include <xen/cpumask.h>
+#include <xen/vmap.h>
+#include <xen/dt-numa.h>
+
+typedef uint8_t nodeid_t;
+
+#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
+
+extern bool numa_disabled(void);
+extern unsigned int numa_node_to_arch_nid(nodeid_t n);
+extern uint8_t __node_distance(nodeid_t a, nodeid_t b);
+
+#define arch_want_default_dmazone() (num_online_nodes() > 1)
+
+#endif /* _ASM_ARM_NUMA_H */
diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c
new file mode 100644
index 0000000000..1fddf7d15b
--- /dev/null
+++ b/xen/arch/arm/numa.c
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Helper functions for ARM NUMA.
+ */
+
+#include <xen/bootinfo.h>
+#include <xen/init.h>
+#include <xen/numa.h>
+
+#if CONFIG_ACPI_NUMA
+#error "ACPI NUMA isn't supported yet."
+#endif /* CONFIG_ACPI_NUMA */
+
+
+bool arch_numa_disabled(void)
+{
+    return false;
+}
+
+unsigned int numa_node_to_arch_nid(nodeid_t n)
+{
+    return numa_node_to_dt_nid(n);
+}
+
+uint8_t __node_distance(nodeid_t a, nodeid_t b)
+{
+    return numa_node_distance(a, b);
+}
+
+int __init arch_numa_setup(const char *opt)
+{
+    /* parse "numa=" option */
+    return 0;
+}
+
+int __init arch_get_ram_range(unsigned int idx, paddr_t *start, paddr_t *end)
+{
+    return bootinfo_get_ram_range(idx, start, end);
+}
+
+bool __init arch_numa_unavailable(void)
+{
+    return false;
+}
+
+void __init numa_fw_bad(void)
+{
+    printk(KERN_ERR "%s NUMA info is broken.\n", numa_fw_nid_name);
+}
+
-- 
2.43.0




 


Rackspace

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