[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Grant tables from dom0 userspace?


  • To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
  • From: "Andrew Warfield" <andrew.warfield@xxxxxxxxxxxx>
  • Date: Thu, 9 Mar 2006 10:30:44 -0800
  • Cc: xen-devel Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jacob Gorm Hansen <jacobg@xxxxxxx>
  • Delivery-date: Thu, 09 Mar 2006 18:31:32 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eojdx8Wwf16/Vis5Jlw0L8t537et8OPOlFNuA1kCBL/ULg+raKsYnnOjI9whTPIjt/MlTECEYT0UsFcYMJtr3pfKJdEBH/j9snP7PylFYKlYszklsDgyaSUyJG78yHLZiFqDviy3x5vp2btz5mE28uyihL3s2+5viaVKk/8cu2s=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

> I think blktap gives an example how to do this, but it might be
> specific to aio right now. You could probably use some of the same
> hooks to provide a device file that you could mmap(), passing grant
> refs to map. I cc'ed Andy Warfield in case he has any ideas...

The blktap code in unstable is a bit out of date at the moment, but
should have sufficient examples to do what you want.  Because of AIO,
the code in there arranges for parallel user and kernel mappings, and
then annotates the vm area so that get_user_pages can find the
appropriate page_struct when AIO requests are decoded down into BIOs. 
If you just want to mmap some memory from another domain into user
through a char device, then you can trim a lot of that code out.

In linux/drivers/xen/blktap/blktap.c:

dispatch_rw_block_io() -- decodes a batch of block requests, and maps
the grants to kernel and user.  As I say, you should be able to leave
out all the kernel mappings and vm area updates.

blktap_read_ufe_ring() -- does the associated unmappings.

There's a bunch of code at the top to set up the device node and
manage the mmap area.

The code is a bit dated, but maybe it's helpful...

a.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.