From: Wei Liu <wei.liu2@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH v8 02/21] libxc: duplicate snippet to allocate p2m_host array
Date: Mon, 16 Mar 2015 09:52:21 +0000 [thread overview]
Message-ID: <1426499560-28514-3-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1426499560-28514-1-git-send-email-wei.liu2@citrix.com>
Currently all in tree code doesn't set the superpage flag, I would just
remove superpage support if I can, but Konrad wants it retained for the
moment.
As I'm going to change the p2m_host array allocation, duplicate the code
snippet to allocate p2m_host array in this patch, so that we retain the
behaviour in superpage case.
This patch introduces no functional change and it will make future patch
easier to review. Also removed one stray tab while I was there.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Konrad Wilk <konrad.wilk@oracle.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
tools/libxc/xc_dom_x86.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index bf06fe4..9dbaedb 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -772,15 +772,16 @@ int arch_setup_meminit(struct xc_dom_image *dom)
return rc;
}
- dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->total_pages);
- if ( dom->p2m_host == NULL )
- return -EINVAL;
-
if ( dom->superpages )
{
int count = dom->total_pages >> SUPERPAGE_PFN_SHIFT;
xen_pfn_t extents[count];
+ dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
+ dom->total_pages);
+ if ( dom->p2m_host == NULL )
+ return -EINVAL;
+
DOMPRINTF("Populating memory with %d superpages", count);
for ( pfn = 0; pfn < count; pfn++ )
extents[pfn] = pfn << SUPERPAGE_PFN_SHIFT;
@@ -809,9 +810,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
return rc;
}
/* setup initial p2m */
+ dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
+ dom->total_pages);
+ if ( dom->p2m_host == NULL )
+ return -EINVAL;
for ( pfn = 0; pfn < dom->total_pages; pfn++ )
dom->p2m_host[pfn] = pfn;
-
+
/* allocate guest memory */
for ( i = rc = allocsz = 0;
(i < dom->total_pages) && !rc;
--
1.9.1
next prev parent reply other threads:[~2015-03-16 9:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 9:52 [PATCH v8 00/21] Virtual NUMA for PV and HVM Wei Liu
2015-03-16 9:52 ` [PATCH v8 01/21] xen: make two memory hypercalls vNUMA-aware Wei Liu
2015-03-16 9:52 ` Wei Liu [this message]
2015-03-16 9:52 ` [PATCH v8 03/21] libxc: add p2m_size to xc_dom_image Wei Liu
2015-03-16 9:52 ` [PATCH v8 04/21] libxc: allocate memory with vNUMA information for PV guest Wei Liu
2015-03-16 9:52 ` [PATCH v8 05/21] libxl: introduce vNUMA types Wei Liu
2015-03-16 9:52 ` [PATCH v8 06/21] libxl: add vmemrange to libxl__domain_build_state Wei Liu
2015-03-16 9:52 ` [PATCH v8 07/21] libxl: introduce libxl__vnuma_config_check Wei Liu
2015-03-16 9:52 ` [PATCH v8 08/21] libxl: x86: factor out e820_host_sanitize Wei Liu
2015-03-16 9:52 ` [PATCH v8 09/21] libxl: functions to build vmemranges for PV guest Wei Liu
2015-03-16 9:52 ` [PATCH v8 10/21] libxl: build, check and pass vNUMA info to Xen " Wei Liu
2015-03-16 9:52 ` [PATCH v8 11/21] libxc: indentation change to xc_hvm_build_x86.c Wei Liu
2015-03-16 9:52 ` [PATCH v8 12/21] libxc: allocate memory with vNUMA information for HVM guest Wei Liu
2015-03-16 9:52 ` [PATCH v8 13/21] libxl: build, check and pass vNUMA info to Xen " Wei Liu
2015-03-16 9:52 ` [PATCH v8 14/21] libxl: disallow memory relocation when vNUMA is enabled Wei Liu
2015-03-16 9:52 ` [PATCH v8 15/21] libxl: define LIBXL_HAVE_VNUMA Wei Liu
2015-03-16 9:52 ` [PATCH v8 16/21] libxlu: rework internal representation of setting Wei Liu
2015-03-16 9:52 ` [PATCH v8 17/21] libxlu: nested list support Wei Liu
2015-03-16 9:52 ` [PATCH v8 18/21] libxlu: record location when parsing values Wei Liu
2015-03-18 11:49 ` Ian Campbell
2015-03-16 9:52 ` [PATCH v8 19/21] libxlu: introduce new APIs Wei Liu
2015-03-16 9:52 ` [PATCH v8 20/21] xl: introduce xcalloc Wei Liu
2015-03-16 9:52 ` [PATCH v8 21/21] xl: vNUMA support Wei Liu
2015-03-18 11:49 ` Ian Campbell
2015-03-18 12:31 ` [PATCH v8 00/21] Virtual NUMA for PV and HVM Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1426499560-28514-3-git-send-email-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox