Subject: Re: split x86/pci/pci_machdep.c
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Nicolas Joly <njoly@pasteur.fr>
List: port-amd64
Date: 02/07/2006 15:39:56
--J/dobhs11T7y2rNN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Jan 29, 2006 at 01:10:59AM +0100, Manuel Bouyer wrote:
> Hi,
> would someone object if I commit the attached change ?
> It splits interrupt handling from PCI configuration. Xen3 needs a special
> interrupt setting, but PCI bus config and access is standard. With this
> change, I can use x86/pci/pci_machdep.c without duplicate code,
> I just need a xen-specific pci_intr_machdep.c

Hi,

I just updated my -current sources, rebuilded my kernel, and noticed
some strange PCI messages at boot (full dmesg attached).

Where i previously had 5 PCI busses, the kernel now detect 9
busses. Some of them looks like ghost of real ones; by example, pci5
report devices from pci2 :

njoly@lanfeust [~]> pcictl pci2 list
002:09:0: Broadcom BCM5703X 10/100/1000 Ethernet (ethernet network,
revision 0x02)
njoly@lanfeust [~]> pcictl pci5 list
002:09:0: Broadcom BCM5703X 10/100/1000 Ethernet (ethernet network,
revision 0x02)

It seems that that the `pci_machdep.c' vs. `pci_intr_machdep.c' change
triggers this new behaviour; i tried to revert it and all PCI were
fine again.

Any idea of what's going on ?
Thanks.

njoly@lanfeust [~/NetBSD]> grep '^pci[0-9]' dmesg.old
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
pci2 at ppb1 bus 2
pci2: memory space enabled
pci3 at ppb2 bus 3
pci3: memory space enabled
pci4 at mainbus0 bus 4
pci4: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pci5 at ppb3 bus 5
pci5: i/o space, memory space enabled

njoly@lanfeust [~/NetBSD]> grep '^pci[0-9]' dmesg.new
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
pci2 at ppb1 bus 2
pci2: memory space enabled
pci3 at ppb2 bus 3
pci3: memory space enabled
pci4 at mainbus0 bus 1
pci4: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pci5 at mainbus0 bus 2
pci5: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pci6 at mainbus0 bus 3
pci6: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pci7 at mainbus0 bus 4
pci7: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pci8 at ppb3 bus 5
pci8: i/o space, memory space enabled
pci9 at mainbus0 bus 5
pci9: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.

--J/dobhs11T7y2rNN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=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.15 (LANFEUST) #0: Tue Feb  7 15:14:42 CET 2006
	njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj/amd64/sys/arch/amd64/compile/LANFEUST
