linux/include/xen
Andres Lagar-Cavilla c571898ffc xen/gndev: Xen backend support for paged out grant targets V4.
Since Xen-4.2, hvm domains may have portions of their memory paged out. When a
foreign domain (such as dom0) attempts to map these frames, the map will
initially fail. The hypervisor returns a suitable errno, and kicks an
asynchronous page-in operation carried out by a helper. The foreign domain is
expected to retry the mapping operation until it eventually succeeds. The
foreign domain is not put to sleep because itself could be the one running the
pager assist (typical scenario for dom0).

This patch adds support for this mechanism for backend drivers using grant
mapping and copying operations. Specifically, this covers the blkback and
gntdev drivers (which map foreign grants), and the netback driver (which copies
foreign grants).

* Add a retry method for grants that fail with GNTST_eagain (i.e. because the
  target foreign frame is paged out).
* Insert hooks with appropriate wrappers in the aforementioned drivers.

The retry loop is only invoked if the grant operation status is GNTST_eagain.
It guarantees to leave a new status code different from GNTST_eagain. Any other
status code results in identical code execution as before.

The retry loop performs 256 attempts with increasing time intervals through a
32 second period. It uses msleep to yield while waiting for the next retry.

V2 after feedback from David Vrabel:
* Explicit MAX_DELAY instead of wrap-around delay into zero
* Abstract GNTST_eagain check into core grant table code for netback module.

V3 after feedback from Ian Campbell:
* Add placeholder in array of grant table error descriptions for unrelated
  error code we jump over.
* Eliminate single map and retry macro in favor of a generic batch flavor.
* Some renaming.
* Bury most implementation in grant_table.c, cleaner interface.

V4 rebased on top of sync of Xen grant table interface headers.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[v5: Fixed whitespace issues]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-09-21 09:23:51 -04:00
..
interface xen: resynchronise grant table status codes with upstream 2012-09-14 09:12:05 -04:00
acpi.h xen/acpi/sleep: Enable ACPI sleep via the __acpi_os_prepare_sleep 2012-05-07 15:33:18 -04:00
balloon.h xen-balloon: convert sysdev_class to a regular subsystem 2011-12-14 15:32:50 -08:00
events.h Revert "xen PVonHVM: move shared_info to MMIO before kexec" 2012-08-16 13:05:25 -04:00
evtchn.h xen: add /dev/xen/evtchn driver 2009-03-30 09:26:49 -07:00
features.h xen: Core Xen implementation 2007-07-18 08:47:42 -07:00
gntalloc.h xen/gntalloc,gntdev: Add unmap notify ioctl 2011-02-14 14:16:17 -05:00
gntdev.h xen/gntalloc,gntdev: Add unmap notify ioctl 2011-02-14 14:16:17 -05:00
grant_table.h xen/gndev: Xen backend support for paged out grant targets V4. 2012-09-21 09:23:51 -04:00
hvc-console.h treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
hvm.h x86/xen: event channels delivery on HVM. 2010-07-22 16:45:59 -07:00
Kbuild xen: add privcmd driver 2010-10-20 16:22:29 -07:00
page.h xen: allow balloon driver to use more than one memory region 2011-09-29 11:12:10 -04:00
platform_pci.h xen: Remove hanging references to CONFIG_XEN_PLATFORM_PCI 2011-11-16 12:13:42 -05:00
privcmd.h xen/privcmd: add PRIVCMD_MMAPBATCH_V2 ioctl 2012-09-05 16:36:26 -04:00
swiotlb-xen.h xen/swiotlb: Remove functions not needed anymore. 2012-08-23 10:18:56 -04:00
tmem.h xen/tmem: cleanup 2012-03-20 15:34:18 -04:00
xen-ops.h Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
xen.h xen: move Xen-testing predicates to common header 2009-11-04 08:47:24 -08:00
xenbus_dev.h xenbus: Add support for xenbus backend in stub domain 2012-05-21 09:53:18 -04:00
xenbus.h include/ and checkpatch: prefer __scanf to __attribute__((format(scanf,...) 2012-03-23 16:58:36 -07:00
xencomm.h xen: import arch generic part of xencomm 2008-04-24 23:57:32 +02:00