Home Home > GIT Browse > SLE12-SP3
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2018-07-03 14:51:17 +0200
committerJoerg Roedel <jroedel@suse.de>2018-07-03 14:51:17 +0200
commit5db076844a903a5ca433835de8e590b894694abc (patch)
tree757509c60ef70c1b8da1e60699d1c2392ceef632
parentec8518b64bf5793d4baf55f23ca5dcaf88bdd28f (diff)
iommu/vt-d: Fix race condition in add_unmap() (bsc#1096790, bsc#1097034).
-rw-r--r--drivers/iommu/intel-iommu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 6facc7a792b0..53803bcf23ea 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3739,6 +3739,10 @@ static void add_unmap(struct dmar_domain *dom, unsigned long iova_pfn,
spin_lock_irqsave(&flush_data->lock, flags);
+ /* Need to check that again after we own the lock */
+ if (unlikely(flush_data->size == HIGH_WATER_MARK))
+ flush_unmaps(flush_data);
+
iommu = domain_get_iommu(dom);
iommu_id = iommu->seq_id;