diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-05-26 09:58:38 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-05-26 09:58:38 +0100 |
commit | 6a9b5290e9d24efbc6271b4d7e80682b440c812e (patch) | |
tree | b5ff5a8e6ab3e0fb38810b8b96434fc35ae18b26 /tools/libxc/xc_dom_compat_linux.c | |
parent | 2cda4bd1e1a623b7c99bf2266dcb9ff82aa0f463 (diff) | |
download | xen-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/xc_dom_compat_linux.c')
-rw-r--r-- | tools/libxc/xc_dom_compat_linux.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c index 92cdae4e29..41ee3af634 100644 --- a/tools/libxc/xc_dom_compat_linux.c +++ b/tools/libxc/xc_dom_compat_linux.c @@ -28,7 +28,8 @@ static int xc_linux_build_internal(struct xc_dom_image *dom, unsigned int store_evtchn, unsigned long *store_mfn, unsigned int console_evtchn, - unsigned long *console_mfn) + unsigned long *console_mfn, + int superpages) { int rc; @@ -42,7 +43,7 @@ static int xc_linux_build_internal(struct xc_dom_image *dom, goto out; if ( (rc = xc_dom_mem_init(dom, mem_mb)) != 0 ) goto out; - if ( (rc = xc_dom_boot_mem_init(dom)) != 0 ) + if ( (rc = xc_dom_boot_mem_init(dom, superpages)) != 0 ) goto out; if ( (rc = xc_dom_build_image(dom)) != 0 ) goto out; @@ -67,7 +68,8 @@ int xc_linux_build_mem(int xc_handle, uint32_t domid, unsigned long flags, unsigned int store_evtchn, unsigned long *store_mfn, - unsigned int console_evtchn, unsigned long *console_mfn) + unsigned int console_evtchn, unsigned long *console_mfn, + int superpages) { struct xc_dom_image *dom; int rc; @@ -82,7 +84,7 @@ int xc_linux_build_mem(int xc_handle, uint32_t domid, rc = xc_linux_build_internal(dom, xc_handle, domid, mem_mb, flags, store_evtchn, store_mfn, - console_evtchn, console_mfn); + console_evtchn, console_mfn, superpages); out: xc_dom_release(dom); @@ -98,7 +100,8 @@ int xc_linux_build(int xc_handle, uint32_t domid, unsigned long flags, unsigned int store_evtchn, unsigned long *store_mfn, - unsigned int console_evtchn, unsigned long *console_mfn) + unsigned int console_evtchn, unsigned long *console_mfn, + int superpages) { struct xc_dom_image *dom; int rc; @@ -114,7 +117,7 @@ int xc_linux_build(int xc_handle, uint32_t domid, rc = xc_linux_build_internal(dom, xc_handle, domid, mem_mb, flags, store_evtchn, store_mfn, - console_evtchn, console_mfn); + console_evtchn, console_mfn, superpages); out: xc_dom_release(dom); @@ -130,7 +133,8 @@ int xc_dom_linux_build(int xc_handle, unsigned long flags, unsigned int store_evtchn, unsigned long *store_mfn, - unsigned int console_evtchn, unsigned long *console_mfn) + unsigned int console_evtchn, unsigned long *console_mfn, + int superpages) { int rc; @@ -143,7 +147,7 @@ int xc_dom_linux_build(int xc_handle, return xc_linux_build_internal(dom, xc_handle, domid, mem_mb, flags, store_evtchn, store_mfn, - console_evtchn, console_mfn); + console_evtchn, console_mfn, superpages); } /* |