From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 5/6] xen-gntalloc: Userspace grant allocation driver Date: Thu, 27 Jan 2011 14:23:11 -0500 Message-ID: <20110127192311.GE27853@dumpdata.com> References: <1295625548-22069-1-git-send-email-dgdegra@tycho.nsa.gov> <1295625548-22069-6-git-send-email-dgdegra@tycho.nsa.gov> <20110127185210.GA27853@dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20110127185210.GA27853@dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Daniel De Graaf Cc: jeremy@goop.org, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, Jan 27, 2011 at 01:52:10PM -0500, Konrad Rzeszutek Wilk wrote: > On Fri, Jan 21, 2011 at 10:59:07AM -0500, Daniel De Graaf wrote: > > This allows a userspace application to allocate a shared page for > > implementing inter-domain communication or device drivers. These > > shared pages can be mapped using the gntdev device or by the kernel > > in another domain. > > > > Signed-off-by: Daniel De Graaf > > --- > > drivers/xen/Kconfig | 8 + > > drivers/xen/Makefile | 2 + > > drivers/xen/gntalloc.c | 477 ++++++++++++++++++++++++++++++++++++++++++++++++ > > include/xen/gntalloc.h | 70 +++++++ > > 4 files changed, 557 insertions(+), 0 deletions(-) > > create mode 100644 drivers/xen/gntalloc.c > > create mode 100644 include/xen/gntalloc.h > > > > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig > > index 07bec09..a3d7afb 100644 > > --- a/drivers/xen/Kconfig > > +++ b/drivers/xen/Kconfig > > @@ -80,6 +80,14 @@ config XEN_GNTDEV > > help > > Allows userspace processes to use grants. > > > > +config XEN_GRANT_DEV_ALLOC > > + tristate "User-space grant reference allocator driver" > > + depends on XEN > > + help > > + Allows userspace processes to create pages with access granted > > + to other domains. This can be used to implement frontend drivers > > + or as part of an inter-domain shared memory channel. > > + > > config XEN_PLATFORM_PCI > > tristate "xen platform pci device driver" > > depends on XEN_PVHVM && PCI > > diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile > > index 5088cc2..9585a1d 100644 > > --- a/drivers/xen/Makefile > > +++ b/drivers/xen/Makefile > > @@ -10,6 +10,7 @@ obj-$(CONFIG_XEN_XENCOMM) += xencomm.o > > obj-$(CONFIG_XEN_BALLOON) += balloon.o > > obj-$(CONFIG_XEN_DEV_EVTCHN) += xen-evtchn.o > > obj-$(CONFIG_XEN_GNTDEV) += xen-gntdev.o > > +obj-$(CONFIG_XEN_GRANT_DEV_ALLOC) += xen-gntalloc.o > > obj-$(CONFIG_XENFS) += xenfs/ > > obj-$(CONFIG_XEN_SYS_HYPERVISOR) += sys-hypervisor.o > > obj-$(CONFIG_XEN_PLATFORM_PCI) += xen-platform-pci.o > > @@ -18,5 +19,6 @@ obj-$(CONFIG_XEN_DOM0) += pci.o > > > > xen-evtchn-y := evtchn.o > > xen-gntdev-y := gntdev.o > > +xen-gntalloc-y := gntalloc.o > > > > xen-platform-pci-y := platform-pci.o > > diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c > > new file mode 100644 > > index 0000000..a230dc4 > > --- /dev/null > > +++ b/drivers/xen/gntalloc.c > > @@ -0,0 +1,477 @@ > > +/****************************************************************************** > > + * gntalloc.c > > + * > > + * Device for creating grant references (in user-space) that may be shared > > + * with other domains. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License > > + * along with this program; if not, write to the Free Software > > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > > + */ > > + > > +/* > > + * This driver exists to allow userspace programs in Linux to allocate kernel > > + * memory that will later be shared with another domain. Without this device, > > + * Linux userspace programs cannot create grant references. Why can't this be done in gntdev? Is there a simple test program for this?