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/xcutils | |
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/xcutils')
-rw-r--r-- | tools/xcutils/xc_restore.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c index 34fa26edd3..da4aa98b78 100644 --- a/tools/xcutils/xc_restore.c +++ b/tools/xcutils/xc_restore.c @@ -21,11 +21,12 @@ main(int argc, char **argv) unsigned int domid, store_evtchn, console_evtchn; unsigned int hvm, pae, apic; int xc_fd, io_fd, ret; + int superpages; unsigned long store_mfn, console_mfn; - if ( argc != 8 ) + if ( (argc != 8) && (argc != 9) ) errx(1, "usage: %s iofd domid store_evtchn " - "console_evtchn hvm pae apic", argv[0]); + "console_evtchn hvm pae apic [superpages]", argv[0]); xc_fd = xc_interface_open(); if ( xc_fd < 0 ) @@ -38,9 +39,13 @@ main(int argc, char **argv) hvm = atoi(argv[5]); pae = atoi(argv[6]); apic = atoi(argv[7]); + if ( argc == 9 ) + superpages = atoi(argv[8]); + else + superpages = 0; ret = xc_domain_restore(xc_fd, io_fd, domid, store_evtchn, &store_mfn, - console_evtchn, &console_mfn, hvm, pae); + console_evtchn, &console_mfn, hvm, pae, superpages); if ( ret == 0 ) { |