[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.0-testing] x86/kexec: fix very old regression and make compatible with modern Linux



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1287923205 -3600
# Node ID a260152da5d00866ef14f465ad439bcdc803e6cc
# Parent  aabda497d83f7c289d58c77c321c77bf1f432930
x86/kexec: fix very old regression and make compatible with modern Linux

c/s 13829 lost the (32-bit only) cpu_has_pae argument passed to the
primary kernel's stub (in the 32-bit Xen case only), and Linux
2.6.27/.30 (32-/64-bit) introduced a new argument (for KEXEC_JUMP)
which for now simply gets passed a hardcoded value.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
xen-unstable changeset:   22280:d6e3cd10a9a6
xen-unstable date:        Sun Oct 24 13:15:06 2010 +0100
---
 xen/arch/x86/machine_kexec.c       |   12 ++++++++++--
 xen/arch/x86/x86_64/compat_kexec.S |    1 +
 xen/include/asm-x86/cpufeature.h   |    2 --
 3 files changed, 11 insertions(+), 4 deletions(-)

diff -r aabda497d83f -r a260152da5d0 xen/arch/x86/machine_kexec.c
--- a/xen/arch/x86/machine_kexec.c      Sun Oct 24 13:26:17 2010 +0100
+++ b/xen/arch/x86/machine_kexec.c      Sun Oct 24 13:26:45 2010 +0100
@@ -23,7 +23,11 @@ typedef void (*relocate_new_kernel_t)(
 typedef void (*relocate_new_kernel_t)(
                 unsigned long indirection_page,
                 unsigned long *page_list,
-                unsigned long start_address);
+                unsigned long start_address,
+#ifdef __i386__
+                unsigned int cpu_has_pae,
+#endif
+                unsigned int preserve_context);
 
 extern int machine_kexec_get_xen(xen_kexec_range_t *range);
 
@@ -121,7 +125,11 @@ void machine_kexec(xen_kexec_image_t *im
 
         rnk = (relocate_new_kernel_t) image->page_list[1];
         (*rnk)(image->indirection_page, image->page_list,
-               image->start_address);
+               image->start_address,
+#ifdef __i386__
+               1 /* cpu_has_pae */,
+#endif
+               0 /* preserve_context */);
     }
 }
 
diff -r aabda497d83f -r a260152da5d0 xen/arch/x86/x86_64/compat_kexec.S
--- a/xen/arch/x86/x86_64/compat_kexec.S        Sun Oct 24 13:26:17 2010 +0100
+++ b/xen/arch/x86/x86_64/compat_kexec.S        Sun Oct 24 13:26:45 2010 +0100
@@ -119,6 +119,7 @@ compatibility_mode:
         movl %eax, %ss
 
         /* Push arguments onto stack. */
+        pushl $0   /* 20(%esp) - preserve context */
         pushl $1   /* 16(%esp) - cpu has pae */
         pushl %ecx /* 12(%esp) - start address */
         pushl %edx /*  8(%esp) - page list */
diff -r aabda497d83f -r a260152da5d0 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h  Sun Oct 24 13:26:17 2010 +0100
+++ b/xen/include/asm-x86/cpufeature.h  Sun Oct 24 13:26:45 2010 +0100
@@ -138,7 +138,6 @@
 #define cpu_has_de             boot_cpu_has(X86_FEATURE_DE)
 #define cpu_has_pse            boot_cpu_has(X86_FEATURE_PSE)
 #define cpu_has_tsc            boot_cpu_has(X86_FEATURE_TSC)
-#define cpu_has_pae            boot_cpu_has(X86_FEATURE_PAE)
 #define cpu_has_pge            boot_cpu_has(X86_FEATURE_PGE)
 #define cpu_has_pat            boot_cpu_has(X86_FEATURE_PAT)
 #define cpu_has_apic           boot_cpu_has(X86_FEATURE_APIC)
@@ -164,7 +163,6 @@
 #define cpu_has_de             1
 #define cpu_has_pse            1
 #define cpu_has_tsc            1
-#define cpu_has_pae            1
 #define cpu_has_pge            1
 #define cpu_has_pat            1
 #define cpu_has_apic           boot_cpu_has(X86_FEATURE_APIC)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.