From: Roger Pau Monné Date: Fri, 30 Nov 2018 11:10:00 +0000 (+0100) Subject: amd/iommu: skip host bridge devices when updating IOMMU page tables X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fad6ba64a8c98bebb9374f390cc255fac05237ab;p=people%2Froyger%2Fxen.git amd/iommu: skip host bridge devices when updating IOMMU page tables 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é Acked-by: Brian Woods --- diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c index 0ac3f473b3..4ff05e4bdc 100644 --- a/xen/drivers/passthrough/amd/iommu_map.c +++ b/xen/drivers/passthrough/amd/iommu_map.c @@ -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 )