]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
libxc: fix vNUMA memory allocation
authorWei Liu <wei.liu2@citrix.com>
Mon, 17 Aug 2015 18:57:01 +0000 (19:57 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 21 Aug 2015 07:45:55 +0000 (08:45 +0100)
Only 4KB allocation was using new_memflags.  We should use new_memflags
in for 2MB and 1GB allocation as well because that variable contains
node information.

Without this patch, when creating a HVM guest with vNUMA, because the
node information was not present in the flags passed to libxc, actual
memory allocation didn't comply with what user specified. With this
patch the behaviour is correct.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_hvm_build_x86.c

index ec11f1567ec1ed9517dae967101ff370fb03a402..ea250ddac4ec2fb8f1f5f56cf262c8d121be604a 100644 (file)
@@ -486,7 +486,8 @@ static int setup_guest(xc_interface *xch,
 
                 done = xc_domain_populate_physmap(xch, dom, nr_extents,
                                                   SUPERPAGE_1GB_SHIFT,
-                                                  memflags, sp_extents);
+                                                  new_memflags,
+                                                  sp_extents);
 
                 if ( done > 0 )
                 {
@@ -526,7 +527,8 @@ static int setup_guest(xc_interface *xch,
 
                     done = xc_domain_populate_physmap(xch, dom, nr_extents,
                                                       SUPERPAGE_2MB_SHIFT,
-                                                      memflags, sp_extents);
+                                                      new_memflags,
+                                                      sp_extents);
 
                     if ( done > 0 )
                     {