linux/drivers/iommu/amd
Ankit Soni 5000ce7fcb iommu/amd: serialize sequence allocation under concurrent TLB invalidations
[ Upstream commit 9e249c4841 ]

With concurrent TLB invalidations, completion wait randomly gets timed out
because cmd_sem_val was incremented outside the IOMMU spinlock, allowing
CMD_COMPL_WAIT commands to be queued out of sequence and breaking the
ordering assumption in wait_on_sem().
Move the cmd_sem_val increment under iommu->lock so completion sequence
allocation is serialized with command queuing.
And remove the unnecessary return.

Fixes: d2a0cac105 ("iommu/amd: move wait_on_sem() out of spinlock")

Tested-by: Srikanth Aithal <sraithal@amd.com>
Reported-by: Srikanth Aithal <sraithal@amd.com>
Signed-off-by: Ankit Soni <Ankit.Soni@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-04 07:20:43 -05:00
..
amd_iommu.h iommu/amd: Use core's primary handler and set IRQF_ONESHOT 2026-02-26 14:59:05 -08:00
amd_iommu_types.h iommu/amd: serialize sequence allocation under concurrent TLB invalidations 2026-03-04 07:20:43 -05:00
debugfs.c iommu/amd: Fix potential out-of-bounds read in iommu_mmio_show 2025-12-18 14:02:49 +01:00
init.c iommu/amd: serialize sequence allocation under concurrent TLB invalidations 2026-03-04 07:20:43 -05:00
io_pgtable.c iommu/amd/pgtbl: Fix possible race while increase page table level 2025-09-19 09:39:40 +02:00
io_pgtable_v2.c iommu/pages: Remove iommu_alloc_page_node() 2025-04-17 16:22:51 +02:00
iommu.c iommu/amd: serialize sequence allocation under concurrent TLB invalidations 2026-03-04 07:20:43 -05:00
Kconfig iommu/amd: Convert to msi_create_parent_irq_domain() helper 2025-07-04 10:28:10 +02:00
Makefile iommu: make inclusion of amd directory conditional 2025-05-16 08:46:46 +02:00
pasid.c iommu/amd: Consolidate protection domain free code 2025-03-10 09:27:11 +01:00
ppr.c iommu/pages: Remove the order argument to iommu_free_pages() 2025-04-17 16:22:33 +02:00
quirks.c iommu/amd: Include PCI segment ID when initialize IOMMU 2022-07-07 09:37:51 +02:00