Re: PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2

Chris Wright
2011-02-23T00:11:23Z

* James Neave (roboj1m@gmail.com) wrote:
> On Tue, Feb 22, 2011 at 1:51 AM, Chris Wright <chrisw@sous-sol.org> wrote:
> > * James Neave (roboj1m@gmail.com) wrote:
> >> Does anybody know the debug kernel switches for iommu?
> >
> > Two helpful kernel commandline options are:
> >
> > amd_iommu_dump debug (and drop "quiet")
> >
> > The problem is when you attach the device (function) you're getting
> > stuck up in conflicts with the existing domain for that function.
> >
> > My guess is that all the functions are behind a PCI to PCI bridge, so the alias
> > lookup is finding a conflict.
>
> Yes, it's behind a PCI-PCI bridge I think, here's the blurb from an
> earlier email:

Sorry, I missed that in your original mail, thanks for reposting.

> cat /proc/interruts
> http://pastebin.com/LQdB3hms
>
> lspci -vvv
> http://pastebin.com/GJDkC8B4

00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge (rev 40)

> lspci -t -v
> http://pastebin.com/Ftx8Hfjt

Yup, that's what I expected:

+-14.4-[08]--+-06.0 VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
| +-06.1 VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
| +-06.2 VIA Technologies, Inc. USB 2.0
| \-0e.0 Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller

I'd now expect to see (if you boot with amd_iommu_dump) some IVRS
details showing an alias range entry basically showing 08:* pointing
back to 00:14.4. This means that from the point of view of the IOMMU the
devices 08:06.0, 08:06.1, 08:06.2, 08:0e.0 will all show up as if they
are 00:14.4.

When you assign a device to a guest, the guest VM gets an IOMMU domain
(a context to manage IOMMU page table mappings) and the device is put
into that guest's IOMMU domain. However, if the device is behind a
PCI-PCI bridge it will appear as an alias for the bridge itself. The
bridge is a PCI device with an IOMMU domain. When trying to assign a
device to a guest there's some sanity checking to verify that the device
(or its alias) aren't already under some IOMMU domain other than the
guest VM's IOMMU domain.

I suspect this is what you are hitting. You could test this theory by
adding 2 more devices to your guest -- the firewire device (08:0e.0)
and the PCI-PCI bridge itself (00:14.4).

thanks,
-chris