Archive-only list for patches
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Improve the invalidation path in AMD
@ 2026-05-14  0:11 Jason Gunthorpe
  2026-05-14  0:11 ` [PATCH v3 1/5] iommu/amd: Simplify build_inv_address() Jason Gunthorpe
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Jason Gunthorpe @ 2026-05-14  0:11 UTC (permalink / raw)
  To: iommu, Joerg Roedel, Robin Murphy, Suravee Suthikulpanit,
	Will Deacon
  Cc: patches, Wei Wang

Auditing this path reveals some unnecessary complexity and some
confusion around end/size/last and types that may cause issues at the
ULONG_MAX limit.

First, fix up the call chains so that the gather start/last is
retained faithfully throughout. This avoids converting to a
start/size, and avoids various type conversions along this path. Fix
everything so the theoretical cases like start=0 last=U64_MAX work
correctly.

Simplify all the calculations for alignment/etc to use trivial bit
maths instead of the complicated versions. These are all intended to
be no functional change.

Finally, add support for PDE=0, deriving it from the gather. PDE=0
allows the HW to avoid scanning the page directory cache and
supporting it should improve performance.

v3:
 - Rebase to v7.1-rc1
 - Revise comments
v2: https://patch.msgid.link/r/0-v2-90ddd19c0894+13561-iommupt_inv_amd_jgg@nvidia.com
 - Use start instead of address
v1: https://patch.msgid.link/r/0-v1-a7b77c25974e+115bf-iommupt_inv_amd_jgg@nvidia.com

Jason Gunthorpe (5):
  iommu/amd: Simplify build_inv_address()
  iommu/amd: Pass last in through to build_inv_address()
  iommu/amd: Have amd_iommu_domain_flush_pages() use last
  iommu/amd: Make CMD_INV_IOMMU_ALL_PAGES_ADDRESS match the spec
  iommu/amd: Control INVALIDATE_IOMMU_PAGES PDE from the gather

 drivers/iommu/amd/amd_iommu.h       |   4 +-
 drivers/iommu/amd/amd_iommu_types.h |   2 +-
 drivers/iommu/amd/iommu.c           | 176 +++++++++++++---------------
 drivers/iommu/amd/pasid.c           |   2 +-
 4 files changed, 87 insertions(+), 97 deletions(-)


base-commit: 255c710c89f92be8db1322c992600c1663eafda3
-- 
2.43.0


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

end of thread, other threads:[~2026-05-28  7:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14  0:11 [PATCH v3 0/5] Improve the invalidation path in AMD Jason Gunthorpe
2026-05-14  0:11 ` [PATCH v3 1/5] iommu/amd: Simplify build_inv_address() Jason Gunthorpe
2026-05-14  0:11 ` [PATCH v3 2/5] iommu/amd: Pass last in through to build_inv_address() Jason Gunthorpe
2026-05-14  0:11 ` [PATCH v3 3/5] iommu/amd: Have amd_iommu_domain_flush_pages() use last Jason Gunthorpe
2026-05-14  0:11 ` [PATCH v3 4/5] iommu/amd: Make CMD_INV_IOMMU_ALL_PAGES_ADDRESS match the spec Jason Gunthorpe
2026-05-14  0:11 ` [PATCH v3 5/5] iommu/amd: Control INVALIDATE_IOMMU_PAGES PDE from the gather Jason Gunthorpe
2026-05-28  7:42 ` [PATCH v3 0/5] Improve the invalidation path in AMD Joerg Roedel

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