Skip to contentSkip to conversation

iommu/amd-vi: avoid pointless flushes in invalidate_all_domain_pages()

PATCH In review Roger Pau Monne 2 participants 2 messages Jul 7, 2023 – Jul 10, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/amd-vi: avoid pointless flushes in invalidate_all_domain_pages()

Fix invalidate_all_domain_pages() to only attempt to flush the domains that have IOMMU enabled, otherwise the flush is pointless.

---
 xen/drivers/passthrough/amd/iommu_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
xen/drivers/passthrough/amd/iommu_init.c +3 -1
index 7dbd7e7d094a..af6713d2fc02 100644
@@ -1532,8 +1532,10 @@ int __init amd_iommu_init_late(void)
 static void invalidate_all_domain_pages(void)
 {
     struct domain *d;
+
     for_each_domain( d )
-        amd_iommu_flush_all_pages(d);
+        if ( is_iommu_enabled(d) )
+            amd_iommu_flush_all_pages(d);
 }
 
 static int cf_check _invalidate_all_devices(
Signature · 1 line
2.41.0