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

[Xen-devel] Structure packing when using hypercall.

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Structure packing when using hypercall.
From: "Roger Cruz" <rcruz@xxxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Oct 2007 15:14:52 -0400
Delivery-date: Mon, 22 Oct 2007 12:15:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <Pine.GSO.4.40.0710221337480.13660-100000@xxxxxxxxxxxxxxxxxxxxx>
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: AcgU3OwgSW1bFsSFSXeroa5uYW2mJQAAjHKA
Thread-topic: Structure packing when using hypercall.
I'm wondering how you resolve the issue of structure packing when an
application that calls hypervisor functions (say, the grant table map
reference hypercall that uses struct grant_entry) is compiled with a
32-bit compiler and the hypervisor is compiled with a 64-bit version.
There is a discrepancy in the sizes and alignment of the fields within
the structure, depending on which compiler is being used.

So, my problem arises that I have a 64-bit compiler and a 32-bit HVM
guest making a hypercall using the public H header files.  Is there some
packing being done in other files or at compile time that I'm not
seeing?


struct grant_entry {
    /* GTF_xxx: various type and flag information.  [XEN,GST] */
    uint16_t flags;
    /* The domain being granted foreign privileges. [GST] */
    domid_t  domid;
    /*
     * GTF_permit_access: Frame that @domid is allowed to map and
access. [GST]
     * GTF_accept_transfer: Frame whose ownership transferred by @domid.
[XEN]
     */
    uint32_t frame;
};
typedef struct grant_entry grant_entry_t;

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