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

[PATCH 11/21] tools/libxl: Add 'numa-node-id' property to DomU CPU nodes


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Sun, 24 May 2026 09:01:59 +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=vm5+dbsTJv0oVX1IQ9G1iAH7WAbtmEAi6LSc1CXaftU=; b=TC+w04ua2qFIBe0lJKJCelD1rCjoLQiDnrTnIwVSob+I6YMiGBVO2vmA9TVPJZXQ5sl4g15xve8tTY2ZVTpGWhe1XjuVd9lCpWp5uubp89RUeS4KVYnfZqXXcvTlkcCLGIAr8uzyjNmpzU4xAsVqKEARtFz0V64FYS7uUJUn0huDRVGJKXhvmRtyVsCONu2Q4CR4Jh18COXoIyjvApeu3xWqjUey/OKrjg+pbStWplQ++bEMUFKi6i7kKpfIDruTe5IfrP9Y9x69AtducRDJNwwcNfDw3iCvZ9kZ2uWK79fon8vTKYZwniKApRkd2QBuW6HEgslmvpnFylXpk9JgUg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eH+AkP/WWH89d2hhX1WI+hwl2pvfs+wjb5qlO47VDdd3n1xXzkqrilRDlf19NPGw3G80EqngStVNuAGOUVBgb+ULHI3XzsSQIpu+iaOVSYY+7rtm3Nxkfv+qPlH8F4LoBDcMIToBxw3IqMIv2ow8OJlvjcSjSeqSTOZn/YP1Rw22GdcPI3po6vHSLTEUJEfvR/TMDrN7djmZt66C1E09IwXXYODqGPSyw8kBzAVr85p0nsprUzRsJZbk+9xzYKjZ4kgbLcw2LdhNqgqZBFwLzAnTPgRqQ0z77mSWbho2ZlBMcvA+nE0ACsJKesK9ZTYvUbOCEk9ge90sHSXDcs+jlA==
  • 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: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, michal.orzel@xxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx, jgross@xxxxxxxx, bertrand.marquis@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, dfaggioli@xxxxxxxx, gwd@xxxxxxxxxxxxxx, Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Delivery-date: Sun, 24 May 2026 00:02:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Add the 'numa-node-id' property to the cpu nodes in the Device
Tree passed to DomU. This information is retrieved from the
virtual NUMA configuration in the xl domain configuration file.
---
 tools/libs/light/libxl_arm.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 58a357858d..05d0f18e1a 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -571,7 +571,8 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool 
ramdisk,
     return 0;
 }
 
-static int make_cpus_node(libxl__gc *gc, void *fdt, int nr_cpus,
+static int make_cpus_node(libxl__gc *gc, void *fdt,
+                          const libxl_domain_build_info *b_info,
                           const struct arch_info *ainfo)
 {
     int res, i;
@@ -586,7 +587,7 @@ static int make_cpus_node(libxl__gc *gc, void *fdt, int 
nr_cpus,
     res = fdt_property_cell(fdt, "#size-cells", 0);
     if (res) return res;
 
-    for (i = 0; i < nr_cpus; i++) {
+    for (i = 0; i < b_info->max_vcpus; i++) {
         const char *name;
 
         mpidr_aff = libxl__compute_mpdir(i);
@@ -607,6 +608,17 @@ static int make_cpus_node(libxl__gc *gc, void *fdt, int 
nr_cpus,
         res = fdt_property_regs(gc, fdt, 1, 0, 1, mpidr_aff);
         if (res) return res;
 
+        if (b_info->num_vnuma_nodes) {
+            unsigned int vnode;
+            for (vnode = 0; vnode < b_info->num_vnuma_nodes; vnode++) {
+                if (libxl_bitmap_test(&b_info->vnuma_nodes[vnode].vcpus, i)) {
+                    res = fdt_property_u32(fdt, "numa-node-id", vnode);
+                    if (res) return res;
+                    break;
+                }
+            }
+        }
+
         res = fdt_end_node(fdt);
         if (res) return res;
     }
@@ -1421,7 +1433,7 @@ next_resize:
 
         FDT( make_root_properties(gc, vers, fdt) );
         FDT( make_chosen_node(gc, fdt, !!dom->modules[0].blob, state, info) );
-        FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
+        FDT( make_cpus_node(gc, fdt, info, ainfo) );
         FDT( make_psci_node(gc, fdt) );
 
         FDT( make_memory_nodes(gc, fdt, info, dom) );
-- 
2.43.0




 


Rackspace

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