WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 0/2] Userspace grant communication

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 0/2] Userspace grant communication
From: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Date: Fri, 03 Dec 2010 10:36:17 -0500
Delivery-date: Fri, 03 Dec 2010 07:37:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: National Security Agency
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc13 Thunderbird/3.1.6
For fast communication between userspace applications in different domains,
it is useful to be able to set up a shared memory page. This can be used to
implement device driver frontends and backends completely in userspace, or
as a faster alternative to network communication. The current gntdev is
limited to PV domains, and does not allow grants to be created. The following
patches change gntdev to remapping existing pages, allowing the same code
to be used in PV and HVM, and add a gntalloc driver to allow mappings to be
created by userspace. These changes also make the mappings more application-
friendly: the mmap() calls can be made multiple times, persist across fork(),
and allow the device to be closed without invalidating the mapped areas. This
matches the behavior of mmap() on a normal file.

API changes from the existing /dev/xen/gntdev:

The unused "pad" field in ioctl_gntdev_map_grant_ref is now used for flags
on the mapping (currently used to specify if the mapping should be writable).
This provides sufficient information to perform the mapping when the ioctl is
called. To retain compatibility with current userspace, a new ioctl number is
used for this functionality and the legacy error on first mapping is retained
when the old ioctl is used.

IOCTL_GNTDEV_SET_MAX_GRANTS is not exposed in the Xen userspace libraries,
and is not very useful: it cannot be used to raise the limit of grants per
file descriptor, and is trivial to bypass by opening the device multiple
times. This version uses a global limit specified as a module parameter
(modifiable at runtime via sysfs).

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel