On 2024-11-23 13:20, Daniel P. Smith wrote:
Introduce the `cpus` property, named as such for dom0less compatibility, that
represents the maximum number of vpcus to allocate for a domain. In the device
tree, it will be encoded as a u32 value.
Signed-off-by: Daniel P. Smith <dpsm...@apertussolutions.com>
---
diff --git a/xen/arch/x86/domain_builder/fdt.c
b/xen/arch/x86/domain_builder/fdt.c
index b8ace5c18c6a..d24e265f2378 100644
--- a/xen/arch/x86/domain_builder/fdt.c
+++ b/xen/arch/x86/domain_builder/fdt.c
@@ -197,6 +197,18 @@ static int __init process_domain_node(
bd->max_pages = PFN_DOWN(kb * SZ_1K);
printk(" max memory: %ld\n", bd->max_pages << PAGE_SHIFT);
}
+ if ( match_fdt_property(fdt, prop, "cpus" ) )
I think I forgot to mention it on earlier ones, but I think all these
match_fdt_property() should be chained together with "else if".
With that
Reviewed-by: Jason Andryuk <jason.andr...@amd.com>
+ {
+ uint32_t val = UINT_MAX;
+ if ( fdt_prop_as_u32(prop, &val) != 0 )
+ {
+ printk(" failed processing max_vcpus for domain %s\n",
+ name == NULL ? "unknown" : name);
+ return -EINVAL;
+ }
+ bd->max_vcpus = val;
+ printk(" max vcpus: %d\n", bd->max_vcpus);
+ }
}
fdt_for_each_subnode(node, fdt, dom_node)