[Pkg-xen-devel] [Xen-devel] Re: Problems with PCI pass-through

Konrad Rzeszutek Wilk konrad.wilk at oracle.com
Mon Jun 7 15:13:56 UTC 2010


On Sat, Jun 05, 2010 at 12:42:15AM +0200, Thomas Schwinge wrote:
> Hello!
> 
> As I'm writing in
> <http://lists.alioth.debian.org/pipermail/pkg-xen-devel/2010-May/002782.html>
> I'm having problems with PCI pass-through.

Oh, sorry didn't pay attention to it.
> 
> 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).
> 
> 
> Some more details:
> 
> On Sat, May 29, 2010 at 03:32:46PM +0300, Pasi Kärkkäinen 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=(00:02.7) root=/dev/mapper/vg0-boole--root ro console=hvc0 earlyprintk=xen debug 

So 00:02.7..
.. snip..
> Apparently the pciback does something.
> 
> Boot log for the domU:
> 
>     [    0.000000] Linux version 2.6.32-5-xen-686 (Debian 2.6.32-15) (ben at 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): 

        for (bus = 0; bus < 256; bus++) {
                for (slot = 0; slot < 32; slot++) {
                        for (func = 0; func < 8; func++) {
                                u32 class;
                                u8 type;

                                class = read_pci_config(bus, slot, func,
                                                        PCI_CLASS_REVISION);
                                if (class == 0xffffffff) {
                                        func = 8;
					continue;
				}


the deal is that if it finds that first func (0) returns 0xffffff (no device),
then it skips over all of the other functions on the slot. In your case you 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.



More information about the Pkg-xen-devel mailing list