From d15a9c9a05d5a33a323f6584d91bc693fd3c0338 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 5 Apr 2022 15:41:05 +0200 Subject: [PATCH] IOMMU/x86: drop TLB flushes from quarantine_init() hooks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The page tables just created aren't hooked up yet anywhere, so there's nothing that could be present in any TLB, and hence nothing to flush. Dropping this flush is, at least on the VT-d side, a prereq to per- device domain ID use when quarantining devices, as dom_io isn't going to be assigned a DID anymore: The warning in get_iommu_did() would trigger. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Reviewed-by: Roger Pau Monné Reviewed-by: Kevin Tian master commit: 54c5cef49239e2f27ec3b3fc8804bf57aa4bf46d master date: 2022-04-05 14:19:42 +0200 --- xen/drivers/passthrough/amd/iommu_map.c | 2 -- xen/drivers/passthrough/vtd/iommu.c | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c index 2986ae5fc9..0b619e235e 100644 --- a/xen/drivers/passthrough/amd/iommu_map.c +++ b/xen/drivers/passthrough/amd/iommu_map.c @@ -840,8 +840,6 @@ int __init amd_iommu_quarantine_init(struct domain *d) out: spin_unlock(&hd->arch.mapping_lock); - amd_iommu_flush_all_pages(d); - /* Pages leaked in failure case */ return level ? -ENOMEM : 0; } diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 7c09ef77ed..b0918643b3 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -2858,7 +2858,6 @@ static int __init intel_iommu_quarantine_init(struct domain *d) struct dma_pte *parent; unsigned int agaw = width_to_agaw(DEFAULT_DOMAIN_ADDRESS_WIDTH); unsigned int level = agaw_to_level(agaw); - int rc; if ( hd->arch.pgd_maddr ) { @@ -2905,10 +2904,8 @@ static int __init intel_iommu_quarantine_init(struct domain *d) out: spin_unlock(&hd->arch.mapping_lock); - rc = iommu_flush_iotlb_all(d); - /* Pages leaked in failure case */ - return level ? -ENOMEM : rc; + return level ? -ENOMEM : 0; } const struct iommu_ops __initconstrel intel_iommu_ops = { -- 2.39.5