[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Broken PCI device passthrough, after XSA-302 fix?



On 04.01.2020 02:07, Marek Marczykowski-Górecki  wrote:
> I have a multi-function PCI device, behind a PCI bridge, that normally
> I assign to a single domain. But now it fails with:
> 
> (XEN) [VT-D]d14: 0000:04:00.0 owned by d0!<G><0>assign 0000:05:00.0 to dom14 
> failed (-22)

I've tried this out in as close a setup as I could arrange for, but
not one matching your scenario. I didn't find a system with a
suitably placed (in the topology) multi-function device (had to use
a single-function one), and of course I did this on (close to)
master. No anomalies. Hence I wonder whether either of the two
differences mentioned matters, and - if, as I suspect, it's the
multi-function aspect that is relevant here - how things would have
worked at all before those recent changes. This is because I think
you should have hit the same error path even before, and it would
seem to me that the patch below might be (and have been) needed.

Jan

--- unstable.orig/xen/drivers/passthrough/vtd/iommu.c
+++ unstable/xen/drivers/passthrough/vtd/iommu.c
@@ -1505,7 +1505,7 @@ static int domain_context_mapping(struct
             break;
 
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
-                                         pci_get_pdev(seg, bus, devfn));
+                                         NULL);
 
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1515,7 +1515,7 @@ static int domain_context_mapping(struct
         if ( !ret && pdev_type(seg, bus, devfn) == DEV_TYPE_PCIe2PCI_BRIDGE &&
              (secbus != pdev->bus || pdev->devfn != 0) )
             ret = domain_context_mapping_one(domain, drhd->iommu, secbus, 0,
-                                             pci_get_pdev(seg, secbus, 0));
+                                             NULL);
 
         break;
 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.