Subject: dual AMD machine crashing at boot due to too many CPUs detected
To: None <port-i386@netbsd.org>
From: M Graff <explorer@flame.org>
List: port-i386
Date: 06/22/2006 14:35:17
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have this older Tyan based motherboard (I think...) with two AMD CPUs
on it.  About six months ago it started detecting more than two CPUs on
the machine.  This caused a crash at boot when these phantom CPUs were
configured.

What I did was a quick hack:

Index: sys/arch/i386/i386/cpu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/cpu.c,v
retrieving revision 1.28
diff -u -r1.28 cpu.c
- --- sys/arch/i386/i386/cpu.c    7 Jun 2006 22:37:58 -0000       1.28
+++ sys/arch/i386/i386/cpu.c    22 Jun 2006 19:13:25 -0000
@@ -247,6 +247,12 @@
        vaddr_t kstack;
        struct pcb *pcb;
 #endif
+       static int __cpus_we_found = 0;
+
+       __cpus_we_found++;
+       printf("\nFound cpu#%d\n", __cpus_we_found);
+       if (__cpus_we_found > 2)
+               return;

        /*
         * If we're an Application Processor, allocate a cpu_info

This clearly isn't a real fix, but since none of my machines have more
than two CPUs, it works for me for now.  However, when I get that
dual-CPU dual-core machine...

The questions are:  why is this machine detecting more than two CPUs,
why did it start suddenly, and how do I go about fixing this correctly?

The only thing that happened between now and then is I booted windows XP
on it once in a pinch.  I don't believe windows can permanently break
this machine, and I have reset all the BIOS settings to defaults both in
the BIOS and with the jumper.

- --Michael

dmesg:

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 3.99.21 (GENERIC.MP) #2: Wed Jun 21 16:04:53 CDT 2006
        explorer@speedy.home.flame.org:/sys/arch/i386/compile/GENERIC.MP
total memory = 2047 MB
avail memory = 2002 MB
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
timecounter: selected timecounter "i8254" frequency 1193182 Hz quality 100
BIOS32 rev. 0 found at 0xfd6c0
PCI BIOS rev. 2.1 found at 0xfd7e0
pcibios: config mechanism [1][x], special cycles [x][x], last bus 2
PCI IRQ Routing Table rev. 1.0 found at 0xfdf00, size 224 bytes (12 entries)
PCI Interrupt Router at 000:07:3 (Advanced Micro Devices product 0x7400
compatible)
mainbus0 (root)
cpu0 at mainbus0
Found cpu#1
: apid 1 (boot processor)
cpu0: AMD Athlon MP 2000+ (686-class), 1666.82 MHz, id 0x662
cpu0: features c3cbfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features c3cbfbff<PGE,MCA,CMOV,PAT,PSE36,MPC,MMXX,MMX>
cpu0: features c3cbfbff<FXSR,SSE,3DNOW2,3DNOW>
cpu0: "AMD Athlon(tm) MP 2000+"
cpu0: I-cache 64 KB 64B/line 2-way, D-cache 64 KB 64B/line 2-way
cpu0: L2 cache 256 KB 64B/line 16-way
cpu0: ITLB 16 4 KB entries fully associative, 8 4 MB entries fully
associative
cpu0: DTLB 32 4 KB entries fully associative, 8 4 MB entries 4-way
cpu0: calibrating local timer
cpu0: apic clock running at 266 MHz
cpu0: 8 page colors
cpu1 at mainbus0
Found cpu#2
: apid 0 (application processor)
cpu1: starting
cpu1: AMD Athlon MP 2000+ (686-class), 1666.73 MHz, id 0x662
cpu1: features c3cbfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu1: features c3cbfbff<PGE,MCA,CMOV,PAT,PSE36,MPC,MMXX,MMX>
cpu1: features c3cbfbff<FXSR,SSE,3DNOW2,3DNOW>
cpu1: "AMD Athlon(tm) Processor"
cpu1: I-cache 64 KB 64B/line 2-way, D-cache 64 KB 64B/line 2-way
cpu1: L2 cache 256 KB 64B/line 16-way
cpu1: ITLB 16 4 KB entries fully associative, 8 4 MB entries fully
associative
cpu1: DTLB 32 4 KB entries fully associative, 8 4 MB entries 4-way
ioapic0 at mainbus0 apid 2 (I/O APIC)
ioapic0: pa 0xfec00000, version 11, 24 pins
cpu2 at mainbus0
Found cpu#3
acpi0 at mainbus0: Advanced Configuration and Power Interface
acpi0: using Intel ACPI CA subsystem version 20060217
acpi0: X/RSDT: OemId <PTLTD ,  RSDT  ,06040000>, AslId < LTP,00000000>
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
acpi0: fixed-feature sleep button present
timecounter: Timecounter "ACPI_PM_TMR" frequency 3579545 Hz quality 900
timecounter: selected timecounter "ACPI_PM_TMR" frequency 3579545 Hz
quality 900
acpitimer: 24 bits
mpacpi: could not get bus number, assuming bus 0
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
acpibut0 at acpi0 (PNP0C0C): ACPI Power Button
PNP0C01 [System Board] at acpi0 not configured
PNP0A03 [PCI/PCI-X Host Bridge] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0000 [AT Interrupt Controller] at acpi0 not configured
PNP0200 [AT DMA Controller] at acpi0 not configured
attimer1 at acpi0 (PNP0100): AT Timer
attimer1: io 0x40-0x43 irq 0
PNP0B00 [AT Real-Time Clock] at acpi0 not configured
pcppi1 at acpi0 (PNP0800)
pcppi1: io 0x61
midi0 at pcppi1: PC speaker
sysbeep0 at pcppi1
npx1 at acpi0 (PNP0C04)
npx1: io 0xf0-0xff irq 13
npx1: using exception 16
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not
configured
pckbc1 at acpi0 (PNP0F13): aux port
pckbc1: irq 12
pckbc2 at acpi0 (PNP0303): kbd port
pckbc2: io 0x60,0x64 irq 1
PNP0A05 [Generic Container Device] at acpi0 not configured
com3 at acpi0 (PNP0501-1)
com3: io 0x3f8-0x3ff irq 4
com3: ns16550a, working fifo
com4 at acpi0 (PNP0501-2)
com4: io 0x2f8-0x2ff irq 3
com4: ns16550a, working fifo
lpt3 at acpi0 (PNP0400)
lpt3: io 0x378-0x37f,0x778-0x77f irq 7
fdc1 at acpi0 (PNP0700)
fdc1: io 0x3f0-0x3f5,0x3f7 irq 6 drq 2
pcppi1: attached to attimer1
pckbd0 at pckbc2 (kbd slot)
pckbc2: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Advanced Micro Devices AMD762 Northbridge (rev. 0x11)
agp0 at pchb0: aperture at 0xc8000000, size 0x8000000
ppb0 at pci0 dev 1 function 0: Advanced Micro Devices AMD762 AGP Bridge
(rev. 0x00)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 5 function 0: ATI Technologies Radeon 9600XT AR (rev. 0x00)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation), using wskbd0
wsmux1: connecting to wsdisplay0
ATI Technologies Radeon 9600 XT Secondary (miscellaneous display) at
pci1 dev 5 function 1 not configured
pcib0 at pci0 dev 7 function 0
pcib0: Advanced Micro Devices AMD768 PCI-ISA/LPC Bridge (rev. 0x05)
viaide0 at pci0 dev 7 function 1
viaide0: Advanced Micro Devices AMD768 IDE Controller (rev. 0x04)
viaide0: bus-master DMA support present
viaide0: primary channel configured to compatibility mode
viaide0: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus0 at viaide0 channel 0
viaide0: secondary channel configured to compatibility mode
viaide0: secondary channel interrupting at ioapic0 pin 15 (irq 15)
atabus1 at viaide0 channel 1
amdpm0 at pci0 dev 7 function 3: Advanced Micro Devices AMD768 Power
Management Controller (rev. 0x03)
amdpm0: 24-bit timer at 3579545Hz
timecounter: Timecounter "amdpm" frequency 3579545 Hz quality 1000
timecounter: selected timecounter "amdpm" frequency 3579545 Hz quality 1000
amdpm0: random number generator enabled (apprx. 62ms)
ppb1 at pci0 dev 16 function 0: Advanced Micro Devices AMD768 PCI-PCI
Bridge (rev. 0x05)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled
ohci0 at pci2 dev 0 function 0: Advanced Micro Devices AMD768 USB
Controller (rev. 0x07)
ohci0: interrupting at ioapic0 pin 19 (irq 10)
ohci0: OHCI version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Advanced Micro OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 4 ports with 4 removable, self powered
emuxki0 at pci2 dev 4 function 0: Creative Labs SBLive! EMU 10000 (audio
multimedia, revision 0x08)
emuxki0: ac97: TriTech TR28602 codec; no 3D stereo
audio0 at emuxki0: full duplex, mmap, independent
emuxki0: interrupting at ioapic0 pin 16 (irq 5)
joy0 at pci2 dev 4 function 1: Creative Labs PCI Gameport Joystick (rev
0x08)
joy0: joystick not connected
tlp0 at pci2 dev 7 function 0: DECchip 21143 Ethernet, pass 4.1
tlp0: interrupting at ioapic0 pin 19 (irq 10)
tlp0: Ethernet address 00:40:f6:8c:cc:45
tlp0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ex0 at pci2 dev 8 function 0: 3Com 3c905C-TX 10/100 Ethernet with mngmt
(rev. 0x78)
ex0: interrupting at ioapic0 pin 19 (irq 10)
ex0: MAC address 00:e0:81:22:d1:f1
exphy0 at ex0 phy 24: 3Com internal media interface
exphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
isa0 at pcib0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
isapnp0: no ISA Plug 'n Play devices found
ioapic0: enabling
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
Kernelized RAIDframe activated
IPsec: Initialized Security Association Processing.
uhidev0 at uhub0 port 2 configuration 1 interface 0
uhidev0: CHESEN USB Keyboard, rev 1.10/1.10, addr 2, iclass 3/1
ukbd0 at uhidev0
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev1 at uhub0 port 2 configuration 1 interface 1
uhidev1: CHESEN USB Keyboard, rev 1.10/1.10, addr 2, iclass 3/0
uhidev1: 3 report ids
uhid0 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=3, output=0, feature=0
wd0 at atabus0 drive 0: <Maxtor 6Y160P0>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 152 GB, 317632 cyl, 16 head, 63 sec, 512 bytes/sect x 320173056 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
cpu1: CPU 0 running
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
ohci0: 1 scheduling overruns
uhidev0: at uhub0 port 2 (addr 2) disconnected
wskbd1: disconnecting from wsdisplay0
wskbd1 detached
ukbd0 detached
uhidev0 detached
uhidev1: at uhub0 port 2 (addr 2) disconnected
uhid0 detached
uhid1 detached
uhidev1 detached
uhidev0 at uhub0 port 2 configuration 1 interface 0
uhidev0: CHESEN USB Keyboard, rev 1.10/1.10, addr 2, iclass 3/1
ukbd0 at uhidev0
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev1 at uhub0 port 2 configuration 1 interface 1
uhidev1: CHESEN USB Keyboard, rev 1.10/1.10, addr 2, iclass 3/0
uhidev1: 3 report ids
uhid0 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=3, output=0, feature=0
ohci0: 1 scheduling overruns
uhidev0: at uhub0 port 2 (addr 2) disconnected
wskbd1: disconnecting from wsdisplay0
wskbd1 detached
ukbd0 detached
uhidev0 detached
uhidev1: at uhub0 port 2 (addr 2) disconnected
uhid0 detached
uhid1 detached
uhidev1 detached
uhidev0 at uhub0 port 2 configuration 1 interface 0
uhidev0: CHESEN USB Keyboard, rev 1.10/1.10, addr 2, iclass 3/1
ukbd0 at uhidev0
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev1 at uhub0 port 2 configuration 1 interface 1
uhidev1: CHESEN USB Keyboard, rev 1.10/1.10, addr 2, iclass 3/0
uhidev1: 3 report ids
uhid0 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=3, output=0, feature=0
ohci0: 1 scheduling overruns
uhidev0: at uhub0 port 2 (addr 2) disconnected
wskbd1: disconnecting from wsdisplay0
wskbd1 detached
ukbd0 detached
uhidev0 detached
uhidev1: at uhub0 port 2 (addr 2) disconnected
uhid0 detached
uhid1 detached
uhidev1 detached
uhidev0 at uhub0 port 2 configuration 1 interface 0
uhidev0: CHESEN USB Keyboard, rev 1.10/1.10, addr 2, iclass 3/1
ukbd0 at uhidev0
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev1 at uhub0 port 2 configuration 1 interface 1
uhidev1: CHESEN USB Keyboard, rev 1.10/1.10, addr 2, iclass 3/0
uhidev1: 3 report ids
uhid0 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=3, output=0, feature=0

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)

iD8DBQFEmvD1uzMQWQwZDN0RAsPLAKCsyXW9tx7nSM/31rCSX2Jett6yFwCfSOI7
Pjn4/8Zo5m3zxcmO55zCFLo=
=dT73
-----END PGP SIGNATURE-----