From: Wei Liu Subject: [PATCH for-4.6 v3 3/3] libxc: fix vNUMA memory allocation Date: Mon, 17 Aug 2015 19:57:01 +0100 Message-ID: <1439837821-8930-4-git-send-email-wei.liu2@citrix.com> References: <1439837821-8930-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZRPak-0003Y4-RF for xen-devel@lists.xenproject.org; Mon, 17 Aug 2015 18:57:06 +0000 In-Reply-To: <1439837821-8930-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Wei Liu , Dario Faggioli , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 Tested-by: Boris Ostrovsky Signed-off-by: Wei Liu Reviewed-by: Dario Faggioli --- v3: better commit message --- tools/libxc/xc_hvm_build_x86.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c index ec11f15..ea250dd 100644 --- a/tools/libxc/xc_hvm_build_x86.c +++ b/tools/libxc/xc_hvm_build_x86.c @@ -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 ) { -- 2.1.4