Archive-only list for patches
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Let iommupt manage changes in page size internally
@ 2026-02-27 19:30 Jason Gunthorpe
  2026-02-27 19:30 ` [PATCH v3 1/2] iommupt: Directly call iommupt's unmap_range() Jason Gunthorpe
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jason Gunthorpe @ 2026-02-27 19:30 UTC (permalink / raw)
  To: iommu, Joerg Roedel, Robin Murphy, Will Deacon
  Cc: Kevin Tian, patches, Samiullah Khawaja

Currently the core code has some helpers that use iommu_pgsize() to
fragment operations into single page-size chunks and then the driver has a
simplified single-page size implementation. This was helpful in
simplifying the driver code.

However, iommupt has a single shared implementation for all formats so we
can accept a little more complexity. Have the core code directly call
iommupt with the requested range to map/unmap and rely on it to change the
page size across the range as required.

The iommupt implementation of unmap is already fine to work like this, and
the map implementation can reset its walking paramters in-place with a
little more code.

The net result is about a 5% performance bump in the simple iommupt
map/unmap benchmarks of mapped alignment, and probably more for
unaligned/oddly sized ranges that are changing page sizes.

Introduce a iommupt_from_domain() function as a general way to convert
an iommu_domain to a struct pt_iommu if it is a iommupt based domain. I
expect to keep using this as more optimizations are introduced.

v3:
 - Rebase to v7.0-rc1
v2: https://patch.msgid.link/r/0-v2-973a6bdc820f+693-iommpt_map_direct_jgg@nvidia.com
 - Rebase to latest iommu tree
 - Adjust to the IOMMU_DEBUG_PAGEALLOC work
 - Fix missed trace calls for both map and unmap
 - Add a comment explaining the level changes
v1: https://patch.msgid.link/r/0-v1-d7be57da596d+3f8c0-iommpt_map_direct_jgg@nvidia.com

Jason Gunthorpe (2):
  iommupt: Directly call iommupt's unmap_range()
  iommupt: Avoid rewalking during map

 drivers/iommu/generic_pt/iommu_pt.h         | 162 +++++++++++---------
 drivers/iommu/generic_pt/kunit_generic_pt.h |  12 ++
 drivers/iommu/generic_pt/pt_iter.h          |  22 +++
 drivers/iommu/iommu.c                       |  66 ++++++--
 include/linux/generic_pt/iommu.h            |  69 +++++++--
 include/linux/iommu.h                       |   1 +
 6 files changed, 231 insertions(+), 101 deletions(-)


base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
-- 
2.43.0


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

end of thread, other threads:[~2026-05-09 23:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 19:30 [PATCH v3 0/2] Let iommupt manage changes in page size internally Jason Gunthorpe
2026-02-27 19:30 ` [PATCH v3 1/2] iommupt: Directly call iommupt's unmap_range() Jason Gunthorpe
2026-02-27 19:30 ` [PATCH v3 2/2] iommupt: Avoid rewalking during map Jason Gunthorpe
2026-05-09 17:41   ` Josua Mayer
2026-05-09 19:40     ` Jason Gunthorpe
2026-05-09 20:25       ` Josua Mayer
2026-05-09 23:39         ` Jason Gunthorpe
2026-03-03  3:55 ` [PATCH v3 0/2] Let iommupt manage changes in page size internally Baolu Lu
2026-03-17 12:58 ` Joerg Roedel

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