From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tzvika Chumash Subject: questions regarding grant tables Date: Tue, 26 Apr 2005 00:25:59 -0400 Message-ID: <00fb01c54a18$0c5fc280$6f00a8c0@amedma.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0198761802==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============0198761802== Content-type: multipart/alternative; boundary="Boundary_(ID_rgl/qh+aG97Ru1WAcQkqtQ)" This is a multi-part message in MIME format. --Boundary_(ID_rgl/qh+aG97Ru1WAcQkqtQ) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Hi, I was very happy to see that grant-tables were implemented and even had a nice text file to explain what to do.. however, being new to Xen, i'm missing a few key pieces of information to make it work: it says that to make it work on the domA side, you have to do the following: domA: #include grant_ref_t gref[BATCH_SIZE]; for ( i = 0; i < BATCH_SIZE; i++ ) 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? 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? also, if this page was previously allocated by kmalloc() is that address considered virtual or physical? what do i need to do to get the mfn from the pointer? 3) to transfer gref to domB, would you use event_channel_op() ? if so, how? if anyone knows these answers, please point me at some implementation example.. 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.. Thanks, Tzvika. --Boundary_(ID_rgl/qh+aG97Ru1WAcQkqtQ) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
Hi,
 
I was very happy to see that grant-tables were implemented and even had a nice text file to explain what to do.. however, being new to Xen, i'm missing a few key pieces of information to make it work:
 
it says that to make it work on the domA side, you have to do the following:
 
domA:  #include <asm-xen/gnttab.h>
        grant_ref_t gref[BATCH_SIZE];
 
        for ( i = 0; i < BATCH_SIZE; i++ )
            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?
 
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? also, if this page was previously allocated by kmalloc() is that address considered virtual or physical? what do i need to do to get the mfn from the pointer?
 
3) to transfer gref to domB, would you use event_channel_op() ? if so, how?
 
if anyone knows these answers, please point me at some implementation example.. 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..
 
Thanks,
 
Tzvika.
--Boundary_(ID_rgl/qh+aG97Ru1WAcQkqtQ)-- --===============0198761802== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0198761802==--