diff mbox series

AMD/IOMMU: don't "add" IOMMUs

Message ID 5CF544330200007800234BAB@prv1-mh.provo.novell.com (mailing list archive)
State Superseded
Headers show
Series AMD/IOMMU: don't "add" IOMMUs | expand

Commit Message

Jan Beulich June 3, 2019, 4 p.m. UTC
While amd_iommu_add_device() won't be called for IOMMUs from
pci_add_device(), as IOMMUs have got marked r/o,
_setup_hwdom_pci_devices() calls there nevertheless. Avoid issuing the
bogus debugging only "No iommu for ...; cannot be handed to ..." log
message as well as the non-debugging "setup ... for ... failed (-19)"
one.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -424,6 +424,11 @@  static int amd_iommu_add_device(u8 devfn
         return -EINVAL;
 
     bdf = PCI_BDF2(pdev->bus, pdev->devfn);
+
+    for_each_amd_iommu(iommu)
+        if ( pdev->seg == iommu->seg && bdf == iommu->bdf )
+            return 0;
+
     iommu = find_iommu_for_device(pdev->seg, bdf);
     if ( unlikely(!iommu) )
     {