Subject: kern/20690: MPACPI assumes ProcessorApicId == 0 is BSP, some machines use Id 1 for that.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jdolecek@NetBSD.org>
List: netbsd-bugs
Date: 03/13/2003 08:58:12
>Number:         20690
>Category:       kern
>Synopsis:       MPACPI assumes ProcessorApicId == 0 is BSP, some machines use Id 1 for that.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 13 08:59:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jaromir Dolecek
>Release:        NetBSD 1.6P
>Organization:
>Environment:
>Description:
MPACPI code assumes the ACPI tables use ProcessorApicId == 0
for boot processor. By observation, this isn't true at least on one
single CPU Compaq P4 system.
>How-To-Repeat:
boot MP kernel with MPACPI on Compaq D51S. Watch it panic with
'cpu at apic id 0 already attached?'.
>Fix:
This appears to fix this particular problem:

Index: mpacpi.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/mpacpi.c,v
retrieving revision 1.5
diff -u -r1.5 mpacpi.c
--- mpacpi.c    2003/01/13 21:14:39     1.5
+++ mpacpi.c    2003/03/13 16:57:50
@@ -287,7 +287,8 @@
                         * XXX check if that's correct.
                         * XXX field name in structure is wrong.
                         */
-                       if (p->ProcessorApicId == 0)
+                       if (p->ProcessorApicId == 0
+                           || p->ProcessorApicId == 1)
                                caa.cpu_role = CPU_ROLE_BP;
                        else
                                caa.cpu_role = CPU_ROLE_AP;

>Release-Note:
>Audit-Trail:
>Unformatted: