[PATCH] ACPI: Fix paranoia about using BIOS quickboot mechanism

Alok Kataria akataria at vmware.com
Mon Jun 23 23:38:37 UTC 2008


Already in mainline..required for cpu hotplug.
--
VMware, Inc. is providing the following patch to you under the terms of the GPL
version 2 and no later version. This patch is provided as is, with no
warranties or support. VMware disclaims all liability in connection with
the use/inability to use this patch. Any use of the attached is
considered acceptance of the above.

Author : Alok Kataria <akataria at vmware.com>
Commit : 63d38198a0f57dca87e6cb79931c7bedbb7ab069

The shutdown status flag set to "0xA", corresponds to "JMP double word
request without INT init".

This JMP at reboot time is at an unintended location. And results in
Triple faults in our case.
Though this error at reboot can be safely ignored in a VM environment,
am not sure what the effect would be on a physical system. May be it
will result in a triple fault and an eventual hardware reset thus
masking this BUG in the kernel.

This fix just makes sure that we reset that status flag after
initialization is done.

Fix paranoia about using BIOS quickboot mechanism.

Make sure that we clear the "shutdown status flag" in the CMOS register
after each CPU is brought up.  This fixes a problem where the "shutdown
status flag" may remain set when a CPU is brought up after booting.

Signed-off-by: Alok N Kataria <akataria at vmware.com>

Index: ubuntu-hardy/arch/x86/kernel/smpboot_64.c
===================================================================
--- ubuntu-hardy.orig/arch/x86/kernel/smpboot_64.c	2008-06-06 10:59:05.000000000 -0700
+++ ubuntu-hardy/arch/x86/kernel/smpboot_64.c	2008-06-12 10:23:35.000000000 -0700
@@ -536,6 +536,23 @@
 }
 
 /*
+ * Cleanup possible dangling ends...
+ */
+static __cpuinit void smp_cleanup_boot(void)
+{
+	/*
+	 * Paranoid:  Set warm reset code and vector here back
+	 * to default values.
+	 */
+	CMOS_WRITE(0, 0xf);
+
+	/*
+	 * Reset trampoline flag
+	 */
+	*((volatile int *) phys_to_virt(0x467)) = 0;
+}
+
+/*
  * Boot one CPU.
  */
 static int __cpuinit do_boot_cpu(int cpu, int apicid)
@@ -689,6 +706,8 @@
 #endif
 		}
 	}
+	smp_cleanup_boot();
+
 	if (boot_error) {
 		cpu_clear(cpu, cpu_callout_map); /* was set here (do_boot_cpu()) */
 		clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */
@@ -706,23 +725,6 @@
 unsigned long cache_decay_ticks;
 
 /*
- * Cleanup possible dangling ends...
- */
-static __cpuinit void smp_cleanup_boot(void)
-{
-	/*
-	 * Paranoid:  Set warm reset code and vector here back
-	 * to default values.
-	 */
-	CMOS_WRITE(0, 0xf);
-
-	/*
-	 * Reset trampoline flag
-	 */
-	*((volatile int *) phys_to_virt(0x467)) = 0;
-}
-
-/*
  * Fall back to non SMP mode after errors.
  *
  * RED-PEN audit/test this more. I bet there is more state messed up here.
@@ -980,7 +982,6 @@
  */
 void __init smp_cpus_done(unsigned int max_cpus)
 {
-	smp_cleanup_boot();
 	setup_ioapic_dest();
 	check_nmi_watchdog();
 }






More information about the kernel-team mailing list