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

Re: [Xen-devel] questions regarding grant tables

To: Tzvika Chumash <tzvika@xxxxxxxxxxx>
Subject: Re: [Xen-devel] questions regarding grant tables
From: Christopher Clark <christopher.w.clark@xxxxxxxxx>
Date: Tue, 26 Apr 2005 14:04:19 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 26 Apr 2005 21:04:10 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RUtgJgZ91KsSG8EM+WEA7s0xsoY3H1pX5+qX1pd5yEgqXJZGOidbUEOfVjpbXY3GcepSC6AGa/kcTHNP4bGen2Eagx3BFzMTDeicxZuEgS4AZq9K7dhymyt9jN0wqTUNeOtByLzIkrHcds4a1VADOuxZ8WT6aVFr6EImFfabr4Q=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <00fb01c54a18$0c5fc280$6f00a8c0@xxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <00fb01c54a18$0c5fc280$6f00a8c0@xxxxxxxxxx>
Reply-to: cwc22@xxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On 4/25/05, Tzvika Chumash <tzvika@xxxxxxxxxxx> wrote:
>   
>  gref[i] = gnttab_grant_foreign_access( domBid, mfn, (readonly ? 1 : 0) );
>  
> 1) how do you get domBid ? (i'm assuming it's the same ID that appears in
> the "xm list"), is there some API that can retrieve it? 

Your ID assumption is correct.

How do you identify the domain you wish to share with? Do you know the
name it has been given? Or an IP address it is using?
I suspect you're looking for a name service and there isn't one at the moment.

xend performs domain id exchange for connecting device driver domains
to their connecting guests. The dom0 op DOM0_GETDOMAININFO might be
useful to you for name<->id conversion, but you'll need to establish a
communication channel to some process in dom0 to do that lookup for
you (I think). hooking a daemon into xcs would be my suggestion.

> 2) mfn -- i've seen people post stuff about virt_to_machine(), but I could
> not get it to work.. are there any special include files or compiler
> directives that one needs to add to be able to work with that?

No.

> also, if this page was previously allocated by kmalloc() is that address
> considered virtual or physical?

virtual, otherwise you couldn't immediately use that pointer.

> what do i need to do to get the mfn from the pointer? 

Don't use kmalloc. __get_free_page is more useful.

eg.
p = __get_free_page(GFP_KERNEL);
machine_address = virt_to_machine(p);
mfn = machine_address >> PAGE_SHIFT;

> 3) to transfer gref to domB, would you use event_channel_op() ? if so, how? 

No. Events are for notifications only; they aren't useful for sending
data. It's used to notify the other domain that you've written
something into the shared frame.

You need an already existing communication channel to domB to send the
reference on.
eg. a tcp connection
Once you have established a single shared page, you can then use that
to transmit grant references. See ring.h for useful macros for using a
shared page between domains.

> if anyone knows these answers, please point me at some implementation
> example..

grep grant linux-2.6.11-xen-sparse/drivers/xen/blkfront/*.c
linux-2.6.11-xen-sparse/drivers/xen/blkback/*.c

> i wish there were some compilable skeleton examples of using the
> various xen mechanisms......
> the documentation seems to contain only an
> index of the available features, without detailed manual-style explanation
> of the various include files,parameters,return values, bugs, etc.. 

...

Christopher

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

<Prev in Thread] Current Thread [Next in Thread>