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] Structure packing when using hypercall.

To: Roger Cruz <rcruz@xxxxxxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Structure packing when using hypercall.
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Mon, 22 Oct 2007 23:14:18 +0100
Delivery-date: Mon, 22 Oct 2007 15:09:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <40B551BEDC7945419A5897958AB3947C1C9FF8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcgU3OwgSW1bFsSFSXeroa5uYW2mJQAAjHKAAAC/JssABLvZEAAA9mE8
Thread-topic: [Xen-devel] Structure packing when using hypercall.
User-agent: Microsoft-Entourage/11.3.6.070618
On 22/10/07 22:55, "Roger Cruz" <rcruz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> Thanks Keir, but I didn't see anything in that file dealing specifically
> with packing issues. Did I miss it?

There's only one example right now: do_memory_op_compat32(). The only valid
grant table operation currently is GNTTABOP_query_size, which does not need
32-to-64 conversion. Other grant-table operations will need treatment
similar to memory_op().

> What I was looking for was public hypercall header files that would work
> no matter what OS/compiler the guest application and the hypersor were
> built with.  There doesn't appear to be any #pragma pack around the
> grant_table.h header files that would force fields to some specific
> alignment.

Yes, we used to have gcc-specific packing attributes, but that got
complaints from those who don't use gcc to build their OS. So we ended up
with vanilla header files and the hypervisor ABI is defined by those header
files interpreted according to the Linux/x86 C ABI rules. If you need
different then you have to hand tweak. It'd be great to script generation of
appropriate header files -- we could put the source header files in a more
formal format to aid that -- but I don't think anyone is immediately likely
to step forward to do that. It could also allow us to clean up the
hand-crafted 32-on-64 compat goop (there's not much of it for HVM guests as
yet, but there's quite a lot for 32-on-64 PV!) by auto-generating some more
of that too.

At least you only have to hand-tweak once -- the hypervisor interfaces
aren't changing and you probably only use a small subset of the hypercalls.

 -- Keir



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