On 2024-11-23 13:20, Daniel P. Smith wrote:
Add three properties, memory, mem-min, and mem-max, to the domain node device
tree parsing to define the memory allocation for a domain. All three fields are
expressed in kb and written as a u64 in the device tree entries.
Signed-off-by: Daniel P. Smith <dpsm...@apertussolutions.com>
---
diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index c231191faec7..1c3b7ff0e658 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -609,6 +609,14 @@ int __init construct_dom0(struct boot_domain *bd)
process_pending_softirqs();
+ /* If param dom0_size was not set and HL config provided memory size */
+ if ( !get_memsize(&dom0_size, LONG_MAX) && bd->mem_pages )
+ dom0_size.nr_pages = bd->mem_pages;
+ if ( !get_memsize(&dom0_min_size, LONG_MAX) && bd->min_pages )
+ dom0_size.nr_pages = bd->min_pages;
+ if ( !get_memsize(&dom0_max_size, LONG_MAX) && bd->max_pages )
+ dom0_size.nr_pages = bd->max_pages;
+
This placement seems a little random. Can this move into
dom0_compute_nr_pages()?
if ( is_hvm_domain(d) )
rc = dom0_construct_pvh(bd);
else if ( is_pv_domain(d) )