]> xenbits.xensource.com Git - xen.git/commitdiff
IOMMU/x86: drop TLB flushes from quarantine_init() hooks
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 13:14:15 +0000 (15:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 13:14:15 +0000 (15:14 +0200)
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 <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
master commit: 54c5cef49239e2f27ec3b3fc8804bf57aa4bf46d
master date: 2022-04-05 14:19:42 +0200

xen/drivers/passthrough/amd/iommu_map.c
xen/drivers/passthrough/vtd/iommu.c

index d10dd1ac8e22c21a4210ac60514f16be74a64895..eb38c9a0bf269b6e2ae432e2deab475d4b7c58f6 100644 (file)
@@ -585,8 +585,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;
 }
index 52e9ec38e68a07f36d204ab29aac946019dde747..322c39540363b018fe3b0068d1b4b0a5a0a52c26 100644 (file)
@@ -2914,7 +2914,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 )
     {
@@ -2961,10 +2960,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 = {