From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Re: [Pkg-xen-devel] Problems with PCI pass-through Date: Mon, 7 Jun 2010 11:13:56 -0400 Message-ID: <20100607151356.GC5085@phenom.dumpdata.com> References: <20100528211856.GA4530@dirichlet.schwinge.homeip.net> <20100529123246.GT17817@reaktio.net> <20100604224215.GA3941@kepler.schwinge.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <20100604224215.GA3941@kepler.schwinge.homeip.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Thomas Schwinge Cc: Bastian Blank , pkg-xen-devel@lists.alioth.debian.org, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Sat, Jun 05, 2010 at 12:42:15AM +0200, Thomas Schwinge wrote: > Hello! >=20 > As I'm writing in > > I'm having problems with PCI pass-through. Oh, sorry didn't pay attention to it. >=20 > It doesn't matter whether I'm using a 3.4 or 4.0 hypervisor (Debian > packages). Also I tested two different kernels (both .32 ones). >=20 >=20 > Some more details: >=20 > On Sat, May 29, 2010 at 03:32:46PM +0300, Pasi K=E4rkk=E4inen wrote: > > On Fri, May 28, 2010 at 11:18:56PM +0200, Thomas Schwinge wrote: > > > I'm having problems getting PCI pass-through to work. Aha. I know exactly what the problem is.. .. snip.. > module /boot/vmlinuz-2.6.32-5-xen-amd64 /boot/vmlinuz-2.6.32-5-= xen-amd64 xen-pciback.hide=3D(00:02.7) root=3D/dev/mapper/vg0-boole--root= ro console=3Dhvc0 earlyprintk=3Dxen debug=20 So 00:02.7.. .. snip.. > Apparently the pciback does something. >=20 > Boot log for the domU: >=20 > [ 0.000000] Linux version 2.6.32-5-xen-686 (Debian 2.6.32-15) (b= en@decadent.org.uk) (gcc version 4.3.5 (Debian 4.3.5-1) ) #1 SMP Tue Jun = 1 08:48:09 UTC 2010 .. snip .. > [ 0.112222] pcifront pci-0: Installing PCI frontend > [ 0.112335] pcifront pci-0: Creating PCI Frontend Bus 0000:00 .. and here the bus is created by PCI frontend. The Linux kernel PCI interrogates the PCI bus by going over the bus and then each slot, and then each function (kind of). Here is the pseud-core (the real code is more convoluted):=20 for (bus =3D 0; bus < 256; bus++) { for (slot =3D 0; slot < 32; slot++) { for (func =3D 0; func < 8; func++) { u32 class; u8 type; class =3D read_pci_config(bus, slot, func= , PCI_CLASS_REVISIO= N); if (class =3D=3D 0xffffffff) { func =3D 8; continue; } the deal is that if it finds that first func (0) returns 0xffffff (no dev= ice), then it skips over all of the other functions on the slot. In your case y= ou are passing only function 7, so it skips right over your device as 0 returns 0xfffffff. If you pass in 00:02.0 and 00:02.7 it will work.