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] Question on xc_gnttab_map_grant_ref()

To: "King, Steven R" <steven.r.king@xxxxxxxxx>
Subject: Re: [Xen-devel] Question on xc_gnttab_map_grant_ref()
From: Christopher Clark <christopher.clark@xxxxxxxxxxxx>
Date: Thu, 3 Nov 2005 22:59:43 +0000
Cc: NAHieu <nahieu@xxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 03 Nov 2005 22:59:58 +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:references; b=nEIIAzhBs8kxS/NzMgEeMLF18+KjW2rMDleT90PmqmKqNFVDHZdtv9FCO8EPCCGKLyOJl/WMagVdHMjwTq/tV7TEgXr29NmTDGHMjQtH4m3Zu3nrKDtUG3/1trxq3S3/4jTGIeGU1VNq4G5PiR8ch1XYMIq3rWDEaFaz0Ul/axw=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <44BDAFB888F59F408FAE3CC35AB470410249FA20@orsmsx409>
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: <44BDAFB888F59F408FAE3CC35AB470410249FA20@orsmsx409>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

The implementation is indeed incomplete and I agree that grant references are not the correct interface for the kernel to expose to user space. MarkW's mmap work-in-progress ought be far more suitable.

The main use of xc_gnttab stuff has been for debugging new clients using the grant tables -- it's been handy to modify and read them from userspace to figure out what's going on, but clearly this isn't something you'd want in a production kernel, which is why it's disabled.

Christopher


On 11/3/05, King, Steven R <steven.r.king@xxxxxxxxx> wrote:
I've been looking at xc_gnttab stuff lately too and the current
implementation is incomplete.  For example, I don't see a way to acquire
a grant reference from user space, so the xc_gnttab functions taking a
reference are unusable.

IMO, grant references are kernel level implementation details that
should not be exposed to user-mode anyway.  Instead, user-mode needs
IOCTLs to share pages with a remote domain and to map those shared pages
within the remote end.  If the kernel implements this functionality with
grant tables, then great; in the future it may do something else.  I
hope to have a patch to offer for this eventually.

-steve


-----Original Message-----
From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx ] On Behalf Of NAHieu
Sent: Thursday, November 03, 2005 4:53 AM
To: xen-devel
Subject: [Xen-devel] Question on xc_gnttab_map_grant_ref()

Hi,

I am writing a kermel module in DomU, and this module grants a page of
memory to Dom0. Then in Dom0 I try to grant_map it with
xc_gnttab_map_grant_ref()

But this function requires a flag, and I don't know which option to give
it. I tried with either GNTMAP_application_map or
GTF_reading|GTF_writing, but I always got this error:

ERROR: do_gnttab_op: HYPERVISOR_grant_table_op failed: -1

Anybody please tell me how to use xc_gnttab_map_grant_ref() properly in
Dom0's userspace?


Many thanks.
Hieu

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

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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>