]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
amd/iommu: skip host bridge devices when updating IOMMU page tables
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 30 Nov 2018 11:10:00 +0000 (12:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 30 Nov 2018 11:10:00 +0000 (12:10 +0100)
Host bridges are not behind an IOMMU, and are already special cased and
skipped in amd_iommu_add_device. Apply the same special casing when
updating page tables.

This is required or else update_paging_mode will fail and return an
error to the caller (amd_iommu_{un}map_page) which will destroy the
domain.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Brian Woods <brian.woods@amd.com>
xen/drivers/passthrough/amd/iommu_map.c

index 0ac3f473b38854859b0ddc94977e2401b5df39fb..4ff05e4bdc4d01ba4086f83530b10f1dae6e7f59 100644 (file)
@@ -616,6 +616,9 @@ static int update_paging_mode(struct domain *d, unsigned long dfn)
         /* Update device table entries using new root table and paging mode */
         for_each_pdev( d, pdev )
         {
+            if ( pdev->type == DEV_TYPE_PCI_HOST_BRIDGE )
+                continue;
+
             bdf = PCI_BDF2(pdev->bus, pdev->devfn);
             iommu = find_iommu_for_device(pdev->seg, bdf);
             if ( !iommu )