On 11/25/24 19:03, Jason Andryuk wrote:
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()?

As I started to rebase the multi-domain code around all the changes that happened under the boot module review, dom0_compute_nr_pages() became a mess to work with again. The result does see this drop in favor of handling during dom_compute_nr_pages(). I will look to back port that refactoring to here.

v/r,
dps

Reply via email to