public inbox for iommu@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Let iommupt manage changes in page size internally
@ 2026-01-12 14:49 Jason Gunthorpe
  2026-01-12 14:49 ` [PATCH 1/3] iommupt: Make pt_feature() always_inline Jason Gunthorpe
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jason Gunthorpe @ 2026-01-12 14:49 UTC (permalink / raw)
  To: iommu, Joerg Roedel, Robin Murphy, Will Deacon
  Cc: Alejandro Jimenez, Joerg Roedel, Kevin Tian, kernel test robot,
	Pasha Tatashin, 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.

Jason Gunthorpe (3):
  iommupt: Make pt_feature() always_inline
  iommupt: Directly call iommupt's unmap_range()
  iommupt: Avoid rewalking during map

 drivers/iommu/generic_pt/iommu_pt.h         | 156 ++++++++++----------
 drivers/iommu/generic_pt/kunit_generic_pt.h |  12 ++
 drivers/iommu/generic_pt/pt_defs.h          |   4 +-
 drivers/iommu/generic_pt/pt_iter.h          |  22 +++
 drivers/iommu/iommu.c                       |  43 +++++-
 include/linux/generic_pt/iommu.h            |  69 +++++++--
 include/linux/iommu.h                       |   1 +
 7 files changed, 213 insertions(+), 94 deletions(-)


base-commit: 0816b0730a71ba553b2000e7ecd6429ee61d9c2c
-- 
2.43.0


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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-12 14:49 [PATCH 0/3] Let iommupt manage changes in page size internally Jason Gunthorpe
2026-01-12 14:49 ` [PATCH 1/3] iommupt: Make pt_feature() always_inline Jason Gunthorpe
2026-01-14  8:15   ` Tian, Kevin
2026-01-12 14:49 ` [PATCH 2/3] iommupt: Directly call iommupt's unmap_range() Jason Gunthorpe
2026-01-15  6:17   ` Tian, Kevin
2026-01-15 18:26   ` Samiullah Khawaja
2026-01-12 14:49 ` [PATCH 3/3] iommupt: Avoid rewalking during map Jason Gunthorpe
2026-01-15  4:12   ` Samiullah Khawaja
2026-01-19 23:40     ` Jason Gunthorpe
2026-01-15  6:44   ` Tian, Kevin
2026-01-19 23:30     ` Jason Gunthorpe
2026-01-18  9:47 ` [PATCH 0/3] Let iommupt manage changes in page size internally Joerg Roedel

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