WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Thomas Schwinge <thomas@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [Pkg-xen-devel] Problems with PCI pass-through
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Mon, 7 Jun 2010 11:13:56 -0400
Cc: Bastian Blank <waldi@xxxxxxxxxx>, pkg-xen-devel@xxxxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 07 Jun 2010 08:15:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100604224215.GA3941@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20100528211856.GA4530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20100529123246.GT17817@xxxxxxxxxxx> <20100604224215.GA3941@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.19 (2009-01-05)
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@xxxxxxxxxxxxxxx) (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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>