public inbox for patches@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 0/5] Improve the invalidation path in AMD
@ 2026-03-27 15:23 Jason Gunthorpe
  2026-03-27 15:23 ` [PATCH 1/5] iommu/amd: Simplify build_inv_address() Jason Gunthorpe
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Jason Gunthorpe @ 2026-03-27 15:23 UTC (permalink / raw)
  To: iommu, Joerg Roedel, Robin Murphy, Suravee Suthikulpanit,
	Will Deacon
  Cc: patches

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.

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           | 175 +++++++++++++---------------
 drivers/iommu/amd/pasid.c           |   2 +-
 4 files changed, 87 insertions(+), 96 deletions(-)


base-commit: 6c8f61b36b7efec0f8bc284142f998d30f0a28ba
-- 
2.43.0


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

end of thread, other threads:[~2026-04-01 19:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27 15:23 [PATCH 0/5] Improve the invalidation path in AMD Jason Gunthorpe
2026-03-27 15:23 ` [PATCH 1/5] iommu/amd: Simplify build_inv_address() Jason Gunthorpe
2026-03-30  7:39   ` Wei Wang
2026-03-30 12:05     ` Jason Gunthorpe
2026-03-31  2:01       ` Wei Wang
2026-03-27 15:23 ` [PATCH 2/5] iommu/amd: Pass last in through to build_inv_address() Jason Gunthorpe
2026-03-30  8:03   ` Wei Wang
2026-04-01 19:55     ` Jason Gunthorpe
2026-03-27 15:23 ` [PATCH 3/5] iommu/amd: Have amd_iommu_domain_flush_pages() use last Jason Gunthorpe
2026-04-01  6:33   ` Wei Wang
2026-03-27 15:23 ` [PATCH 4/5] iommu/amd: Make CMD_INV_IOMMU_ALL_PAGES_ADDRESS match the spec Jason Gunthorpe
2026-04-01  6:42   ` Wei Wang
2026-04-01 13:17     ` Jason Gunthorpe
2026-03-27 15:23 ` [PATCH 5/5] iommu/amd: Control INVALIDATE_IOMMU_PAGES PDE from the gather Jason Gunthorpe
2026-04-01  8:51   ` Wei Wang

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