Warning:

The xenpaging code is new and not fully debugged.
Usage of xenpaging can crash Xen or cause severe data corruption in the
guest memory and its filesystems!

Description:

xenpaging writes memory pages of a given guest to a file and moves the
pages back to the pool of available memory.  Once the guests wants to
access the paged-out memory, the page is read from disk and placed into
memory.  This allows the sum of all running guests to use more memory
than physically available on the host.

Requirements:

xenpaging relies on Intel EPT or AMD RVI, other hardware is not
supported. Only HVM guests are supported.  The dom0 kernel needs
paging-aware backend drivers to handle paged granttable entries.
Currently only dom0 kernels based on classic Xen Linux support this
functionality.

Usage:

Up to now xenpaging is only integrated into xm/xend.

To enable xenpaging for a guest add the option 'actmem=' to the guests
config file and run 'xm new <vm_config_file>' to make the changes
active. actmem= takes the amount of memory in MB which a guest is
allowed to use at a given time. Everything above this limit will be
paged out. This paging is transparent to the guest.

Example:
 memory=4096
 actmem=1024
In this example a guest gets the impression it has 4GB of memory and
the guest OS has to configure itself for this amount of memory. But
xenpaging will page-out 3072MB, leaving only 1024MB active at a time.

At runtime the configured value of actmem= can be changed with the "xm
mem-swap-target" command.
 xm mem-swap-target <domain_name> 512

Additional cmdline options for the xenpaging binary can be specified
with the xenpaging_extra= config file option:

 xenpaging_extra=[ '-f', '/dev/shm/pagefile-guest_name', '-v' ]

To get a list of available options, run /usr/lib/xen/bin/xenpaging -h:

  xenpaging [options] -f <pagefile> -d <domain_id>

options:
 -d <domid>     --domain=<domid>         numerical domain_id of guest. This option is required.
 -f <file>      --pagefile=<file>        pagefile to use. This option is required.
 -m <max_memkb> --max_memkb=<max_memkb>  maximum amount of memory to handle.
 -r <num>       --mru_size=<num>         number of paged-in pages to keep in memory.
 -v             --verbose                enable debug output.
 -h             --help                   this output.

Todo:
- integrate xenpaging into libxl

# vim: tw=72
