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

Re: [Xen-devel] confusion over vcpumask in mmuext_op

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] confusion over vcpumask in mmuext_op
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Thu, 4 Jan 2007 02:41:47 +0000
Cc: John Levon <levon@xxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 03 Jan 2007 18:39:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070104014332.GA18844@xxxxxxxxxxxxxxxxxxxxxxx>
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>
References: <20070104014332.GA18844@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.5
> 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


-- 
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!

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