|
[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
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |