]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
libxl/PCI: align reserved device memory boundary for HAP guests
authorJan Beulich <jbeulich@suse.com>
Thu, 27 Feb 2020 14:45:31 +0000 (15:45 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 27 Feb 2020 14:45:31 +0000 (15:45 +0100)
As the code comment says, this will allow use of a 2Mb super page
mapping at the end of "low" memory.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libxl/libxl_dm.c

index e0c3aa499892c7a3ae0184d1d4d4045e295a4689..f4007bbe5087f074fc4dcd6a886332c8d69b9990 100644 (file)
@@ -562,6 +562,13 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
 
         /* Just check if RDM > our memory boundary. */
         if (rdm_start > rdm_mem_boundary) {
+            /*
+             * For HAP guests round down to a 2Mb boundary to allow use
+             * of large page mappings.
+             */
+            if (libxl_defbool_val(d_config->c_info.hap)
+                && rdm_start > MB(2))
+                rdm_start &= ~(MB(2) - 1);
             /*
              * We will move downwards lowmem_end so we have to expand
              * highmem_end.