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

[PATCH v2 00/24] Introduce Device Tree based NUMA support for ARM Xen


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Mon, 1 Jun 2026 07:47:30 +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=D3/zwRwToyUW7sgpHxnLbfCUw6Hh/u9E2cfxXK2NMiQ=; b=aBqCSQW/q8TiP+B2QBSqGgCSGBJl11aFW5qN4174g4IA4yBmx6HfXv8T3nlDlheIDddXcu8LkM0CA4Nvb5Nr/rKrDD7/GS/8J2EfrW/FjppVf5Z0hfTonhu6SVXbE3cAs7bAniHOdrWd+6fJNhX+4pz9zbBWM1FB2HTsBKVouDNvWyNME1GVhhgzuWRxhIioiMk4vedVwsbrpkBC6+7MFaHCJWGO0PLiFcAxLaR8ksJzCPm0WjfwRMXHnjqqdAC39fsbn2F+w4sanDtgxSSiKWzNs8P7lLgxtFEpEZ6fBhJxPCu8veUaGz8AX7gxB130qgLIedIVXH9nuW8V2oaeNw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XdYt07bkS+GkSgBZWuKwNaOYAbd2Bp+93o1+c0n613G7qgjN3zZOzX22trznPS2ss/jx9w65p2aexHSMw6dRLG4bH/dl+HN4R7IvxxZK2wu8fezp0nSflob9EpusYSMpQTxy2+XJor6+2lrsdB/H6LP5wW7emNABmD4XFwgvbPJnoPEzw9IhNY3rXZUFE7sJAEBms0J+7jQWxWjI8OVBTjW7DqLHq+D3uuaKG+HWPOFxnOaH6ylr72FxMfa3ae5CpN8CQXAIBnVm9x95EjK+j0M4iKn09oJTZjSsxmQNKQ+z8Z/XMF5VdwasMQe/dPktz7q1llKNDEokrW7eZtyi0g==
  • 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>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Sun, 31 May 2026 22:48:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hello,

Regarding the configuration, we now select CONFIG_ARM_NUMA when
using NUMA on ARM Xen. Eventually, it would be great to have NUMA
enabled by default, just like it is on x86.

I also fixed a bug in the DomU memory layout creation where an x86
dependency was breaking memory allocation for vNUMA nodes. With
this fix, it correctly references the domain's vNUMA node
information and performs NUMA-aware memory allocation.
For now, I've applied a simple fix using #ifdef, but I'm wondering
if we should make this more generic.

Additionally, some code borrowed from the Linux kernel doesn't
strictly follow the Xen coding style. I've left it as-is for now
because I want to avoid creating unnecessary diffs against the
original Linux kernel code.

Changes in v2:
- Fix vNUMA memory allocation algorithm to support ARM
- Allocate vNUMA memory from the associated pNUMA memory
- Include the XSM Policy module size in the required memory
  calculation for Dom0 Bank 0.
- Enforce a minimum chunk size of 4MB during Dom0 memory
  allocation.
- Define the cpu_to_core() and cpu_to_socket() macros in
  cpu-topology.h instead of processor.h, as processor.h should
  strictly focus on processor hardware information.
- Make cpu_nr_siblings() an architecture-specific function.
- Refine the code to conform with the Xen coding style guidelines.

Thanks,
Hirokazu Takahashi

Hirokazu Takahashi (24):
  xen/device-tree: Initial framework for Device Tree NUMA support
  xen/arm: NUMA helper functions via Device Tree helpers
  xen/arm: Introduce CONFIG_DEVICE_TREE_NUMA config option
  xen/arm: Configure NUMA affinity for populated memory banks
  xen/arm: Map populated CPUs to their respective NUMA nodes
  xen/device-tree: Read NUMA node distance from Device Tree
    'distance-map'
  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
  xen/sched: Link CPU topology to scheduler and display via xl info
  xen/sched: Make cpu_nr_siblings() architecture-specific
  xen/common: Allow building ARM32 Xen with CONFIG_NUMA
  tools/libxl: Fix vNUMA memory allocation algorithm to support ARM
  tools/libs/guest: Allocate vNUMA memory from associated pNUMA nodes
  tools/libxl: Add 'numa-node-id' property to DomU memory nodes
  tools/libxl: Add 'numa-node-id' property to DomU CPU nodes
  tools/libxl: Create 'distance-map' node in DomU Device Tree
  xen/arm: Introduce dom0_nodes boot command option
  xen/arm: Set Domain-0 node affinity from dom0_nodes option
  xen/arm: Reflect physical NUMA node IDs in Dom0 memory DT nodes
  xen/arm: Balance Dom0 vCPU assignment across NUMA nodes
  xen/arm: Export Dom0 vCPU-to-NUMA node mapping to Device Tree
  xen/arm: Generate distance-map node for Dom0 Device Tree
  xen/arm: Balance Dom0 memory allocation across allowed NUMA nodes
  xen/arm: Use dedicated function for Static SHM Device Tree creation
  xen/arm: Support numa and dom0_nodes boot options

 docs/misc/xen-command-line.pandoc     |   9 +-
 tools/libs/guest/xg_dom_arm.c         |  62 +++-
 tools/libs/light/libxl_arm.c          | 103 ++++++-
 tools/libs/light/libxl_vnuma.c        |  13 +-
 xen/arch/arm/Kconfig                  |   9 +
 xen/arch/arm/Makefile                 |   1 +
 xen/arch/arm/domain_build.c           | 428 +++++++++++++++++++-------
 xen/arch/arm/include/asm/numa.h       |  19 ++
 xen/arch/arm/include/asm/processor.h  |   4 -
 xen/arch/arm/numa.c                   |  62 ++++
 xen/arch/arm/setup.c                  |   4 +
 xen/arch/arm/smpboot.c                |  35 ++-
 xen/arch/x86/include/asm/processor.h  |   1 +
 xen/common/Kconfig                    |   7 +
 xen/common/device-tree/Makefile       |   2 +
 xen/common/device-tree/bootinfo-fdt.c |   8 +
 xen/common/device-tree/cpu-topology.c | 360 ++++++++++++++++++++++
 xen/common/device-tree/domain-build.c |  99 +++---
 xen/common/device-tree/numa.c         | 142 +++++++++
 xen/common/numa.c                     |   2 +-
 xen/common/sched/credit2.c            |  22 +-
 xen/common/sysctl.c                   |   1 +
 xen/include/xen/bootinfo.h            |  37 +++
 xen/include/xen/cpu-topology.h        |  53 ++++
 xen/include/xen/dt-numa.h             |  31 ++
 xen/include/xen/fdt-domain-build.h    |   2 +
 26 files changed, 1310 insertions(+), 206 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/numa.h
 create mode 100644 xen/arch/arm/numa.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/common/device-tree/numa.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-numa.h

-- 
2.43.0




 


Rackspace

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