]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
amd/iommu: skip bridge devices when updating IOMMU page tables fixes-pvh-v6 gitlab/fixes-pvh-v6
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 20 Nov 2018 15:19:43 +0000 (16:19 +0100)
committerRoger Pau Monne <roger.pau@citrix.com>
Tue, 27 Nov 2018 11:42:20 +0000 (12:42 +0100)
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>
---
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Brian Woods <brian.woods@amd.com>
---
Changes since v5:
 - Remove the hardware domain check.

Changes since v4:
 - Invert condition order so they match the order in
   amd_iommu_add_device.
 - Expand commit message to spell out why this is required.

xen/drivers/passthrough/amd/iommu_map.c

index c1daba8422dd8354d1dc99fa16e359737fd7474c..e4904bb3c50537c399d6db55dabbac0ba5d74a73 100644 (file)
@@ -612,6 +612,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 )