Skip to contentSkip to conversation

confusion over vcpumask in mmuext_op

DISCUSSION John Levon 3 participants 5 messages Jan 4, 2007

lore
Share & tools
lore

John Levon

author
#0 lore raw

vcpumask is now a guest handle, but it seems the Linux code still sets it directly instead of using set_xen_guest_handle(). What am I missing?

regards
john

#1 lore raw
Quoted 2 lines

vcpumask is now a guest handle, but it seems the Linux code still sets it directly instead of using set_xen_guest_handle(). What am I missing?

It's a result of some version-fu in the interface:

Linux's drivers/xen/Kconfig defines:
if XEN
config XEN_INTERFACE_VERSION

	hex
	default 0x00030203

xen.h defines:

struct mmuext_op {
    unsigned int cmd;
    union {
        /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
        xen_pfn_t     mfn;
        /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
        unsigned long linear_addr;
    } arg1;
    union {
        /* SET_LDT */
        unsigned int nr_ents;
        /* TLB_FLUSH_MULTI, INVLPG_MULTI */
        XEN_GUEST_HANDLE_00030205(void) vcpumask; /* MW:note the macro name */
    } arg2;
};

typedef struct
And xen-compat.h defines:
/* Fields defined as a Xen guest handle since 0x00030205. */ #if __XEN_INTERFACE_VERSION__ >= 0x00030205
#define XEN_GUEST_HANDLE_00030205(type) XEN_GUEST_HANDLE(type) #else
#define XEN_GUEST_HANDLE_00030205(type) type * #endif

So actually the field vcpumask is currently being compiled as a void *.

Cheers,
Mark

Signature · 4 lines
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
#2 lore raw
Quoted 1 line · Mark Williamson

So actually the field vcpumask is currently being compiled as a void *.

And we get away with this because, on x86, there is no ABI difference between a guest handle and a plain pointer. This was done just as an interface cleanup, and because I think it makes Jan's 32-on-64 work easier.

-- Keir

author
#3 lore raw
In reply to Mark Williamson
Quoted 5 lines · Mark Williamson

Linux's drivers/xen/Kconfig defines:
if XEN
config XEN_INTERFACE_VERSION

	hex
	default 0x00030203

Ah thanks. I must admit to being a bit confused though. If xen-unstable's sparse tree isn't using the latest interface, what is? Just us ? :)

john

#4 lore raw
Quoted 11 lines · John Levon
Quoted 5 lines · Mark Williamson

Linux's drivers/xen/Kconfig defines:
if XEN
config XEN_INTERFACE_VERSION
hex
default 0x00030203

Ah thanks. I must admit to being a bit confused though. If xen-unstable's sparse tree isn't using the latest interface, what is? Just us ? :)

The tools and Xen itself use the latest version, and minios too I think. We haven't got round to moving Linux off of dom0_ops, hence the interface version hasn't yet been bumped there.

-- Keir