aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xenguest.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-05-26 09:58:38 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-05-26 09:58:38 +0100
commit6a9b5290e9d24efbc6271b4d7e80682b440c812e (patch)
treeb5ff5a8e6ab3e0fb38810b8b96434fc35ae18b26 /tools/libxc/xenguest.h
parent2cda4bd1e1a623b7c99bf2266dcb9ff82aa0f463 (diff)
downloadxen-6a9b5290e9d24efbc6271b4d7e80682b440c812e.tar.gz
xen-6a9b5290e9d24efbc6271b4d7e80682b440c812e.tar.bz2
xen-6a9b5290e9d24efbc6271b4d7e80682b440c812e.zip
Add support for superpages (hugepages) in PV domain
This patch adds the option "superpages" to the domain configuration file. If it is set, the domain is populated using 2M pages. This code does not support fallback to small pages. If the domain can not be created with 2M pages, the create will fail. The patch also includes support for saving and restoring domains with the superpage flag set. However, if a domain has freed small pages within its physical page array and then extended the array, the restore will fill in those freed pages. It will then attempt to allocate more than its memory limit and will fail. This is significant because apparently Linux does this during boot, thus a freshly booted Linux image can not be saved and restored successfully. Signed-off-by: Dave McCracken <dcm@mccr.org>
Diffstat (limited to 'tools/libxc/xenguest.h')
-rw-r--r--tools/libxc/xenguest.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index d64fc4554b..e8ebeb1ca2 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -40,12 +40,13 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
* @parm store_mfn returned with the mfn of the store page
* @parm hvm non-zero if this is a HVM restore
* @parm pae non-zero if this HVM domain has PAE support enabled
+ * @parm superpages non-zero to allocate guest memory with superpages
* @return 0 on success, -1 on failure
*/
int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
unsigned int store_evtchn, unsigned long *store_mfn,
unsigned int console_evtchn, unsigned long *console_mfn,
- unsigned int hvm, unsigned int pae);
+ unsigned int hvm, unsigned int pae, int superpages);
/**
* This function will create a domain for a paravirtualized Linux
@@ -62,6 +63,7 @@ int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
* @parm store_mfn returned with the mfn of the store page
* @parm console_evtchn the console event channel for this domain to use
* @parm conole_mfn returned with the mfn of the console page
+ * @parm superpages populate memory in guest with superpages
* @return 0 on success, -1 on failure
*/
int xc_linux_build(int xc_handle,
@@ -75,7 +77,8 @@ int xc_linux_build(int xc_handle,
unsigned int store_evtchn,
unsigned long *store_mfn,
unsigned int console_evtchn,
- unsigned long *console_mfn);
+ unsigned long *console_mfn,
+ int superpages);
/** The same interface, but the dom structure is managed by the caller */
struct xc_dom_image;
@@ -89,7 +92,8 @@ int xc_dom_linux_build(int xc_handle,
unsigned int store_evtchn,
unsigned long *store_mfn,
unsigned int console_evtchn,
- unsigned long *console_mfn);
+ unsigned long *console_mfn,
+ int superpages);
/**
* This function will create a domain for a paravirtualized Linux
@@ -108,6 +112,7 @@ int xc_dom_linux_build(int xc_handle,
* @parm store_mfn returned with the mfn of the store page
* @parm console_evtchn the console event channel for this domain to use
* @parm conole_mfn returned with the mfn of the console page
+ * @parm superpages populate memory in guest with superpages
* @return 0 on success, -1 on failure
*/
int xc_linux_build_mem(int xc_handle,
@@ -123,7 +128,8 @@ int xc_linux_build_mem(int xc_handle,
unsigned int store_evtchn,
unsigned long *store_mfn,
unsigned int console_evtchn,
- unsigned long *console_mfn);
+ unsigned long *console_mfn,
+ int superpages);
int xc_hvm_build(int xc_handle,
uint32_t domid,