From: Grygorii Strashko <[email protected]>
Call stack for dom0less hwdom case (1:1) memory:
create_domUs
|-construct_domU
|-construct_hwdom()
|-allocate_memory_11()
And allocate_memory_11() uses "dom0_mem" as:
min_low_order =
get_order_from_bytes(min_t(paddr_t, dom0_mem, MB(128)));
In case of dom0less boot the "dom0_mem" is not used and defaulted to 0,
which causes min_low_order to get high value > order and so no allocations
happens from low memory.
Fix it, by using kinfo->unassigned_mem instead of "dom0_mem" has correct
memory size in both cases: regular dom0 boot and dom0less boot.
Fixes: 43afe6f030244 ("xen/common: dom0less: introduce common dom0less-build.c")
Signed-off-by: Grygorii Strashko <[email protected]>
---
xen/arch/arm/domain_build.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 801a09071a50..0a555d1ae0e5 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -278,7 +278,7 @@ static void __init allocate_memory_11(struct domain *d,
struct kernel_info *kinfo)
{
const unsigned int min_low_order =
- get_order_from_bytes(min_t(paddr_t, dom0_mem, MB(128)));
+ get_order_from_bytes(min_t(paddr_t, kinfo->unassigned_mem, MB(128)));
const unsigned int min_order = get_order_from_bytes(MB(4));
struct membanks *mem = kernel_info_get_mem(kinfo);
struct page_info *pg;
--
2.34.1