]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
xen/arm: domain_build: Don't continue if unable to allocate all dom0 banks
authorJulien Grall <julien.grall@arm.com>
Wed, 21 Aug 2019 21:42:31 +0000 (22:42 +0100)
committerJulien Grall <julien.grall@arm.com>
Wed, 2 Oct 2019 08:51:17 +0000 (09:51 +0100)
Xen will only print a warning if there are memory unallocated when using
1:1 mapping (only used by dom0). This also includes the case where no
memory has been allocated.

It will bring to all sort of issues that can be hard to diagnostic for
users (the warning can be difficult to spot or disregard).

If the users request 1GB of memory, then most likely they want the exact
amount and not 512MB. So panic if all the memory has not been allocated.

After this change, the behavior is the same as for non-1:1 memory
allocation (used by domU).

At the same time, reflow the message to have the format on a single
line.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain_build.c

index ec4f9912ef3f58e2dbdb9258ad69647dee417271..cb5ba21f27116728a1055a5458a58c9f0a702dff 100644 (file)
@@ -358,10 +358,9 @@ static void __init allocate_memory_11(struct domain *d,
     }
 
     if ( kinfo->unassigned_mem )
-        printk("WARNING: Failed to allocate requested dom0 memory."
-               /* Don't want format this as PRIpaddr (16 digit hex) */
-               " %ldMB unallocated\n",
-               (unsigned long)kinfo->unassigned_mem >> 20);
+        /* Don't want format this as PRIpaddr (16 digit hex) */
+        panic("Failed to allocate requested dom0 memory. %ldMB unallocated\n",
+              (unsigned long)kinfo->unassigned_mem >> 20);
 
     for( i = 0; i < kinfo->mem.nr_banks; i++ )
     {