Subject: Re: intr_establish: can't share intr source between different PIC types
To: Frank van der Linden <fvdl@netbsd.org>
From: Dave Huang <khym@azeotrope.org>
List: port-amd64
Date: 05/01/2005 19:19:06
On Sun, May 01, 2005 at 05:15:35PM +0200, Frank van der Linden wrote:
> Hi Dave,
> 
> If you can, try out a GENERIC.MPACPI kernel. It looks like the default
> MPBIOS interrupt mappings aren't complete, the ACPI mappings have a much
> better chance of working.

OK, I built a MPACPI kernel (not GENERIC.MPACPI; amd64 doesn't have
that config file), but it's even worse :( Not all PCI busses are
configured, and it thinks I have 3 CPUs instead of 2 :)

I tried it with MPACPI_SCANPCI enabled and disabled, and it didn't
make any difference. The config file I used is:

include	"arch/amd64/conf/std.amd64"
options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
maxusers	32		# estimated number of users
options 	INSECURE	# disable kernel security levels - X needs this
options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
options 	NTP		# NTP phase/frequency locked loop
options 	KTRACE		# system call tracing via ktrace(1)
options 	SYSTRACE	# system call vetting via systrace(1)
options 	SYSVMSG		# System V-like message queues
options 	SYSVSEM		# System V-like semaphores
options 	SYSVSHM		# System V-like memory sharing
options 	P1003_1B_SEMAPHORE
options 	LKM		# loadable kernel modules
options 	USERCONF	# userconf(4) support
options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
options 	COMPAT_20	# NetBSD 2.0,
options 	COMPAT_NETBSD32
options 	EXEC_ELF32
options		COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
file-system 	FFS		# UFS
file-system 	LFS		# log-structured file system
file-system 	MFS		# memory file system
file-system 	NFS		# Network File System client
file-system 	NTFS		# Windows/NT file system (experimental)
file-system 	CD9660		# ISO 9660 + Rock Ridge file system
file-system 	MSDOSFS		# MS-DOS file system
file-system 	FDESC		# /dev/fd
file-system 	KERNFS		# /kern
file-system 	PROCFS		# /proc
file-system 	UNION		# union file system
options 	SOFTDEP		# FFS soft updates support.
options 	INET		# IP + ICMP + TCP + UDP
options 	INET6		# IPV6
options		ACPIVERBOSE	# verboase ACPI configuration messages
options 	MIIVERBOSE	# verbose PHY autoconfig messages
options 	PCIVERBOSE	# verbose PCI device autoconfig messages
options 	SCSIVERBOSE	# human readable SCSI error messages
options 	USBVERBOSE	# verbose USB device autoconfig messages
options 	I2OVERBOSE	# verbose I2O driver messages
options 	NFS_BOOT_DHCP,NFS_BOOT_BOOTPARAM
options 	WSEMUL_VT100		# VT100 / VT220 emulation
options 	WS_KERNEL_FG=WSCOL_GREEN
options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
options 	WSDISPLAY_COMPAT_SYSCONS	# emulate some ioctls
options 	WSDISPLAY_COMPAT_USL		# VT handling
options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
options 	PCDISPLAY_SOFTCURSOR
config		netbsd	root on ? type ?
options 	MULTIPROCESSOR
options 	COM_MPLOCK
mainbus0 at root
acpi0 		at mainbus0
options 	MPACPI
options 	MPACPI_SCANPCI		# MPBIOS configures PCI roots
acpibut* 	at acpi?		# ACPI Button
com* 		at acpi?		# Serial communications interface
fdc* 		at acpi?		# Floppy disk controller
lpt* 		at acpi?		# Parallel port
pckbc*  	at acpi?		# PC keyboard controller
attimer*	at acpi?		# AT Timer
pcppi*         at acpi?                # AT-style speaker sound
cpu* 		at mainbus?
ioapic* 	at mainbus? apid ?
pci*	at mainbus? bus ?
pci*	at pchb? bus ?
pci*	at ppb? bus ?
pchb*	at pci? dev ? function ?	# PCI-Host bridges
pcib*	at pci? dev ? function ?	# PCI-ISA bridges
ppb*	at pci? dev ? function ?	# PCI-PCI bridges
puc*	at pci? dev ? function ?	# PCI "universal" comm. cards
aapic* 	at pci? dev ? function ?	# AMD 8131 IO apic
isa0	at mainbus?
isa0	at pcib?
pckbd*		at pckbc?		# PC keyboard
pms*		at pckbc?		# PS/2 mouse for wsmouse
vga*		at pci? dev ? function ?
wsdisplay*	at vga? console ?
wskbd*		at pckbd? console ?
wsmouse*	at pms? mux 0
sysbeep0	at pcppi?
com*	at puc? port ?			# 16x50s on "universal" comm boards
lpt*	at puc? port ?			# || ports on "universal" comm boards
iop*	at pci? dev ? function ?	# I/O processor
iopsp*	at iop? tid ?			# SCSI/FC-AL ports
ld*	at iop? tid ?			# block devices
siop*	at pci? dev ? function ?	# Symbios 53c8xx SCSI
esiop*	at pci? dev ? function ?	# Symbios 53c875 and newer SCSI
scsibus* at scsi?
sd*	at scsibus? target ? lun ?	# SCSI disk drives
st*	at scsibus? target ? lun ?	# SCSI tape drives
cd*	at scsibus? target ? lun ?	# SCSI CD-ROM drives
ch*	at scsibus? target ? lun ?	# SCSI autochangers
ses*	at scsibus? target ? lun ?	# SCSI Enclosure Services devices
ss*	at scsibus? target ? lun ?	# SCSI scanners
uk*	at scsibus? target ? lun ?	# SCSI unknown
pciide* at pci? dev ? function ? flags 0x0000	# GENERIC pciide driver
pdcide* at pci? dev ? function ?	# Promise IDE controllers
pdcsata* at pci? dev ? function ?	# Promise SATA150 controllers
satalink* at pci? dev ? function ?	# SiI SATALink controllers
viaide* at pci? dev ? function ?	# VIA/AMD/Nvidia IDE controllers
atabus* at ata?
wd*	at atabus? drive ? flags 0x0000
atapibus* at atapi?
cd*	at atapibus? drive ? flags 0x0000	# ATAPI CD-ROM drives
sd*	at atapibus? drive ? flags 0x0000	# ATAPI disk drives
fd*	at fdc? drive ?			# the drives themselves
fxp*	at pci? dev ? function ?	# Intel EtherExpress PRO 10+/100B
makphy*	at mii? phy ?			# Marvell Semiconductor 88E1000 PHYs
ukphy*	at mii? phy ?			# generic unknown PHYs
ehci*	at pci?	dev ? function ?	# Enhanced Host Controller
ohci*	at pci?	dev ? function ?	# Open Host Controller
uhci*	at pci?	dev ? function ?	# Universal Host Controller (Intel)
usb*	at ehci?
usb*	at ohci?
usb*	at uhci?
uhub*	at usb?
uhub*	at uhub? port ? configuration ? interface ?
uhidev*	at uhub? port ? configuration ? interface ?
ums*	at uhidev? reportid ?
wsmouse* at ums? mux 0
ukbd*	at uhidev? reportid ?
wskbd*	at ukbd? console ? mux 1
uhid*	at uhidev? reportid ?
ulpt*	at uhub? port ? configuration ? interface ?
umodem*	at uhub? port ? configuration ?
ucom*	at umodem?
umass*	at uhub? port ? configuration ? interface ?
ugen*	at uhub? port ?
auich*	at pci? dev ? function ?	# Intel/AMD/nVidia AC'97 Audio
audio*	at audiobus?
midi*	at pcppi?		# MIDI interface to the PC speaker
spkr0	at pcppi?		# PC speaker
pseudo-device	md		1	# memory disk device (ramdisk)
pseudo-device	vnd		4	# disk-like interface to files
pseudo-device	bpfilter	8	# Berkeley packet filter
pseudo-device	loop			# network loopback
pseudo-device	tun		2	# network tunneling over tty
pseudo-device	tap			# virtual Ethernet
pseudo-device	gre		2	# generic L3 over IP tunnel
pseudo-device	gif		4	# IPv[46] over IPv[46] tunnel (RFC1933)
pseudo-device	pty			# pseudo-terminals
pseudo-device	sequencer	1	# MIDI sequencer
pseudo-device	rnd			# /dev/random and in-kernel generator
pseudo-device	clockctl		# user control of clock subsystem
pseudo-device	ksyms			# /dev/ksyms
pseudo-device	wsmux			# mouse & keyboard multiplexor
pseudo-device	wsfont

