From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wright Subject: Re: PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2 Date: Tue, 22 Feb 2011 16:11:03 -0800 Message-ID: <20110223001103.GZ9869@sequoia.sous-sol.org> References: <20110207132641.GD2665@redhat.com> <1297705728.14733.50.camel@x201> <1298322078.5764.45.camel@x201> <20110222015119.GY9869@sequoia.sous-sol.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Chris Wright , Alex Williamson , kvm@vger.kernel.org, "Roedel, Joerg" To: James Neave Return-path: Received: from sous-sol.org ([216.99.217.87]:35504 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754924Ab1BWALX (ORCPT ); Tue, 22 Feb 2011 19:11:23 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: * James Neave (roboj1m@gmail.com) wrote: > On Tue, Feb 22, 2011 at 1:51 AM, Chris Wright 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