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

Re: [PATCH v5 0/4] xen/arm: Device Tree based CPU topology support


  • To: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 29 Jul 2026 06:47:01 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=valinux.co.jp smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=jTzFhrv8gduAcYmiYXYTBGeXnAvQCC/fsrEHBrw7Hmw=; b=G+2DBXE/80Wy5xBHHOu3RkN+ecb2ZE/Qlm5O+nlUnp2JY9GQ0O2tqLcNIZCud+wo7U5l5dDBNE1bG2zkaw4xbww+MCBBzHWj9ihAS7InPmpnhh87I5gYz+1AlbcPvyh19HgOzTxtjGgnhLaNQNTs9Io1acVeztvh95m+fWZC8YXj7z0aorz3up9JLDLTOzu2ubga9EyY7Cj95IBpKfNAcpsZABBI5QIZiAOnGCyRSCnRLQFopCtrd51Jc62ZFMmN6NGnxWYh9cQ3TpusrPZgvpf49oeJtHR1yy/+bkkSBI1EEStdQ/7VMAYhv/9btXMXqv0bAJMW+nSA41nwaug8VA==
  • 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=jTzFhrv8gduAcYmiYXYTBGeXnAvQCC/fsrEHBrw7Hmw=; b=YrarcwSyLuW11PxdI9fHYQM0pmx1t1fJiqU/0NiLGd4ZajRh05JSSbgZJlykVczwOmWQ/Rhg0Hz+FNcddYJ7FIZmxRbMu5rm1A3YHEVDl/Iv3GaWzqqL1OzLx02KDxGrQpLxL8gWmktfzMZP+h/Zq4IQ2XzTClKNAKsVSZBFqCP95aCzpWzfxm2LwJDN81/pjO693+kbvYXouER62PRXDuHRnxhpMYpf99ERp84PcP8h4q1BTc8P7YwBte6jA7JRb5Vae2cV6hv9PbP+eKEFFlWtSN9jfIGT0aa3kOlnthTF12RMSDUj+Npn3CtuefrR2cImz7zpq4La6cXLLxmCIA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=jMZljVfRYSAUADlr7qHd+ifuT3BHljgY4DJ0Dok0luDXyKAw8cZKOnTJXN6LZ9mPJbbYVt8tmpLAcH655b9COv1jdaAADt2SLi2ZxZO8Vz6TWr9ATcoliFMeBAa9TGPzuessBRX6bIunng/IUEASJUvrC3Q/81Ub0k6KmyvJWtyA5axxBrtHsfTMTX3H3JRiaC0z2K2BKWJAvY1hPRFjbYR6aDogTrfKd9tlG4UOoI+Mu/UcbmpMc+zt7l10bdXnqsnrBNDYomI9EsfyB2yzjgH2Nu+rKr/pkEs4b/upzYsOx/woZMgq7bG/Y7WSTQ/o+cGJAzgwMVpyXEGaijcggg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JSbEB4wTOfgsHWkSDV1zWSbSdZhTNRcbqkVOU0rKJdSPsR3xq6cjnV9OUceIZuB6ELQfmCGhcqxZc8xrpLVRfDANe5OSVCbqUUpGz20aprVmAKqYp70244e5/LhwqeqGRYFCxRWis9UxH+O21z2GT+0lUURtlCzjmImKcaUQYASqoSsgTr0q48iZ4IPSIkFQEK0wEtXU8kyHMWBroqwaUaF1c3MyGhyPEkPJVNQvF0kBGKrWiAWagpF1i5iA2+hKoM8BA/4TdW0IDCIP/CEB8hChI5Qv4AHZlOdg2Kn9Lee8aOgdKK3rk5Arkz+CAhLMxYltopE6stE0esSUcSJ21g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 29 Jul 2026 06:48:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHdD+86KiGaaKUFxUq/ExJkJRYMb7aELDIA
  • Thread-topic: [PATCH v5 0/4] xen/arm: Device Tree based CPU topology support

Hi Hirokazu,

Please use the add_maintainers.pl script before sending to make sure the right 
maintainers
are in copy of your patches otherwise some might miss your patches.

https://xen.readthedocs.io/en/latest/contribute-xen/submit-patch.html#step-2-use-add-maintainers-pl-or-get-maintainer-pl

Cheers
Bertrand

