[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Structure packing when using hypercall.


  • To: Roger Cruz <rcruz@xxxxxxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcgU3OwgSW1bFsSFSXeroa5uYW2mJQAAjHKAAAC/JssABLvZEAAA9mE8
  • Thread-topic: [Xen-devel] Structure packing when using hypercall.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.