From: Avi Kivity <[email protected]>

Signed-off-by: Avi Kivity <[email protected]>

diff --git a/sync b/sync
index b12fb8a..b09c424 100755
--- a/sync
+++ b/sync
@@ -40,6 +40,7 @@ def __hack(data):
         'do_machine_check '
         )
     anon_inodes = anon_inodes_exit = False
+    mce = False
     result = []
     def sub(regexp, repl, str):
         return re_cache(regexp).sub(repl, str)
@@ -104,6 +105,11 @@ def __hack(data):
             line = 'IF_ANON_INODES_DOES_REFCOUNTS(' + line + ')'
         if not match(r'#include'):
             line = sub(r'\blapic\n', 'l_apic', line)
+        if match(r'struct pt_regs regs'):
+            mce = True
+        if mce and match(r'\.flags'):
+            line = sub(r'flags', r'kvm_pt_regs_flags', line)
+            mce = False
         w(line)
         if match(r'\tkvm_init_debug'):
             w('\thrtimer_kallsyms_resolve();')
diff --git a/x86/external-module-compat.h b/x86/external-module-compat.h
index 14eb931..881602e 100644
--- a/x86/external-module-compat.h
+++ b/x86/external-module-compat.h
@@ -577,3 +577,14 @@ static inline void kvm_do_machine_check(struct pt_regs 
*regs, long error_code)
 
 #endif
 
+/* pt_regs.flags was once pt_regs.eflags */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+
+#define kvm_pt_regs_flags eflags
+
+#else
+
+#define kvm_pt_regs_flags flags
+
+#endif
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to