From fad6ba64a8c98bebb9374f390cc255fac05237ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roger=20Pau=20Monn=C3=A9?= Date: Fri, 30 Nov 2018 12:10:00 +0100 Subject: [PATCH] amd/iommu: skip host bridge devices when updating IOMMU page tables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- xen/drivers/passthrough/amd/iommu_map.c | 3 +++ 1 file changed, 3 insertions(+) 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 ) -- 2.30.2