From: Mark Williamson Subject: Re: Grant tables Date: Sat, 5 Apr 2008 22:14:01 +0100 Message-ID: <200804052214.02300.mark.williamson@cl.cam.ac.uk> References: <47F648A6.3000104@tiscali.it> <20080404214240.GE4014@implementation> <47F73411.6010705@tiscali.it> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <47F73411.6010705@tiscali.it> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Carlo Bertoldi List-Id: xen-devel@lists.xenproject.org > >> it's fine, except that I don't understand how to obtain the gref. > > IOW how can I build a grant reference from a domain? The idea is that the domain you're mapping memory from will create a grant reference, then (somehow) tell your mapping code what that reference is. For the split front/back drivers, the frontend picks a page to be used for the communications ring, grants it to the backend domain, and puts the grant reference into XenStore so the backend can map that page. During IO, grant references can then be passed through the shared memory ring already established, which is more efficient. This is how most of the driver code does things under Xen. > > To my knowledge, there is no user interface for that yet, you need to do > > it from the Linux kernel. > > I agree, can you provide some examples about that? Take a look in the Xen Linux tree at the drivers/xen/blkfront/ for some creation of grant references. As Samuel says, searching for grant table functions under drivers/xen/ is going to find you some interesting examples in various places. hope that helps, Cheers, Mark -- Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)