total memory = 2047 MB
avail memory = 1921 MB
mainbus0 (root)
mainbus0: Intel MP Specification (Version 1.4) (TYAN     RHAPSODY    )
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD Opteron(tm) Processor 246, 1991.78 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 199 MHz
cpu0: 16 page colors
cpu1 at mainbus0: apid 1 (application processor)
cpu1: starting
cpu1: AMD Opteron(tm) Processor 246, 1991.72 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
mpbios: bus 0 is type PCI   
mpbios: bus 1 is type PCI   
mpbios: bus 2 is type PCI   
mpbios: bus 3 is type PCI   
mpbios: bus 4 is type PCI   
mpbios: bus 5 is type PCI   
mpbios: bus 6 is type ISA   
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 0xfc9ff000, version 11, 4 pins
ioapic2 at mainbus0 apid 4 (I/O APIC)
ioapic2: pa 0xfc9fe000, version 11, 4 pins
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
ppb0 at pci0 dev 6 function 0: Advanced Micro Devices AMD8111 I/O Hub (rev. 0x07)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
ohci0 at pci1 dev 0 function 0: Advanced Micro Devices AMD8111 USB Host Controller (rev. 0x0b)
ohci0: interrupting at ioapic0 pin 19 (irq 9)
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: 3 ports with 3 removable, self powered
ohci1 at pci1 dev 0 function 1: Advanced Micro Devices AMD8111 USB Host Controller (rev. 0x0b)
ohci1: interrupting at ioapic0 pin 19 (irq 9)
ohci1: OHCI version 1.0, legacy support
usb1 at ohci1: USB revision 1.0
uhub1 at usb1
uhub1: Advanced Micro OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 3 ports with 3 removable, self powered
satalink0 at pci1 dev 11 function 0
satalink0: Silicon Image SATALink 3114 (rev. 0x02)
satalink0: 33MHz PCI bus
satalink0: bus-master DMA support present
satalink0: using ioapic0 pin 17 (irq 10) for native-PCI interrupt
atabus0 at satalink0 channel 0
atabus1 at satalink0 channel 1
atabus2 at satalink0 channel 2
atabus3 at satalink0 channel 3
fwohci0 at pci1 dev 12 function 0: Texas Instruments TSB43AA22/A IEEE 1394 Host Controller (rev. 0x00)
fwohci0: interrupting at ioapic0 pin 19 (irq 9)
fwohci0: OHCI version 1.10 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 00:e0:81:00:00:30:8d:71
fwohci0: Phy 1394a available S400, 2 ports.
fwohci0: Link S400, max_rec 2048 bytes.
ieee1394if0 at fwohci0: IEEE1394 bus
fwip0 at ieee1394if0: IP over IEEE1394
fwohci0: Initiate bus reset
pcib0 at pci0 dev 7 function 0
pcib0: Advanced Micro Devices AMD8111 LPC Controller (rev. 0x05)
viaide0 at pci0 dev 7 function 1
viaide0: Advanced Micro Devices AMD8111 IDE Controller (rev. 0x03)
viaide0: bus-master DMA support present
viaide0: primary channel configured to compatibility mode
viaide0: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus4 at viaide0 channel 0
viaide0: secondary channel configured to compatibility mode
viaide0: secondary channel interrupting at ioapic0 pin 15 (irq 15)
atabus5 at viaide0 channel 1
Advanced Micro Devices AMD8111 SMBus Controller (SMBus serial bus, revision 0x02) at pci0 dev 7 function 2 not configured
Advanced Micro Devices AMD8111 ACPI Controller (miscellaneous bridge, revision 0x05) at pci0 dev 7 function 3 not configured
auich0 at pci0 dev 7 function 5: AMD8111 AC-97 Audio
auich0: interrupting at ioapic0 pin 17 (irq 10)
auich0: ac97: Analog Devices AD1981B codec; headphone, 20 bit DAC, no 3D stereo
auich0: ac97: ext id 605<AC97_22,AMAP,SPDIF,VRA>
ppb1 at pci0 dev 10 function 0: Advanced Micro Devices AMD8131 PCI-X Tunnel (rev. 0x12)
pci2 at ppb1 bus 2
pci2: memory space enabled
bge0 at pci2 dev 9 function 0: Broadcom BCM5703X Gigabit Ethernet
bge0: interrupting at ioapic1 pin 0 (irq 11)
bge0: ASIC BCM5703 A2 (0x1002), Ethernet address 00:e0:81:31:59:61
brgphy0 at bge0 phy 1: BCM5703 1000BASE-T media interface, rev. 2
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
aapic0 at pci0 dev 10 function 1: Advanced Micro Devices AMD8131 IO Apic (rev. 0x01)
ppb2 at pci0 dev 11 function 0: Advanced Micro Devices AMD8131 PCI-X Tunnel (rev. 0x12)
pci3 at ppb2 bus 3
pci3: memory space enabled
aapic1 at pci0 dev 11 function 1: Advanced Micro Devices AMD8131 IO Apic (rev. 0x01)
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
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0 mux 1
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
attimer0 at isa0 port 0x40-0x43: AT Timer
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
pcppi0: attached to attimer0
pci4 at mainbus0 bus 1
pci4: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
ohci2 at pci4 dev 0 function 0: Advanced Micro Devices AMD8111 USB Host Controller (rev. 0x0b)
ohci2: can't map mem space
ohci3 at pci4 dev 0 function 1: Advanced Micro Devices AMD8111 USB Host Controller (rev. 0x0b)
ohci3: can't map mem space
satalink1 at pci4 dev 11 function 0
satalink1: Silicon Image SATALink 3114 (rev. 0x02)
satalink1: unable to map SATALink BA5 register space
fwohci1 at pci4 dev 12 function 0: Texas Instruments TSB43AA22/A IEEE 1394 Host Controller (rev. 0x00)
fwohci1: can't map OHCI register space
pci5 at mainbus0 bus 2
pci5: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
bge1 at pci5 dev 9 function 0: Broadcom BCM5703X Gigabit Ethernet
bge1: can't find mem space
pci6 at mainbus0 bus 3
pci6: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pci7 at mainbus0 bus 4
pci7: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb8 at pci7 dev 0 function 0
pchb8: Advanced Micro Devices AMD8151 AGP Device (rev. 0x14)
ppb3 at pci7 dev 1 function 0: Advanced Micro Devices AMD8151 AGP Bridge (rev. 0x14)
pci8 at ppb3 bus 5
pci8: i/o space, memory space enabled
vga0 at pci8 dev 0 function 0: NVIDIA GeForce FX 5200 (rev. 0xa1)
wsdisplay0 at vga0 kbdmux 1
wsmux1: connecting to wsdisplay0
wskbd0: connecting to wsdisplay0
pci9 at mainbus0 bus 5
pci9: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
NVIDIA GeForce FX 5200 (VGA display, revision 0xa1) at pci9 dev 0 function 0 not configured
ioapic0: enabling
ioapic1: enabling
ioapic2: enabling
fwohci0: node_id=0xc800ffc0, gen=1, CYCLEMASTER mode
ieee1394if0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
ieee1394if0: bus manager 0 (me)
auich0: measured ac97 link rate at 49488 Hz, will use 48000 Hz
audio0 at auich0: full duplex, mmap, independent
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
Kernelized RAIDframe activated
wd0 at atabus4 drive 0: <Maxtor 6E040L0>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 39205 MB, 79656 cyl, 16 head, 63 sec, 512 bytes/sect x 80293248 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd1 at atabus4 drive 1: <Maxtor 6Y120L0>
wd1: drive supports 16-sector PIO transfers, LBA addressing
wd1: 114 GB, 238216 cyl, 16 head, 63 sec, 512 bytes/sect x 240121728 sectors
wd1: 32-bit data port
wd1: 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 6 (Ultra/133) (using DMA)
wd1(viaide0:0:1): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
atapibus0 at atabus5: 2 targets
cd0 at atapibus0 drive 0: <GCR-8523B, , 1.01> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2
cd0(viaide0:1:0): using PIO mode 4, DMA mode 2 (using DMA)
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
cpu1: CPU 1 running
wsdisplay0: screen 0 added (80x25, vt100 emulation)
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)

--J/dobhs11T7y2rNN--