> On 10 Jul 2026, at 00:05, Hirokazu Takahashi <taka@xxxxxxxxxxxxx> wrote:
> 
> Hello,
> 
> This patch series introduces CPU topology support based on
> Device-Tree and ACPI PPTT for ARM Xen.
> 
> In v5, I added code to parse the ACPI PPTT and reflect it in the CPU
> topology information.
> 
> Future Work:
> - Support for the "credit2_runqueue=cluster" option.
> - CPU topology support for RISC-V and PPC (once SMP support is available).
> 
> Changes in v5:
> - Extracted CPU topology information from the ACPI PPTT.
> - Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
>   CONFIG_GENERIC_CPU_TOPOLOGY.
> 
> Changes in v4:
> - Only display the CPU topology configuration prompt in common/Kconfig
>   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
> - Move the definition of the global 'cpu_topology' pointer to
>   common/cpu-topology.c.
> - Update the Makefile to explicitly build objects as .init.o when all
>   functions and data within a file are annotated with __init/__initdata,
>   ensuring their memory is reclaimed after system initialization.
> - Add an error log in the CPU-to-node mapping function for out-of-bounds
>   cases.
> - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
> - Rename variables and functions to avoid ambiguous or misleading terms:
>   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructions.
>   - Avoid 'node' where it could be confused with a NUMA node, explicitly
>     renaming them to clarify they refer to a Device Tree node.
> - Move local variable declarations into the narrowest possible scope.
> - Replace the unsupported "%pOF" printk format specifier with "%s" and
>   explicit node name retrieval.
> - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
>   the header directly includes only what its definitions require.
> - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
>   it with a forward declaration of 'struct dt_device_node'.
> - Use 'const' qualifiers for pointer declarations where the pointed-to
>   structure is not modified.
> - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
>   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
>   take precedence over the generic fallbacks.
> - Introduce inline initialization functions for cpu_sibling_mask and
>   cpu_core_mask in cpu-topology.h, providing separate variants for both
>   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.
> 
> Changes in v3:
> - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
>   map mismatch issue on ARM Xen has been split out into a separate patch.
> - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
> - Allow the system to keep running with a degraded fallback even if
>   the topology table allocation fails.
> - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
>   from RISC-V and PPC processor.h.
> - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
>   Elimination (DCE) where possible.
> - Clean up the code to follow the Xen coding style. Please let me know
>   if I missed any style nits!
> - Verify successful builds across x86, RISC-V, and PPC environments.
> 
> Changes in v2:
> - Generate topology information even when ACPI is enabled. Note that
>   this is a temporary implementation and doesn't yet parse the PPTT
>   (Processor Properties Topology Table).
> - Added support for cpu-map node in Device Tree that doesn't contain
>   explicit cluster node definitions.
> 
> Changes in v1 from the previous series "Introduce Device Tree based NUMA
> support for ARM Xen":
> 
> 1. Optimized Memory Allocation:
>   The series now allocates only the minimum required memory area to manage
>   the essential data for the CPUs.
> 
> 2. Flexible Device Tree Parsing:
>   The parsing logic no longer depends on the definition order of the 'cpu'
>   nodes and 'cpu-map' nodes in the Device Tree. They can now be read
>   correctly even if their orders do not match.
> 
> 3. CPU Hotplug Readiness:
>   To support future CPU hotplug, the system assumes that inactive CPUs are
>   also described in the Device Tree. Xen will pre-load and generate the
>   topology information for these inactive CPUs during the boot phase so
>   it stays available in memory.
> 
> Thank you,
> Hirokazu Takahashi
> 
> Hirokazu Takahashi (4):
>  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
>  xen/sched: Link CPU topology to scheduler
>  xen/sched: Make cpu_nr_siblings() architecture-specific
>  arm/acpi: Parse PPTT to initialize CPU topology
> 
> xen/arch/arm/Kconfig                   |   1 +
> xen/arch/arm/acpi/boot.c               |   2 +
> xen/arch/arm/include/asm/acpi.h        |   2 +
> xen/arch/arm/include/asm/processor.h   |   4 -
> xen/arch/arm/smpboot.c                 |  15 +-
> xen/arch/ppc/include/asm/processor.h   |   4 -
> xen/arch/riscv/include/asm/processor.h |   4 -
> xen/arch/x86/include/asm/processor.h   |   1 +
> xen/common/Kconfig                     |  15 +
> xen/common/Makefile                    |   1 +
> xen/common/cpu-topology.c              |  62 ++++
> xen/common/device-tree/Makefile        |   1 +
> xen/common/device-tree/cpu-topology.c  | 406 +++++++++++++++++++++++++
> xen/common/sched/credit2.c             |  21 +-
> xen/common/sysctl.c                    |   1 +
> xen/drivers/acpi/Kconfig               |   3 +
> xen/drivers/acpi/Makefile              |   1 +
> xen/drivers/acpi/topology.c            | 255 ++++++++++++++++
> xen/include/acpi/actbl3.h              |  30 ++
> xen/include/xen/acpi.h                 |  18 ++
> xen/include/xen/cpu-topology.h         |  83 +++++
> xen/include/xen/dt-cpu-topology.h      |  29 ++
> 22 files changed, 923 insertions(+), 36 deletions(-)
> create mode 100644 xen/common/cpu-topology.c
> create mode 100644 xen/common/device-tree/cpu-topology.c
> create mode 100644 xen/drivers/acpi/topology.c
> create mode 100644 xen/include/xen/cpu-topology.h
> create mode 100644 xen/include/xen/dt-cpu-topology.h
> 
> -- 
> 2.43.0
> 
> 




 


Rackspace

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