Skip to contentSkip to conversation

32/64-bit hypercall interface

DISCUSSION Hollis Blanchard 3 participants 4 messages Sep 28, 2005 – Sep 29, 2005

lore
Share & tools
lore
#0 lore raw

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.

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#1 lore raw
Quoted 10 lines · Hollis Blanchard

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.

We want the args to be 'machine-register sized' which is why they are longs. Why use 32-bit tools on 64-bit hypervisor?

-- Keir

#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"KF" == Keir Fraser <[email protected]> writes:

KF> On 28 Sep 2005, at 22:36, Hollis Blanchard wrote:

KF> We want the args to be 'machine-register sized' which is why they KF> are longs.

hmm, It appears that 32bits is sufficient, esp since almost everything is expressed in terms of pages (takes us to 16TB). However, we should be forward thinking :).

Anyway, since this is a Xen/Kernel header, perhpas we can create a type that represent the Xen/Kernel machine-register size?

KF> Why use 32-bit tools on 64-bit hypervisor?

Unlike x86_64 and ia64, there is no performance gain by making regular apps 64bit on PPC, so we tend to have almost all our apps be the same 32 bit apps that run on 32 bit kernels. This way, when Xen-PPC32 is ready the same xentools binary will apply.

Besides, most systems don't have a 64bit python or libz installed or readily available.

BTW: Is the plan to not support 32bit domain (0 or U) on a 64bit Xen?

-JX

Signature · 2 lines
 "I got an idea, an idea so smart my head would explode if I even
  began to know what I was talking about." -- Peter Griffin (Family Guy)
#3 lore raw
Quoted 1 line · Jimi Xenidis

BTW: Is the plan to not support 32bit domain (0 or U) on a 64bit Xen?

That's the case for paravirtualised x86 guests.

-- Keir