And here are the kernel boot messages:

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    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.3 (CHEETAH) #2: Sun May  1 19:12:38 CDT 2005
	khym@yerfable.azeotrope.org:/usr2/obj.amd64/sys/arch/amd64/compile/CHEETAH
total memory = 2046 MB
avail memory = 1959 MB
mainbus0 (root)
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD Opteron(tm) Processor 246, 2009.35 MHz
cpu0: features: e7dbfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features: e7dbfbff<PGE,MCA,CMOV,PAT,PSE36,MPC,NOX,MMXX,MMX>
cpu0: features: e7dbfbff<FXSR,SSE,SSE2,LONG,3DNOW2,3DNOW>
cpu0: I-cache 64 KB 64B/line 2-way, D-cache 64 KB 64B/line 2-way
cpu0: L2 cache 1 MB 64B/line 16-way
cpu0: ITLB 32 4 KB entries fully associative, 8 4 MB entries fully associative
cpu0: DTLB 32 4 KB entries fully associative, 8 4 MB entries fully associative
cpu0: calibrating local timer
cpu0: apic clock running at 200 MHz
cpu0: 16 page colors
cpu1 at mainbus0: apid 1 (application processor)
cpu1: starting
cpu1: AMD Opteron(tm) Processor 246, 2009.26 MHz
cpu1: features: e7dbfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu1: features: e7dbfbff<PGE,MCA,CMOV,PAT,PSE36,MPC,NOX,MMXX,MMX>
cpu1: features: e7dbfbff<FXSR,SSE,SSE2,LONG,3DNOW2,3DNOW>
cpu1: I-cache 64 KB 64B/line 2-way, D-cache 64 KB 64B/line 2-way
cpu1: L2 cache 1 MB 64B/line 16-way
cpu1: ITLB 32 4 KB entries fully associative, 8 4 MB entries fully associative
cpu1: DTLB 32 4 KB entries fully associative, 8 4 MB entries fully associative
ioapic0 at mainbus0 apid 2 (I/O APIC)
ioapic0: pa 0xfec00000, version 11, 24 pins
ioapic1 at mainbus0 apid 3 (I/O APIC)
ioapic1: pa 0xd8000000, version 11, 4 pins
ioapic2 at mainbus0 apid 4 (I/O APIC)
ioapic2: pa 0xd8001000, version 11, 4 pins
cpu2 at mainbus0: (uniprocessor)
cpu2: AMD Opteron(tm) Processor 246, 2009.26 MHz
cpu2: features: e7dbfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu2: features: e7dbfbff<PGE,MCA,CMOV,PAT,PSE36,MPC,NOX,MMXX,MMX>
cpu2: features: e7dbfbff<FXSR,SSE,SSE2,LONG,3DNOW2,3DNOW>
cpu2: I-cache 64 KB 64B/line 2-way, D-cache 64 KB 64B/line 2-way
cpu2: L2 cache 1 MB 64B/line 16-way
cpu2: ITLB 32 4 KB entries fully associative, 8 4 MB entries fully associative
cpu2: DTLB 32 4 KB entries fully associative, 8 4 MB entries fully associative
acpi0 at mainbus0
acpi0: using Intel ACPI CA subsystem version 20040211
acpi0: X/RSDT: OemId <PTLTD ,  RSDT  ,06040000>, AslId < LTP,00000000>
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
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
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 Bus] at acpi0 not configured
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not configured
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not configured
PNP0000 [AT Interrupt Controller] at acpi0 not configured
attimer0 at acpi0 (PNP0100): AT Timer
attimer0: io 0x40-0x43 irq 0
PNP0200 [AT DMA Controller] at acpi0 not configured
pcppi0 at acpi0 (PNP0800)
pcppi0: io 0x61
midi0 at pcppi0: PC speaker
spkr0 at pcppi0
sysbeep0 at pcppi0
PNP0B00 [AT Real-Time Clock] at acpi0 not configured
PNP0C04 [Math Coprocessor] at acpi0 not configured
PNP0A05 [Generic ACPI Bus] at acpi0 not configured
com0 at acpi0 (PNP0501-1)
com0: io 0x3f8-0x3ff irq 4
com: ns16550a, working fifo
com0: console
fdc0 at acpi0 (PNP0700-1)
fdc0: io 0x3f0-0x3f5,0x3f7 irq 6 drq 2
pckbc0 at acpi0 (PNP0303): kbd port
pckbc0: io 0x60,0x64 irq 1
pckbc1 at acpi0 (PNP0F13): aux port
pckbc1: irq 12
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
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
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0A03 [PCI Bus] at acpi0 not configured
PNP0A03 [PCI Bus] at acpi0 not configured
pcppi0: attached to attimer0
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0 mux 1
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
Nvidia product 0x005e (miscellaneous memory, revision 0xa3) at pci0 dev 0 function 0 not configured
pcib0 at pci0 dev 1 function 0
pcib0: Nvidia product 0x0051 (rev. 0xa3)
Nvidia nForce4 SMBus (SMBus serial bus, revision 0xa2) at pci0 dev 1 function 1 not configured
ohci0 at pci0 dev 2 function 0: Nvidia product 0x005a (rev. 0xa2)
ohci0: interrupting at ioapic0 pin 10 (irq 10)
ohci0: OHCI version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Nvidia OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 10 ports with 10 removable, self powered
ehci0 at pci0 dev 2 function 1: Nvidia product 0x005b (rev. 0xa3)
ehci0: interrupting at ioapic0 pin 11 (irq 11)
ehci0: EHCI version 1.0
ehci0: companion controller, 4 ports each: ohci0
usb1 at ehci0: USB revision 2.0
uhub1 at usb1
uhub1: Nvidia EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub1: 10 ports with 10 removable, self powered
auich0 at pci0 dev 4 function 0: nForce4 AC-97 Audio
auich0: interrupting at ioapic0 pin 12 (irq 12)
auich0: ac97: Analog Devices AD1981B codec; headphone, 20 bit DAC, no 3D stereo
auich0: ac97: ext id 605<AC97_22,AMAP,SPDIF,VRA>
viaide0 at pci0 dev 6 function 0
viaide0: NVIDIA nForce4 IDE Controller (rev. 0xa2)
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
viaide1 at pci0 dev 7 function 0
viaide1: NVIDIA nForce4 Serial ATA Controller (rev. 0xa3)
viaide1: bus-master DMA support present
viaide1: primary channel wired to native-PCI mode
viaide1: using ioapic0 pin 10 (irq 10) for native-PCI interrupt
atabus2 at viaide1 channel 0
viaide1: secondary channel wired to native-PCI mode
atabus3 at viaide1 channel 1
viaide2 at pci0 dev 8 function 0
viaide2: NVIDIA nForce4 Serial ATA Controller (rev. 0xa3)
viaide2: bus-master DMA support present
viaide2: primary channel wired to native-PCI mode
viaide2: using ioapic0 pin 11 (irq 11) for native-PCI interrupt
atabus4 at viaide2 channel 0
viaide2: secondary channel wired to native-PCI mode
atabus5 at viaide2 channel 1
ppb0 at pci0 dev 9 function 0: Nvidia product 0x005c (rev. 0xa2)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
Texas Instruments TSB43AA22/A IEEE 1394 Host Controller (Firewire serial bus, interface 0x10) at pci1 dev 5 function 0 not configured
Nvidia product 0x0056 (ethernet network, revision 0xa3) at pci0 dev 10 function 0 not configured
ppb1 at pci0 dev 14 function 0: Nvidia product 0x005d (rev. 0xa3)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled, rd/line, wr/inv ok
vga0 at pci2 dev 0 function 0: Nvidia product 0x0140 (rev. 0xa2)
vga0: WARNING: ignoring 64-bit BAR @ 0x14
vga0: WARNING: ignoring 64-bit BAR @ 0x1c
wsdisplay0 at vga0 kbdmux 1
wsmux1: connecting to wsdisplay0
wskbd0: connecting to wsdisplay0
pchb0 at pci0 dev 24 function 0
pchb0: Advanced Micro Devices AMD64 HyperTransport configuration (rev. 0x00)
pchb1 at pci0 dev 24 function 1
pchb1: Advanced Micro Devices AMD64 Address Map configuration (rev. 0x00)
pchb2 at pci0 dev 24 function 2
pchb2: Advanced Micro Devices AMD64 DRAM configuration (rev. 0x00)
pchb3 at pci0 dev 24 function 3
pchb3: Advanced Micro Devices AMD64 Miscellaneous configuration (rev. 0x00)
pchb4 at pci0 dev 25 function 0
pchb4: Advanced Micro Devices AMD64 HyperTransport configuration (rev. 0x00)
pchb5 at pci0 dev 25 function 1
pchb5: Advanced Micro Devices AMD64 Address Map configuration (rev. 0x00)
pchb6 at pci0 dev 25 function 2
pchb6: Advanced Micro Devices AMD64 DRAM configuration (rev. 0x00)
pchb7 at pci0 dev 25 function 3
pchb7: Advanced Micro Devices AMD64 Miscellaneous configuration (rev. 0x00)
isa0 at pcib0
ioapic0: enabling
ioapic1: enabling
ioapic2: enabling
auich0: measured ac97 link rate at 47998 Hz, will use 48000 Hz
audio0 at auich0: full duplex, mmap, independent
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <LITE-ON DVDRW SOHW-1673S, , JS02> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
cd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 4 (Ultra/66) (using DMA)
findroot: netboot interface not found.
boot device: <unknown>
root device: