All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 0/3] iommu/amd: make iommu_completion_wait() wait for flushes queued by other CPUs
@ 2026-11-10 19:18 Denis V. Lunev
  2026-11-10 19:18 ` [Devel] [PATCH hci-8.1 1/3] ms/iommu/amd: move wait_on_sem() out of spinlock Denis V. Lunev
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Denis V. Lunev @ 2026-11-10 19:18 UTC (permalink / raw)
  To: khorenko; +Cc: devel

iommu_completion_wait() checks iommu->need_sync without iommu->lock and
returns at once when it is clear. A completion wait queued by another
CPU clears the flag before the IOMMU has executed the commands in front
of it, so the caller can return while its own invalidations are still
pending. After an unmap that lets an IOVA or a page table page be
reused while the IOMMU may still hold the old translation. It also
leaves a hole in "iommu/amd/pgtbl: fix DMA faults on IOVAs mapped while
the table grows": the DTE flush done before the new page table level is
published can return before the IOMMU has dropped the old DTE.

Patch 3 is the mainline fix 1e75a8255f11c. It waits for the last
allocated completion sequence number, which relies on the model
introduced by patches 1 and 2, also from mainline: the wait moves out of
iommu->lock and the sequence number is allocated under it. vz10 still
had the old model, an atomic increment outside the lock and the wait
under it. 6.12.y carries the same three commits. Patch 2 needed a
context fix only: vz10 has no cmd_sem_paddr in struct amd_iommu.

Tested on epyc06 (EPYC 7352, four Optane in one IOMMU group) with the
VSTOR-154276 reproducer: an out-of-tree module exhausts the group's
32-bit IOVA space while fio reads the drives, and a kprobe holds the DTE
update open for 5 ms. The stock 8.0 kernel gives IO_PAGE_FAULTs and fio
verify mismatches with no I/O error. 22.19 with the VSTOR-154276 fix and
this series gives no faults, no mismatches and no completion wait
timeouts.

https://virtuozzo.atlassian.net/browse/VSTOR-154424

Ankit Soni (2):
  ms/iommu/amd: move wait_on_sem() out of spinlock
  ms/iommu/amd: serialize sequence allocation under concurrent TLB
    invalidations

Guanghui Feng (1):
  ms/iommu/amd: Wait for completion instead of returning early in
    iommu_completion_wait()

 drivers/iommu/amd/amd_iommu_types.h |  2 +-
 drivers/iommu/amd/init.c            |  2 +-
 drivers/iommu/amd/iommu.c           | 61 ++++++++++++++++++++---------
 3 files changed, 45 insertions(+), 20 deletions(-)

-- 
2.53.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-12 12:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 19:18 [Devel] [PATCH hci-8.1 0/3] iommu/amd: make iommu_completion_wait() wait for flushes queued by other CPUs Denis V. Lunev
2026-11-10 19:18 ` [Devel] [PATCH hci-8.1 1/3] ms/iommu/amd: move wait_on_sem() out of spinlock Denis V. Lunev
2026-11-10 19:23   ` no-reply
2026-11-10 19:18 ` [Devel] [PATCH hci-8.1 2/3] ms/iommu/amd: serialize sequence allocation under concurrent TLB invalidations Denis V. Lunev
2026-11-10 19:22   ` no-reply
2026-11-10 19:18 ` [Devel] [PATCH hci-8.1 3/3] ms/iommu/amd: Wait for completion instead of returning early in iommu_completion_wait() Denis V. Lunev
2026-11-10 19:24   ` no-reply
2026-11-12 12:40 ` [Devel] [PATCH hci-8.1 0/3] iommu/amd: make iommu_completion_wait() wait for flushes queued by other CPUs Konstantin Khorenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.