[PW_SID:1075400] iommu: Always fill in gather when unmapping#1700
[PW_SID:1075400] iommu: Always fill in gather when unmapping#1700linux-riscv-bot wants to merge 1 commit into
Conversation
The fixed commit assumed that the gather would always be populated if an iotlb_sync was required. arm-smmu-v3, amd, VT-d, riscv, s390, mtk all use information from the gather during their iotlb_sync() and this approach works for them. However, arm-smmu, qcom_iommu, ipmmu-vmsa, sun50i, sprd, virtio, apple-dart all ignore the gather during their iotlb_sync(). They mostly issue a full flush. Unfortunately the latter set of drivers often don't bother to add anything to the gather since they don't intend on using it. Since the core code now blocks gathers that were never filled, this caused those drivers to stop getting their iotlb_sync() calls and breaks them. Since it is impossible to tell the difference between gathers that are empty because there is nothing to do and gathers that are empty because they are not used, fill in the gathers for the missing cases. io-pgtable might have intended to allow the driver to choose between gather or immediate flush because it passed gather to ops->tlb_add_page(), however no driver does anything with it. mtk uses io-pgtable-arm-v7s but added the range to the gather in the unmap callback. Move this into the io-pgtable-arm unmap itself. That will fix all the armv7 using drivers (arm-smmu, qcom_iommu, ipmmu-vmsa). arm-smmu uses both ARM_V7S and ARM LPAE formats. The LPAE formats already have the gather population because SMMUv3 requires it, so it becomes consistent. Add a trivial gather population to io-pgtable-dart. Add trivial populations to sprd, sun50i and virtio-iommu in their unmap functions. Fixes: 90c5def ("iommu: Do not call drivers for empty gathers") Reported-by: Jon Hunter <jonathanh@nvidia.com> Closes: https://lore.kernel.org/r/8800a38b-8515-4bbe-af15-0dae81274bf7@nvidia.com Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
|
Patch 1: "iommu: Always fill in gather when unmapping" |
PR for series 1075400 applied to workflow__riscv__fixes
Name: iommu: Always fill in gather when unmapping
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1075400
Version: 1