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] 32/64-bit hypercall interface

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] 32/64-bit hypercall interface
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Wed, 28 Sep 2005 16:36:23 -0500
Cc: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Delivery-date: Wed, 28 Sep 2005 21:35:02 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Organization: IBM Linux Technology Center
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.8.2
I was looking at the definition of privcmd_hypercall:
typedef struct privcmd_hypercall
{
    unsigned long op;
    unsigned long arg[5];
} privcmd_hypercall_t;

For ppc64, we are using 32-bit management tools, so this is a problem: they 
will create structs where long is 32 bits, and the (64-bit) kernel and 
hypervisor will expect structs where long is 64 bits.

The standard (and awkward) way of dealing with the privcmd ioctl is to create 
an in-kernel privcmd_hypercall_t, copy the 32-bit values into it field by 
field, and then pass *that* struct on to privcmd_ioctl(). Of course, that's 
only for legacy interfaces; for all new interfaces, we can just design them 
properly so that their size and alignment doesn't change.

There are also longs in some of the dom0_op sub-structures. For example:
typedef struct {
    /* IN variables. */
    domid_t       domain;
    unsigned long max_memkb;
} dom0_setdomainmaxmem_t;

I suggest that all longs in these structures be converted to u32.

-- 
Hollis Blanchard
IBM Linux Technology Center

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