]> git.ipfire.org Git - thirdparty/linux.git/commit
iommu/arm-smmu-v3: Add a missing dma_wmb() for hitless STE update
authorNicolin Chen <nicolinc@nvidia.com>
Tue, 17 Mar 2026 07:59:16 +0000 (00:59 -0700)
committerWill Deacon <will@kernel.org>
Thu, 19 Mar 2026 15:08:21 +0000 (15:08 +0000)
commit6fabce53f6b9c2419012a9103e1a46d40888cefa
treee11e3537185ad4858dae346a9c70cc2471f3d1bc
parentf338e77383789c0cae23ca3d48adcc5e9e137e3c
iommu/arm-smmu-v3: Add a missing dma_wmb() for hitless STE update

When writing a new (previously invalid) valid IOPTE to a page table, then
installing the page table into an STE hitlesslessly (e.g. in S2TTB field),
there is a window before an STE invalidation, where the page-table may be
accessed by SMMU but the new IOPTE is still siting in the CPU cache.

This could occur when we allocate an iommu_domain and immediately install
it hitlessly, while there would be no dma_wmb() for the page table memory
prior to the earliest point of HW reading the STE.

Fix it by adding a dma_wmb() prior to updating the STE.

Fixes: 56e1a4cc2588 ("iommu/arm-smmu-v3: Add unit tests for arm_smmu_write_entry")
Cc: stable@vger.kernel.org
Reported-by: Will Deacon <will@kernel.org>
Closes: https://lore.kernel.org/linux-iommu/aXdlnLLFUBwjT0V5@willie-the-truck/
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c