From: Alex Williamson Date: Tue, 24 May 2011 11:02:41 +0000 (+0100) Subject: intel-iommu: Flush unmaps at domain_exit X-Git-Tag: v2.6.39.2~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a58f19eeb2ed09582f482e9ecdc6438ee6a28f0a;p=thirdparty%2Fkernel%2Fstable.git intel-iommu: Flush unmaps at domain_exit commit 7b668357810ecb5fdda4418689d50f5d95aea6a8 upstream. We typically batch unmaps to be lazily flushed out at regular intervals. When we destroy a domain, we need to force a flush of these lazy unmaps to be sure none reference the domain we're about to free. Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=35062 Signed-off-by: Alex Williamson Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index d552d2c778443..b04f84e441532 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -1416,6 +1416,10 @@ static void domain_exit(struct dmar_domain *domain) if (!domain) return; + /* Flush any lazy unmaps that may reference this domain */ + if (!intel_iommu_strict) + flush_unmaps_timeout(0); + domain_remove_dev_info(domain); /* destroy iovas */ put_iova_domain(&domain->iovad);