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] passing hypercall parameters by pointer

To: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Subject: Re: [Xen-devel] passing hypercall parameters by pointer
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Thu, 18 Aug 2005 10:58:01 -0500
Cc: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>, Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 18 Aug 2005 15:56:22 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <571ACEFD467F7749BC50E0A98C17CDD807A09FAF@pdsmsx403>
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: <571ACEFD467F7749BC50E0A98C17CDD807A09FAF@pdsmsx403>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Aug 18, 2005, at 1:56 AM, Tian, Kevin wrote:

From: Hollis Blanchard
Sent: Thursday, August 18, 2005 6:05 AM
       case DOM0_GETMEMLIST:
op->u.getmemlist.buffer = virt_to_phys(op->u.getmemlist.buffer);
           break;

If following Ian's suggestion, you have to create a list of pfn here
instead of only converting start address. There's no guaranty that the
buffer is limited in one page. ;-)

Actually that was an explicitly stated limitation.

But I think I like this scatterlist idea. So for every pointer (buffer in the above example), instead the pseudo-physical address to a scatterlist will be passed to the hypervisor, and then copy_to/from_user expects a scatterlist address instead of a pointer. I think the copy_to/from_user and get/put_user API would need to change though: you'd need the value, the scatterlist pointer, and an offset into the scatterlist.

So x86 would need a slight API change, but could continue without dealing with any scatterlists, i.e. no ABI change.

The PowerPC kernel would need knowledge of every hypercall structure to create and translate the scatterlist. I know that's an idea Jimi isn't fond of, but it really seems like the best solution here.

--
Hollis Blanchard
IBM Linux Technology Center


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