xen-devel
[Xen-devel] 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.
--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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] One question to compat model,
Jiang, Yunhong <=
|
|
|