Skip to content

[PW_SID:1075400] iommu: Always fill in gather when unmapping#1700

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1075400
Closed

[PW_SID:1075400] iommu: Always fill in gather when unmapping#1700
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1075400

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

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

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>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1103.38 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1606.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.64 seconds
Result: WARNING
Output:

WARNING: Unknown commit id '90c5def10bea', maybe rebased or not pulled?
#43: 
Fixes: 90c5def10bea ("iommu: Do not call drivers for empty gathers")

total: 0 errors, 1 warnings, 0 checks, 50 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 5c93f8d7d66d ("iommu: Always fill in gather when unmapping") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 0 checks, 50 lines checked
WARNING: Unknown commit id '90c5def10bea', maybe rebased or not pulled?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.09 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 1.14 seconds
Result: ERROR
Output:

Commit: 5c93f8d7d66d3 ("iommu: Always fill in gather when unmapping")
	Fixes tag: Fixes: 90c5def10bea ("iommu: Do not call drivers for empty gathers")
	Has these problem(s):
		- Target SHA1 does not exist
Problems with Fixes tag: 1


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "iommu: Always fill in gather when unmapping"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1075400 branch March 31, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants