Add gnttab IOCTLs that allow sharing already existing memory
IOCTL_XENIFACE_GNTTAB_PERMIT_FOREIGN_ACCESS shares pages that are
newly allocated by the driver. This commit adds new IOCTLs:
IOCTL_XENIFACE_GNTTAB_PERMIT_FOREIGN_ACCESS_V2,
IOCTL_XENIFACE_GNTTAB_REVOKE_FOREIGN_ACCESS_V2,
IOCTL_XENIFACE_GNTTAB_MAP_FOREIGN_PAGES_V2
and IOCTL_XENIFACE_GNTTAB_UNMAP_FOREIGN_PAGES_V2.
IOCTL_XENIFACE_GNTTAB_PERMIT_FOREIGN_ACCESS_V2 allows specifying
user-mode address of a memory region that will be shared
(the region is locked for the duration).
All _V2 IOCTLs use user-mode address of the shared region
as a unique (per-process) request identifier. This differs from
the existing IOCTLs that use client-supplied RequestId. _V2 IOCTLs
should be considered as preferable since they don't require
the client to manage IDs.
Signed-off-by: Rafał Wojdyła <omeg@invisiblethingslab.com>
Changed STATUS_INSUFFICIENT_VIRTUAL_ADDR_RESOURCES to
STATUS_INSUFFICIENT_RESOURCES to fix the build.