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

[PATCH v3 20/22] tools/libxl: Add 'numa-node-id' property to DomU CPU nodes


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Fri, 19 Jun 2026 16:50:08 +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=CSvaKno6wKGF5JB9lrdTQaier2MX8kOfEf4CgdZcZTA=; b=MFM8OShu5kyLEOXmumAoeRHWYHDHFv/+zlT1cfFJn1Tu53fBww5mAJBkCxvcKoQw8oH1fsNEgOJrQVqDGalA99AIJEb5ezKHlABsjfjaxD+YcqoycNzhqklTkn5MS0A3lF7iJVG+5qCrjk93RRkzC612uS2rM/5DNJsRxE6mwcMHwzjbmOLYzJQ3A8cY7UIwmLuBVoaw7qnL5lgdnsbqQiDD8Ag+76HUwIz67JASQzMM0vK5dtRVNXrOeab/1j9AUxiamiTUW/dSFOVHablHqdvEbdoWyDwa9NVJgQle3ysyuKY0ZPwPOPr3QuBqgw9yaqaZjKpTc6jLoLWxmf5P4Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GgpPST/KyND+N9IkKwWxU73BInLmcW2Ok8OwWiWPeYFOJkQY3BPlAIMkDRM4R/rBfz8/jVrFjmdcmEz5z5n3mTHc1P1kno/sa5qZ5JY514DVswFSZGhjdjLoqJ1KA/q92FUi+etD+xTrxxzTv6CE6CdUd/mChFr52NspTKpsRszpl5L8IsPfUpS+bDaax5rb50bp2JOBa+gPA911ZOCZQ5Z+OBRPI4g2mNVHeSGB3tigvUKJq+7UrJYYDBsIMWz5jezpEg7CgOZCDpmPzTRFn6ycfKkR5J+RgIiP4lCfRWiYtGQJUIMbAahK5lSJU4JbhjtwELiCYCqn+8Qq7SYDTw==
  • 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>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 19 Jun 2026 07:50:59 +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.

Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
---
 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 6eae33cdd2..4b0ed99229 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;
     }
@@ -1390,7 +1402,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®.