mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] iommu/amd: Optimize IRT cache invalidation for nested VM workloads
@ 2026-11-13  9:50 Guanghui Feng
  2026-11-13  9:50 ` [PATCH 1/2] iommu/amd: Skip device lookup when IRT caching is disabled Guanghui Feng
  2026-11-13  9:50 ` [PATCH 2/2] iommu/amd: Reuse device data for IRTE cache invalidation Guanghui Feng
  0 siblings, 2 replies; 3+ messages in thread
From: Guanghui Feng @ 2026-11-13  9:50 UTC (permalink / raw)
  To: joro, vasant.hegde, suravee.suthikulpanit, will, robin.murphy
  Cc: iommu, linux-kernel

This series optimizes the AMD IOMMU interrupt remapping table (IRT)
cache invalidation path for nested virtualization workloads.

When IOMMU AVIC is enabled, every nested VM entry/exit that switches
interrupt routes between guest and remapping modes calls into
iommu_flush_irt_and_complete().  A reported workload with 4334 device
entries shows median lookup latencies of 22-33 us per invocation due
to a linear search_dev_data() walk, even when IRT caching is disabled
and the lookup result is unused.

Patch 1 moves the device lookup after the irtcachedis_enabled early
return, eliminating the unnecessary walk when IRT caching is off.

Patch 2 caches the device data pointer (resolved at IRQ allocation
time) in struct amd_ir_data and threads it through all IRTE update
paths: guest-mode toggle, affinity change, IRQ enable/disable, and
IRTE free.  The amd_irte_ops interface is extended to carry the
pointer, eliminating all search_dev_data() calls at runtime.

Both patches preserve DMA-alias invalidation, command ordering,
locking, and completion-wait semantics when IRT caching is enabled.

Guanghui Feng (2):
  iommu/amd: Skip device lookup when IRT caching is disabled
  iommu/amd: Reuse device data for IRTE cache invalidation

 drivers/iommu/amd/amd_iommu_types.h | 10 ++--
 drivers/iommu/amd/iommu.c           | 73 ++++++++++++++++-------------
 2 files changed, 48 insertions(+), 35 deletions(-)

-- 
2.43.7


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

end of thread, other threads:[~2026-11-13  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13  9:50 [PATCH 0/2] iommu/amd: Optimize IRT cache invalidation for nested VM workloads Guanghui Feng
2026-11-13  9:50 ` [PATCH 1/2] iommu/amd: Skip device lookup when IRT caching is disabled Guanghui Feng
2026-11-13  9:50 ` [PATCH 2/2] iommu/amd: Reuse device data for IRTE cache invalidation Guanghui Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®