Skip to content

Commit 8b02520

Browse files
committed
Merge tag 'iommu-fixes-v7.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux
Pull IOMMU fix from Will Deacon: - Fix regression introduced by the empty MMU gather fix in -rc7, where the ->iotlb_sync() callback can be elided incorrectly, resulting in boot failures (hangs), crashes and potential memory corruption. * tag 'iommu-fixes-v7.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux: iommu: Ensure .iotlb_sync is called correctly
2 parents acfa7a3 + 7e05485 commit 8b02520

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/iommu/iommu.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,6 +2717,12 @@ static size_t __iommu_unmap(struct iommu_domain *domain,
27172717

27182718
pr_debug("unmapped: iova 0x%lx size 0x%zx\n",
27192719
iova, unmapped_page);
2720+
/*
2721+
* If the driver itself isn't using the gather, make sure
2722+
* it looks non-empty so iotlb_sync will still be called.
2723+
*/
2724+
if (iotlb_gather->start >= iotlb_gather->end)
2725+
iommu_iotlb_gather_add_range(iotlb_gather, iova, size);
27202726

27212727
iova += unmapped_page;
27222728
unmapped += unmapped_page;

0 commit comments

Comments
 (0)