Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Support non-leaf and range invalidation features in RISC-V
@ 2026-04-10 15:57 Jason Gunthorpe
  2026-04-10 15:57 ` [PATCH 1/7] iommu: Split the kdoc comment for struct iommu_iotlb_gather Jason Gunthorpe
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Jason Gunthorpe @ 2026-04-10 15:57 UTC (permalink / raw)
  To: Alexandre Ghiti, Albert Ou, iommu, Joerg Roedel, linux-riscv,
	Palmer Dabbelt, Paul Walmsley, Robin Murphy, Tomasz Jeznach,
	Will Deacon
  Cc: Fangyu Yu, patches

This is part of the patch pile to get SMMUv3 moved to iommupt. From
that perspective it introduces the PT_FEAT_DETAILED_GATHER which will
be used by both RISC-V and SMMUv3 to generate optimized invalidation
commands.

I don't have any RISC-V anything so this needs to be tested by someone who
does.

Improve the invalidation flow in RISC-V:
 - For single address invalidation, compute a stride based on what
   IOPTEs were changed by having the gather track level changes in
   bitmaps. This allows things like unmapping hugetlb-backed mappings
   to avoid jumping to global invalidation.

 - Support the NL bit to avoid global invalidation when table
   structure is changed

 - Support the S range invalidation feature to convert any gather
   into a single invalidation command using an aligned power-of-2
   size like AMD and VT-d.

This is also a requirement for the kunit iotlb series, which was used
to test the math used to generate the invalidation commands from the
gather in this series.

It replaces a similar series Fangyu sent prior to the iommupt
conversion:

https://lore.kernel.org/linux-iommu/20260208144213.94856-1-fangyu.yu@linux.alibaba.com/

The full patch pile is here:

https://github.com/jgunthorpe/linux/commits/iommu_pt_arm64/

Jason Gunthorpe (7):
  iommu: Split the kdoc comment for struct iommu_iotlb_gather
  iommupt: Add struct iommupt_pending_gather
  iommupt: Add PT_FEAT_DETAILED_GATHER
  iommu/riscv: Enable PT_FEAT_DETAILED_GATHER and pass gather to
    iotlb_inval
  iommu/riscv: Compute best stride for single invalidation
  iommu/riscv: Add RISCV_IOMMU_CAPABILITIES_NL
  iommu/riscv: Add NAPOT range invalidation support

 drivers/iommu/generic_pt/fmt/iommu_riscv64.c |   4 +-
 drivers/iommu/generic_pt/iommu_pt.h          |  98 ++++++++----
 drivers/iommu/riscv/iommu-bits.h             |  24 +++
 drivers/iommu/riscv/iommu.c                  | 160 ++++++++++++++-----
 include/linux/generic_pt/common.h            |   5 +
 include/linux/iommu.h                        |  42 ++++-
 6 files changed, 259 insertions(+), 74 deletions(-)


base-commit: ac81c0f2e6a779e444c5b6fd43756ef811656098
-- 
2.43.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

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

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 15:57 [PATCH 0/7] Support non-leaf and range invalidation features in RISC-V Jason Gunthorpe
2026-04-10 15:57 ` [PATCH 1/7] iommu: Split the kdoc comment for struct iommu_iotlb_gather Jason Gunthorpe
2026-04-10 15:57 ` [PATCH 2/7] iommupt: Add struct iommupt_pending_gather Jason Gunthorpe
2026-04-10 15:57 ` [PATCH 3/7] iommupt: Add PT_FEAT_DETAILED_GATHER Jason Gunthorpe
2026-04-10 15:57 ` [PATCH 4/7] iommu/riscv: Enable PT_FEAT_DETAILED_GATHER and pass gather to iotlb_inval Jason Gunthorpe
2026-05-05 16:33   ` Tomasz Jeznach
2026-04-10 15:57 ` [PATCH 5/7] iommu/riscv: Compute best stride for single invalidation Jason Gunthorpe
2026-05-05 16:34   ` Tomasz Jeznach
2026-04-10 15:57 ` [PATCH 6/7] iommu/riscv: Add RISCV_IOMMU_CAPABILITIES_NL Jason Gunthorpe
2026-05-05 16:35   ` Tomasz Jeznach
2026-04-10 15:57 ` [PATCH 7/7] iommu/riscv: Add NAPOT range invalidation support Jason Gunthorpe
2026-05-05 16:36   ` Tomasz Jeznach
2026-05-05 22:47   ` Andrew Jones
2026-05-05 23:17     ` Tomasz Jeznach
2026-05-06  9:13     ` Jason Gunthorpe
2026-05-05 16:31 ` [PATCH 0/7] Support non-leaf and range invalidation features in RISC-V Tomasz Jeznach

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