intel-iommu: Flush unmaps at domain_exit
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 24 May 2011 11:02:41 +0000 (12:02 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 24 May 2011 12:08:34 +0000 (13:08 +0100)
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 <alex.williamson@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org
drivers/pci/intel-iommu.c

index 4e4e0202e59d863838dfc66ae5ef6d5bbd8e1beb..395f253c0494b641652b0e126adb798ebee0e6df 100644 (file)
@@ -1422,6 +1422,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);