From: "Denis V. Lunev" <den@openvz.org>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 0/3] iommu/amd: make iommu_completion_wait() wait for flushes queued by other CPUs
Date: Tue, 10 Nov 2026 20:18:33 +0100 [thread overview]
Message-ID: <20261110191836.3000352-1-den@openvz.org> (raw)
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
next reply other threads:[~2026-11-10 19:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 19:18 Denis V. Lunev [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110191836.3000352-1-den@openvz.org \
--to=den@openvz.org \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.