rpms/kernel/F-10 linux-2.6.27.7-vmi-fix-crash-on-boot.patch, NONE, 1.1 kernel.spec, 1.1185, 1.1186

Chuck Ebbert cebbert at fedoraproject.org
Fri Dec 12 05:57:48 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26280

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6.27.7-vmi-fix-crash-on-boot.patch 
Log Message:
Fix VMI crash on boot introduced in 2.6.27.7 (#476062)

linux-2.6.27.7-vmi-fix-crash-on-boot.patch:

--- NEW FILE linux-2.6.27.7-vmi-fix-crash-on-boot.patch ---
VMI initialiation can relocate the fixmap, causing early_ioremap
to malfunction if it is initialized before the relocation.
To fix this, VMI activation is split into two phases; the detection,
which must happen before setting up ioremap, and the activation,
which must happen after parsing early boot parameters.

This fixes a crash on boot when VMI is enabled under VMware.

Signed-off-by: Zachary Amsden <zach at vmware.com>

diff --git a/arch/x86/include/asm/vmi.h b/arch/x86/include/asm/vmi.h
index b7c0dea..61e08c0 100644
--- a/include/asm-x86/vmi.h
+++ b/include/asm-x86/vmi.h
@@ -223,9 +223,15 @@ struct pci_header {
 } __attribute__((packed));
 
 /* Function prototypes for bootstrapping */
+#ifdef CONFIG_VMI
 extern void vmi_init(void);
+extern void vmi_activate(void);
 extern void vmi_bringup(void);
-extern void vmi_apply_boot_page_allocations(void);
+#else
+static inline void vmi_init(void) {}
+static inline void vmi_activate(void) {}
+static inline void vmi_bringup(void) {}
+#endif
 
 /* State needed to start an application processor in an SMP system. */
 struct vmi_ap_state {
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 9d5674f..bdec76e 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -634,6 +634,9 @@ void __init setup_arch(char **cmdline_p)
 	printk(KERN_INFO "Command line: %s\n", boot_command_line);
 #endif
 
+	/* VMI may relocate the fixmap; do this before touching ioremap area */
+	vmi_init();
+
 	early_cpu_init();
 	early_ioremap_init();
 
@@ -707,13 +710,8 @@ void __init setup_arch(char **cmdline_p)
 	check_efer();
 #endif
 
-#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
-	/*
-	 * Must be before kernel pagetables are setup
-	 * or fixmap area is touched.
-	 */
-	vmi_init();
-#endif
+	/* Must be before kernel pagetables are setup */
+	vmi_activate();
 
 	/* after early param, so could get panic from serial */
 	reserve_early_setup_data();
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 7b10933..f71f96f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -289,9 +289,7 @@ static void __cpuinit start_secondary(void *unused)
 	 * fragile that we want to limit the things done here to the
 	 * most necessary things.
 	 */
-#ifdef CONFIG_VMI
 	vmi_bringup();
-#endif
 	cpu_init();
 	preempt_disable();
 	smp_callin();
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index 8b6c393..22fd657 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -960,8 +960,6 @@ static inline int __init activate_vmi(void)
 
 void __init vmi_init(void)
 {
-	unsigned long flags;
-
 	if (!vmi_rom)
 		probe_vmi_rom();
 	else
@@ -973,13 +971,21 @@ void __init vmi_init(void)
 
 	reserve_top_address(-vmi_rom->virtual_top);
 
-	local_irq_save(flags);
-	activate_vmi();
-
 #ifdef CONFIG_X86_IO_APIC
 	/* This is virtual hardware; timer routing is wired correctly */
 	no_timer_check = 1;
 #endif
+}
+
+void vmi_activate(void)
+{
+	unsigned long flags;
+
+	if (!vmi_rom)
+		return;
+
+	local_irq_save(flags);
+	activate_vmi();
 	local_irq_restore(flags & X86_EFLAGS_IF);
 }
 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1185
retrieving revision 1.1186
diff -u -r1.1185 -r1.1186
--- kernel.spec	12 Dec 2008 05:22:56 -0000	1.1185
+++ kernel.spec	12 Dec 2008 05:57:18 -0000	1.1186
@@ -581,6 +581,8 @@
 
 # fix idr bug in 27.8
 Patch12: linux-2.6-lib-idr-fix-bug-introduced-by-rcu-fix.patch
+# fix VMI crash in 27.7
+Patch13: linux-2.6.27.7-vmi-fix-crash-on-boot.patch
 
 # Standalone patches
 Patch20: linux-2.6-hotfixes.patch
@@ -1099,6 +1101,7 @@
 ApplyPatch git-cpufreq.patch
 
 ApplyPatch linux-2.6-lib-idr-fix-bug-introduced-by-rcu-fix.patch
+ApplyPatch linux-2.6.27.7-vmi-fix-crash-on-boot.patch
 
 ApplyPatch linux-2.6-hotfixes.patch
 
@@ -1920,6 +1923,9 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Fri Dec 12 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.27.9-150.rc1
+- Fix VMI crash on boot introduced in 2.6.27.7 (#476062)
+
 * Fri Dec 12 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.27.9-149.rc1
 - Linux 2.6.27.9-rc1
   Dropped patches:




More information about the fedora-extras-commits mailing list