From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com,
ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com,
wei.liu2@citrix.com
Cc: Juergen Gross <jgross@suse.com>
Subject: [PATCH 4/5] libxc: split p2m allocation in domain builder from other magic pages
Date: Fri, 11 Sep 2015 14:32:21 +0200 [thread overview]
Message-ID: <1441974742-27352-5-git-send-email-jgross@suse.com> (raw)
In-Reply-To: <1441974742-27352-1-git-send-email-jgross@suse.com>
Add an own function to allocate the p2m list in the domain builder in
order to prepare allocating the p2m list outside of the initial kernel
mapping. This will be needed to support loading domains with huge
memory (>512 GB).
Signed-off-by: Juergen Gross <jgross@suse.com>
---
tools/libxc/include/xc_dom.h | 1 +
tools/libxc/xc_dom_core.c | 3 +++
tools/libxc/xc_dom_x86.c | 11 ++++++++++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index a4ca8a4..43b1eab 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -199,6 +199,7 @@ void xc_dom_register_loader(struct xc_dom_loader *loader);
struct xc_dom_arch {
/* pagetable setup */
int (*alloc_magic_pages) (struct xc_dom_image * dom);
+ int (*alloc_p2m_list) (struct xc_dom_image * dom);
int (*count_pgtables) (struct xc_dom_image * dom);
int (*setup_pgtables) (struct xc_dom_image * dom);
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index bb668b1..81b642e 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -1048,6 +1048,9 @@ int xc_dom_build_image(struct xc_dom_image *dom)
}
/* allocate other pages */
+ if ( dom->arch_hooks->alloc_p2m_list &&
+ dom->arch_hooks->alloc_p2m_list(dom) != 0 )
+ goto err;
if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
goto err;
if ( dom->arch_hooks->count_pgtables )
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 3d40fa4..91d4e49 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -438,7 +438,7 @@ pfn_error:
/* ------------------------------------------------------------------------ */
-static int alloc_magic_pages(struct xc_dom_image *dom)
+static int alloc_p2m_list(struct xc_dom_image *dom)
{
size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
@@ -450,6 +450,13 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
if ( dom->p2m_guest == NULL )
return -1;
+ return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int alloc_magic_pages(struct xc_dom_image *dom)
+{
/* allocate special pages */
dom->start_info_pfn = xc_dom_alloc_page(dom, "start info");
dom->xenstore_pfn = xc_dom_alloc_page(dom, "xenstore");
@@ -676,6 +683,7 @@ static struct xc_dom_arch xc_dom_32_pae = {
.page_shift = PAGE_SHIFT_X86,
.sizeof_pfn = 4,
.alloc_magic_pages = alloc_magic_pages,
+ .alloc_p2m_list = alloc_p2m_list,
.count_pgtables = count_pgtables_x86_32_pae,
.setup_pgtables = setup_pgtables_x86_32_pae,
.start_info = start_info_x86_32,
@@ -689,6 +697,7 @@ static struct xc_dom_arch xc_dom_64 = {
.page_shift = PAGE_SHIFT_X86,
.sizeof_pfn = 8,
.alloc_magic_pages = alloc_magic_pages,
+ .alloc_p2m_list = alloc_p2m_list,
.count_pgtables = count_pgtables_x86_64,
.setup_pgtables = setup_pgtables_x86_64,
.start_info = start_info_x86_64,
--
2.1.4
next prev parent reply other threads:[~2015-09-11 12:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 12:32 [PATCH 0/5] libxc: support building large pv-domains Juergen Gross
2015-09-11 12:32 ` [PATCH 1/5] libxc: remove allocate member from struct xc_dom_image Juergen Gross
2015-09-11 12:44 ` Ian Jackson
2015-09-25 15:39 ` Ian Campbell
2015-09-28 3:55 ` Juergen Gross
2015-09-28 9:33 ` Ian Campbell
2015-09-11 12:32 ` [PATCH 2/5] libxc: do initrd processing of domain builder in own function Juergen Gross
2015-09-11 12:45 ` Ian Jackson
2015-09-25 15:39 ` Ian Campbell
2015-09-11 12:32 ` [PATCH 3/5] libxc: create unmapped initrd in domain builder if supported Juergen Gross
2015-09-11 12:54 ` Ian Jackson
2015-09-11 13:15 ` Julien Grall
2015-09-11 13:39 ` Juergen Gross
2015-09-25 15:22 ` Ian Campbell
2015-09-11 13:32 ` Juergen Gross
2015-09-11 15:51 ` Ian Jackson
2015-09-11 12:32 ` Juergen Gross [this message]
2015-10-01 12:47 ` [PATCH 4/5] libxc: split p2m allocation in domain builder from other magic pages Ian Campbell
2015-10-02 3:55 ` Juergen Gross
2015-10-02 9:04 ` Ian Campbell
2015-10-02 9:14 ` Juergen Gross
2015-10-02 9:28 ` Ian Campbell
2015-09-11 12:32 ` [PATCH 5/5] libxc: create p2m list outside of kernel mapping if supported Juergen Gross
2015-09-11 13:28 ` [PATCH 0/5] libxc: support building large pv-domains Ian Campbell
2015-09-11 13:42 ` Juergen Gross
2015-09-11 13:53 ` Ian Campbell
2015-09-11 14:01 ` Juergen Gross
2015-09-25 15:40 ` Ian Campbell
2015-09-22 12:12 ` Juergen Gross
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=1441974742-27352-5-git-send-email-jgross@suse.com \
--to=jgross@suse.com \
--cc=Ian.Campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xensource.com \
/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;
as well as URLs for NNTP newsgroup(s).