From: Hollis Blanchard Subject: 32/64-bit hypercall interface Date: Wed, 28 Sep 2005 16:36:23 -0500 Message-ID: <200509281636.23324.hollisb@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Jimi Xenidis List-Id: xen-devel@lists.xenproject.org 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