xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* One question to compat model
@ 2010-05-12  7:38 Jiang, Yunhong
  2010-05-12  8:00 ` Jan Beulich
  0 siblings, 1 reply; 12+ messages in thread
From: Jiang, Yunhong @ 2010-05-12  7:38 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel@lists.xensource.com

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.

--jyh

----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
+
+#define XEN_MC_INJECT_CPU_BROADCAST 0x8
+
+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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-05-13 10:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12  7:38 One question to compat model Jiang, Yunhong
2010-05-12  8:00 ` Jan Beulich
2010-05-12  8:15   ` Jiang, Yunhong
2010-05-12  8:31     ` Jan Beulich
2010-05-12  8:50       ` Jiang, Yunhong
2010-05-12  9:11         ` Jan Beulich
2010-05-12  9:14           ` Jiang, Yunhong
2010-05-12  9:13         ` Keir Fraser
2010-05-13  8:41           ` Jiang, Yunhong
2010-05-13  8:48             ` Keir Fraser
2010-05-13 10:00               ` Jiang, Yunhong
2010-05-13 10:04                 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).