Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-i386/38729: ACPI kernel booted under qemu cannot detectdevices



jmcneill%invisible.ca@localhost wrote:

> The attached patch fixes PCI bus detection issues in qemu with ACPI
> enabled. It should apply cleanly to 5.0, and amd64 machdep will probably
> need the same treatment but I cannot test.

Seems working with qemu-system-x86_64 on NetBSD/i386:

---
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008
    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 5.0_RC3 (GENERIC) #2: Tue Mar 24 23:24:19 JST 2009
        
tsutsui@mirage:/r/work/netbsd-5/src/sys/arch/amd64/compile/obj.amd64/GENERIC
total memory = 127 MB
avail memory = 110 MB
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
Generic PC
mainbus0 (root)
cpu0 at mainbus0 apid 0: AMD 686-class, id 0x623
ioapic0 at mainbus0 apid 1: pa 0xfec00000, version 11, 24 pins
acpi0 at mainbus0: Intel ACPICA 20080321
acpi0: X/RSDT: OemId <QEMU  ,QEMURSDT,00000001>, AslId <QEMU,00000001>
acpi0: SCI interrupting at int 11
timecounter: Timecounter "ACPI-Safe" frequency 3579545 Hz quality 900
ACPI-Safe 24-bit timer
pckbc1 at acpi0 (KBD, PNP0303): kbd port
pckbc1: io 0x60,0x64 irq 1
pckbc2 at acpi0 (MOU, PNP0F13): aux port
pckbc2: irq 12
FDC0 (PNP0700) at acpi0 not configured
LPT (PNP0400) at acpi0 not configured
COM1 (PNP0501) at acpi0 not configured
pckbd0 at pckbc1 (kbd slot)
pckbc1: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pms0 at pckbc1 (aux slot)
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
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: vendor 0x8086 product 0x1237 (rev. 0x02)
pcib0 at pci0 dev 1 function 0
pcib0: vendor 0x8086 product 0x7000 (rev. 0x00)
piixide0 at pci0 dev 1 function 1
piixide0: Intel 82371SB IDE Interface (PIIX3) (rev. 0x00)
piixide0: bus-master DMA support present
piixide0: primary channel wired to compatibility mode
piixide0: primary channel interrupting at irq 14
atabus0 at piixide0 channel 0
piixide0: secondary channel wired to compatibility mode
piixide0: secondary channel interrupting at irq 15
atabus1 at piixide0 channel 1
piixpm0 at pci0 dev 1 function 3
piixpm0: vendor 0x8086 product 0x7113 (rev. 0x00)
timecounter: Timecounter "piixpm0" frequency 3579545 Hz quality 900
piixpm0: 24-bit timer
piixpm0: interrupting at irq 11
iic0 at piixpm0: I2C bus
vga0 at pci0 dev 2 function 0: vendor 0x1013 product 0x00b8 (rev. 0x00)
wsdisplay0 at vga0 kbdmux 1: console (80x25, vt100 emulation), using wskbd0
wsmux1: connecting to wsdisplay0
drm at vga0 not configured
ne0 at pci0 dev 3 function 0: Realtek 8029 Ethernet
ne0: Ethernet address 52:54:00:12:34:56
ne0: 10base2, 10baseT, 10baseT-FDX, auto, default [0x40 0x40] 10baseT-FDX
ne0: interrupting at irq 11
isa0 at pcib0
lpt0 at isa0 port 0x378-0x37b irq 7
com0 at isa0 port 0x3f8-0x3ff irq 4: ns8250 or ns16450, no fifo
attimer0 at isa0 port 0x40-0x43: AT Timer
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker (CPU-intensive output)
sysbeep0 at pcppi0
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
attimer0: attached to pcppi0
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
wd0 at atabus0 drive 0: <QEMU HARDDISK>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 186 MB, 377 cyl, 16 head, 63 sec, 512 bytes/sect x 380943 sectors
wd0: 32-bit data port
wd0(piixide0:0:0): using PIO mode 0
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: <QEMU CD-ROM, QM00003, 0.9.0> cdrom removable
cd0: 32-bit data port
cd0(piixide0:1:0): using PIO mode 3
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs

---
Index: amd64/amd64/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/amd64/mainbus.c,v
retrieving revision 1.24
diff -u -r1.24 mainbus.c
--- amd64/amd64/mainbus.c       18 May 2008 02:06:14 -0000      1.24
+++ amd64/amd64/mainbus.c       24 Mar 2009 15:05:27 -0000
@@ -254,6 +254,8 @@
 
 #if NPCI > 0
        if (pci_mode != 0) {
+               int npcibus = 0;
+
                mba.mba_pba.pba_iot = X86_BUS_SPACE_IO;
                mba.mba_pba.pba_memt = X86_BUS_SPACE_MEM;
                mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
@@ -263,17 +265,18 @@
                mba.mba_pba.pba_bus = 0;
                mba.mba_pba.pba_bridgetag = NULL;
 #if NACPI > 0 && defined(ACPI_SCANPCI)
-               if (mpacpi_active)
-                       mpacpi_scan_pci(self, &mba.mba_pba, pcibusprint);
-               else
+               if (npcibus == 0 && mpacpi_active)
+                       npcibus = mpacpi_scan_pci(self, &mba.mba_pba,
+                           pcibusprint);
 #endif
 #if defined(MPBIOS) && defined(MPBIOS_SCANPCI)
-               if (mpbios_scanned != 0)
-                       mpbios_scan_pci(self, &mba.mba_pba, pcibusprint);
-               else
+               if (npcibus == 0 && mpbios_scanned != 0)
+                       npcibus = mpbios_scan_pci(self, &mba.mba_pba,
+                           pcibusprint);
 #endif
-               config_found_ia(self, "pcibus", &mba.mba_pba, pcibusprint);
-
+               if (npcibus == 0)
+                       config_found_ia(self, "pcibus", &mba.mba_pba,
+                           pcibusprint);
 #if NACPI > 0
                if (mp_verbose)
                        acpi_pci_link_state();

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index