]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
pvh/dom0: warn when dom0_mem is not set
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 18 Feb 2019 12:44:53 +0000 (13:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 18 Feb 2019 12:44:53 +0000 (13:44 +0100)
There have been several reports of the dom0 builder running out of
memory when building a PVH dom0 without having specified a dom0_mem
value. Print a warning message if dom0_mem is not set when booting in
PVH mode.

This is a temporary workaround until accounting for internal memory
required by Xen (ie: paging structures) is improved.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/dom0_build.c

index 2b4d9e9ea6d5ce4d4e867b5a7d58a832abc710fb..6ebe36766bb5ac83de7fc22ef149ce4074564ff7 100644 (file)
@@ -378,8 +378,18 @@ unsigned long __init dom0_compute_nr_pages(
          * maximum of 128MB.
          */
         if ( !nr_pages )
+        {
             nr_pages = avail - (pv_shim ? pv_shim_mem(avail)
                                  : min(avail / 16, 128UL << (20 - PAGE_SHIFT)));
+            if ( is_hvm_domain(d) && !need_paging )
+                /*
+                 * Temporary workaround message until internal (paging) memory
+                 * accounting required to build a pvh dom0 is improved.
+                 */
+                printk("WARNING: PVH dom0 without dom0_mem set is still unstable. "
+                       "If you get crashes during boot, try adding a dom0_mem parameter\n");
+        }
+
 
         /* Clamp according to min/max limits and available memory. */
         nr_pages = max(nr_pages, min_pages);