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/
Home Products Support Community News


[Xen-devel] One question to compat model

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: [Xen-devel] One question to compat model
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Wed, 12 May 2010 15:38:25 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 12 May 2010 00:39:54 -0700
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcrxphrbiPR+CzjzTh+vHiorl+asFA==
Thread-topic: One question to compat model
Hi, Jan, I have a question for compat model when I try to do some changes to 
MCA side.

Followed is part of my patch, I try to add a structure xen_mc_inject_v2 to 
xen_mc, with xenctl_cpumap embeded in the xen_mc_inject_v2.

However, in the "include/compat/arch-x86/xen-mca.h", the xenctl_cpumap is 
translated to be compat_ctl_cpumap, this is sure not I wanted.

After checking the related code, I find it should be caused by the [ 
r"(struct|union|enum)\s+(xen_?)?(\w)", r"\1 compat_\3" ] in 
tools/compat-build-header.py, which will replace all "struct xen" with "struct 
compat". Add the xenctl_cpumap to xlat.lst raise other warnings.

I can't find a solution on how to make sure the xenctl_cpumap will not be 
changed, can you please give me some information on it?

BTW, are there any guideline on how should we define the interface structure 
and handle them for compat model? For example, seems 
arch/x86/x86_64/platform_hypercall.c and arch/x86/cpu/mcheck/mce.c has 
different method to handle the compat model.


----The result in compat/arch-x86/xen-mca.h

struct compat_mc_inject_v2 {
    uint32_t flags;
    struct compat_ctl_cpumap cpumap;  >>> the xenctl_cpumap is translated :(

----Part of my patches:
diff -r ae1913320f05 xen/include/public/arch-x86/xen-mca.h
--- a/xen/include/public/arch-x86/xen-mca.h Wed May 12 11:12:28 2010 +0800
+++ b/xen/include/public/arch-x86/xen-mca.h Wed May 12 11:14:59 2010 +0800
@@ -404,6 +404,18 @@ struct xen_mc_mceinject {
    unsigned int mceinj_cpunr;      /* target processor id */

+#define XEN_MC_inject_v2        6
+#define XEN_MC_INJECT_TYPE_MASK     0x7
+#define XEN_MC_INJECT_TYPE_MCE      0x0
+#define XEN_MC_INJECT_TYPE_CMCI     0x1
+struct xen_mc_inject_v2 {
+    uint32_t flags;
+    struct xenctl_cpumap cpumap;
 struct xen_mc {
     uint32_t cmd;
     uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */
@@ -413,6 +425,8 @@ struct xen_mc {
         struct xen_mc_physcpuinfo  mc_physcpuinfo;
         struct xen_mc_msrinject    mc_msrinject;
         struct xen_mc_mceinject    mc_mceinject;
+        struct xen_mc_inject_v2    mc_inject_v2;
+        uint8_t pad[144];
     } u;
 typedef struct xen_mc xen_mc_t;

diff -r ae1913320f05 xen/include/xlat.lst
--- a/xen/include/xlat.lst  Wed May 12 11:12:28 2010 +0800
+++ b/xen/include/xlat.lst  Wed May 12 15:15:31 2010 +0800
@@ -23,6 +23,7 @@
 ?  mc_info             arch-x86/xen-mca.h
 ?  mc_mceinject            arch-x86/xen-mca.h
 ?  mc_msrinject            arch-x86/xen-mca.h
+?   mc_inject_v2           arch-x86/xen-mca.h
 ?  mc_notifydomain         arch-x86/xen-mca.h
 !  mc_physcpuinfo          arch-x86/xen-mca.h
 ?  page_offline_action     arch-x86/xen-mca.h

Xen-devel mailing list