From: "Nick Couchman" Subject: Re: PCI Passthrough Problems/Questions Date: Wed, 03 Nov 2010 08:54:57 -0600 Message-ID: <4CD1236102000099000BB068@collaborate.seakr.com> References: <4CC92DE202000099000BAA57@collaborate.seakr.com> <4CCA377C.6020605@intel.com> <4CCAC39702000099000BABCA@collaborate.seakr.com> <4CCF85BF.9070501@intel.com> <4CD00CF802000099000BAF8E@collaborate.seakr.com> <4CD0B466.6000606@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4CD0B466.6000606@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: weidong.han@intel.com Cc: xen-devel@lists.xensource.com, konrad.wilk@Oracle.Com List-Id: xen-devel@lists.xenproject.org I can confirm that Jan's patch fixes the problem! Thanks for the help! -Nick On Wed, 2010-11-03 at 09:01 +0800, Weidong Han wrote: > Nick Couchman wrote: > >>> =20 > >>> =20 > >> The logs look no problem. I'm wondering if the device implies PCI=20 > >> standard. At last, I think you can try: only assign 02:00.0=20 > >> (pci=3D[02:00.0]), or assign them as multiple devices in guest=20 > >> (pci=3D[02:00.0-1]). > >> > >> Regards, > >> Weidong > >> =20 > > > > Should have tried that on my own. Forwarding just 02:00.0 through > > worked just fine! > > > > So, the patch you had me apply to the Xen 4 source - is that a final > > version of the patch, or is there still some work to do to come up wi= th > > a final fix for this? > > > > =20 > The patch is just for your testing. I think Jan's patch should fix the=20 > issue. Jan sent it out in xen-devel mailing list yesterday, I attached=20 > it here, pls try with it. >=20 > Regards, > Weidong > plain text document attachment (vtd-check-secbus-devfn.patch) > If the device at :00.0 is the device the mapping operation was > initiated for, trying to map it a second time will fail, and hence > this second mapping attempt must be prevented (as was done prior to > said c/s). >=20 > Once at it, simplify the code a little, too. >=20 > Signed-off-by: Jan Beulich >=20 > --- a/xen/drivers/passthrough/vtd/iommu.c > +++ b/xen/drivers/passthrough/vtd/iommu.c > @@ -1371,23 +1371,16 @@ static int domain_context_mapping(struct > if ( find_upstream_bridge(&bus, &devfn, &secbus) < 1 ) > break; > =20 > - /* PCIe to PCI/PCIx bridge */ > - if ( pdev_type(bus, devfn) =3D=3D DEV_TYPE_PCIe2PCI_BRIDGE ) > - { > - ret =3D domain_context_mapping_one(domain, drhd->iommu, bu= s, devfn); > - if ( ret ) > - return ret; > + ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, d= evfn); > =20 > - /* > - * Devices behind PCIe-to-PCI/PCIx bridge may generate > - * different requester-id. It may originate from devfn=3D0 > - * on the secondary bus behind the bridge. Map that id > - * as well. > - */ > + /* > + * Devices behind PCIe-to-PCI/PCIx bridge may generate differe= nt > + * requester-id. It may originate from devfn=3D0 on the second= ary bus > + * behind the bridge. Map that id as well if we didn't already= =2E > + */ > + if ( !ret && pdev_type(bus, devfn) =3D=3D DEV_TYPE_PCIe2PCI_BR= IDGE && > + (secbus !=3D pdev->bus || pdev->devfn !=3D 0) ) > ret =3D domain_context_mapping_one(domain, drhd->iommu, se= cbus, 0); > - } > - else /* Legacy PCI bridge */ > - ret =3D domain_context_mapping_one(domain, drhd->iommu, bu= s, devfn); > =20 > break; > =20 --------=0D This e-mail may contain confidential and privileged material for the sole= use of the intended recipient. If this email is not intended for you, o= r you are not responsible for the delivery of this message to the intende= d recipient, please note that this message may contain SEAKR Engineering = (SEAKR) Privileged/Proprietary Information. In such a case, you are stri= ctly prohibited from downloading, photocopying, distributing or otherwise= using this message, its contents or attachments in any way. If you have= received this message in error, please notify us immediately by replying= to this e-mail and delete the message from your mailbox. Information co= ntained in this message that does not relate to the business of SEAKR is = neither endorsed by nor attributable to SEAKR.