[LinuxBIOS] r3017 - trunk/LinuxBIOSv2/src/include/cpu/x86

svn at openbios.org svn at openbios.org
Wed Dec 19 02:52:11 CET 2007

Author: mjones
Date: 2007-12-19 02:52:11 +0100 (Wed, 19 Dec 2007)
New Revision: 3017

Changed the stop_this_cpu() to just hlt.
Removed local APIC INIT (don't worry the APIC and AP are still initialized).

The local APIC INIT seemed to be the incorrect thing to do to stop an AP.
The Intel Multiprocessor specification indicated that a vector should be set
and a START should happen following an INIT. Then AP will execute the 
instructions pointed to by the vector. There is no vector or start in
stop_this_cpu(). This seems to put the AP in an in-between state. In the case
of Barcelona the AP's MSRs and PCI register are not accessible by the hardware

The better solution seems to be to just put the AP in a hlt and allow the AP
to go into C1. Then APIC managing software running on the BSP can program the
AP as needed.

Signed-off-by: Marc Jones <marc.jones at amd.com>
Reviewed-by: Jordan Crouse <jordan.crouse at amd.com>
Acked-by: Ronald G. Minnich <rminnich at gmail.com>

Modified: trunk/LinuxBIOSv2/src/include/cpu/x86/lapic.h
--- trunk/LinuxBIOSv2/src/include/cpu/x86/lapic.h	2007-12-19 01:49:44 UTC (rev 3016)
+++ trunk/LinuxBIOSv2/src/include/cpu/x86/lapic.h	2007-12-19 01:52:11 UTC (rev 3017)
@@ -54,22 +54,7 @@
 static inline __attribute__((always_inline)) void stop_this_cpu(void)
-	unsigned apicid;
-	apicid = lapicid();
-	/* Send an APIC INIT to myself */
-	lapic_write(LAPIC_ICR2, SET_LAPIC_DEST_FIELD(apicid));
-	/* Wait for the ipi send to finish */
-	lapic_wait_icr_idle();
-	/* Deassert the APIC INIT */
-	lapic_write(LAPIC_ICR2, SET_LAPIC_DEST_FIELD(apicid));
-	/* Wait for the ipi send to finish */
-	lapic_wait_icr_idle();
-	/* If I haven't halted spin forever */
+	/* Called by an AP when it is ready to halt and wait for a new task */
 	for(;;) {

More information about the coreboot mailing list