Subject: PCI devices in domU
To: None <port-xen@NetBSD.org>
From: Andreas Wrede <andreas@planix.com>
List: port-xen
Date: 09/07/2006 11:33:38
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--Apple-Mail-8--1052607881
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

I am upgrading my development machine from Xen2 to Xen3.  Dom0 is  
working fine (after I learned to add 'nosmp' to kernel line in /grub/ 
menu.lst).  The stock XEN3_DOMU kernel also works fine. However, with  
the PCI device definitions added to the XEN3_DOMU kernel, I get an  
instant panic in pci_mode_detect. The additions to the kernel config  
file worked fine in Xen2, they are:

------
# Add support for PCI busses to the XENU kernel
pci*            at hypervisor? bus ?

# PCI IEEE1394 controllers
fwohci* at pci? dev ? function ?        # IEEE1394 Open Host Controller

# CardBus IEEE1394 controllers
#fwohci*        at cardbus? function ?  # IEEE1394 Open Host Controller

ieee1394if* at fwohci?
fwip*   at ieee1394if?                  # IP over IEEE1394
sbp*    at ieee1394if? euihi ? euilo ?  # SCSI over IEEE1394

scsibus* at scsi?

# Audio Devices
eap*    at pci? dev ? function ?        # Ensoniq AudioPCI

# Audio support
audio*  at audiobus?
# MIDI support
midi*   at  midibus?
-----------

The PCI devices I want to us in the guest OS are 'hidden' from Dom0  
by pciback.hide='(02:05.0)(02:02.0)(02:03.0)(02:03.1)' on the kernel  
config line in Grub.


Should the PCI bus attach to the Hypervisor, as in Xen2?

dmesg, etc:

NetBSD 4.99.1 (XEN3_DOMU_P) #1: Thu Sep  7 10:47:26 EDT 2006
         root@wxen0.wrede.pvt:/m5/netbsd-current/obj.i386/sys/arch/ 
i386/compile/XEN3_DOMU_P
total memory = 600 MB
avail memory = 584 MB
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Pentium 4 (686-class), 2205.00 MHz, id 0xf24
cpu0: features  
3febfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features 3febfbff<PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX>
cpu0: features 3febfbff<FXSR,SSE,SSE2,SS,HTT,TM>
cpu0: I-cache 12K uOp cache 8-way, D-cache 8 KB 64B/line 4-way
cpu0: L2 cache 512 KB 64B/line 8-way
cpu0: ITLB 4K/4M: 64 entries
cpu0: DTLB 4K/4M: 64 entries
cpu0: 16 page colors
hypervisor0 at mainbus0
debug virtual interrupt using event channel 3
xenbus0 at hypervisor0: Xen Virtual Bus Interface
xencons0 at hypervisor0: Xen Virtual Console Driver
xencons0: console major 143, unit 0
xencons0: using event channel 2
npx0 at hypervisor0: using exception 16
kernel: supervisor trap protection fault, code=0
Stopped in pid 0.1 (swapper) at netbsd:pci_mode_detect+0x25:     
inl     %dx,%eax

db> bt
pci_mode_detect(c1160f40,c03ce2b0,c053da74,c034ec30,0) at  
netbsd:pci_mode_detect+0x25
hypervisor_attach(c1160fc0,c1160f40,c053db40,0,c053db40) at  
netbsd:hypervisor_attach+0x98
config_attach_loc(c1160fc0,c0405038,0,c053db40,c034ea70) at  
netbsd:config_attach_loc+0x390
config_found_ia(c1160fc0,c03ce2a2,c053db40,c034ea70,c03ce238) at  
netbsd:config_found_ia+0x32
mainbus_attach(0,c1160fc0,0,c053dbb4,c0405020) at  
netbsd:mainbus_attach+0x7d
config_attach_loc(0,c0405020,0,0,0) at netbsd:config_attach_loc+0x390
config_attach(0,c0405020,0,0,c053ac10) at netbsd:config_attach+0x2c
config_rootfound(c03ce230,0,c053dc38,c053ac10,53a000) at  
netbsd:config_rootfound+0x44
cpu_configure(0,c03d9e91,c040a400,eff000,c053ac10) at  
netbsd:cpu_configure+0x23
configure(0,1,c044b1fc,c049d000,c) at netbsd:configure+0x33
main(c01001c7,c01001cf,0,0,0) at netbsd:main+0xcf


-- 
     aew


--Apple-Mail-8--1052607881
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFADvVEh/h9J/TQyERAk97AKCT2o59D8MWh3ynDh+/vcj7KV0AXwCg6vRL
KIDvLCdgeM0bFSvKYz4QaeY=
=4nAR
-----END PGP SIGNATURE-----

--Apple-Mail-8--1052607881--