Re: [PATCH] iommu/amd: Wait for completion instead of returning early in iommu_completion_wait()
From: Will Deacon
Date: Tue Jul 21 2026 - 08:22:08 EST
On Thu, 16 Jul 2026 22:16:22 +0800, Guanghui Feng wrote:
> need_sync is a per-IOMMU flag shared by all domains and devices behind
> that IOMMU. It is set whenever a command is queued with sync == true and
> cleared when a completion-wait (CWAIT) command is queued. However, a
> cleared need_sync only means that a covering CWAIT has been queued, not
> that all previously queued commands have actually completed in hardware.
>
> iommu_completion_wait() read need_sync locklessly and returned early
> when it was false. This breaks the "block until all previously queued
> commands have completed" contract in a multi-CPU scenario:
>
> [...]
Applied to iommu (fixes), thanks!
[1/1] iommu/amd: Wait for completion instead of returning early in iommu_completion_wait()
https://git.kernel.org/iommu/c/1e75a8255f11
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev