Skip to content

WORKAROUND: iommu/arm-smmu: Work around Qualcomm SMMU-500 TLBIVAL granule issue - #156

Merged
Tingwei Zhang (quic-tingweiz) merged 2 commits into
qualcomm-linux:resolute-qcom-develfrom
ximiali:adsp_kvm
Oct 13, 2026
Merged

Tingwei Zhang (quic-tingweiz) merged 2 commits into
qualcomm-linux:resolute-qcom-develfrom
ximiali:adsp_kvm

Conversation

@ximiali

@ximiali ximiali commented Oct 13, 2026

Copy link
Copy Markdown

Work around Qualcomm SMMU-500 TLBIVAL granule issue on Glymur, Hamoa and Purwa.

…nule issue

Qualcomm SMMU-500 has an issue with TLBIVA/TLBIVAL where only the
base-page-size entry at the base IOVA is invalidated, leaving stale
TLB entries for the rest of the range.

This causes use-after-free: after dma_free_coherent() unmaps a large
buffer, the device can still access freed physical memory through stale
TLB entries. On FastRPC workloads this manifests as ADSP crashes when
the ELF loader writes to a freed PA that has been reallocated.

Force the TLB invalidation step granule to the minimum page size for
all Qualcomm SMMU-500 domains, ensuring each page in the range is
individually invalidated. The minimum page size from pgsize_bitmap is
used rather than hardcoded 4K to correctly handle 16K and 64K granule
configurations.

This increases the number of TLB invalidation operations for large
ranges, but correctness takes precedence.

Signed-off-by: Prakash Gupta <prakash.gupta@oss.qualcomm.com>
Signed-off-by: Sibi Sankar <sibi.sankar@oss.qualcomm.com>
(cherry picked from commit 219d869a96c8fb79ab6c6604eaf61b0656c135ec)
…0100

Add qcom,x1e80100-smmu-500 to the force_min_tlbival_granule check
so that Hamoa and Purwa apps_smmu are also covered.

Signed-off-by: Yushan Li <yushan.li@oss.qualcomm.com>
@quic-tingweiz
Tingwei Zhang (quic-tingweiz) merged commit b20df20 into qualcomm-linux:resolute-qcom-devel Oct 13, 2026
14 of 15 checks passed
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.

3 participants