Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Support non-leaf and range invalidation features in RISC-V
@ 2026-05-08 14:52 Jason Gunthorpe
  2026-05-08 14:53 ` [PATCH v2 1/8] iommu: Split the kdoc comment for struct iommu_iotlb_gather Jason Gunthorpe
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Jason Gunthorpe @ 2026-05-08 14:52 UTC (permalink / raw)
  To: Alexandre Ghiti, Albert Ou, iommu, Joerg Roedel, linux-riscv,
	Palmer Dabbelt, Paul Walmsley, Robin Murphy, Tomasz Jeznach,
	Will Deacon
  Cc: Andrew Jones, 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/

v2:
 - Add a patch to add the dword number to the CMD macros
 - Correct the IOTINVAL_S position to be in dword 1
v1: https://lore.kernel.org/all/0-v1-54e7264d71b4+17cc3-iommu_riscv_inv_jgg@nvidia.com/

Jason Gunthorpe (8):
  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: Include the dword number in RISCV_IOMMU_CMD macros
  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             | 123 ++++++++------
 drivers/iommu/riscv/iommu.c                  | 160 ++++++++++++++-----
 include/linux/generic_pt/common.h            |   5 +
 include/linux/iommu.h                        |  42 ++++-
 6 files changed, 309 insertions(+), 123 deletions(-)


base-commit: 83ff8144b661ec00d997d78a43987f974cc5792a
-- 
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] 13+ messages in thread

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

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 14:52 [PATCH v2 0/8] Support non-leaf and range invalidation features in RISC-V Jason Gunthorpe
2026-05-08 14:53 ` [PATCH v2 1/8] iommu: Split the kdoc comment for struct iommu_iotlb_gather Jason Gunthorpe
2026-05-08 20:24   ` Pranjal Shrivastava
2026-05-08 14:53 ` [PATCH v2 2/8] iommupt: Add struct iommupt_pending_gather Jason Gunthorpe
2026-05-08 20:26   ` Pranjal Shrivastava
2026-05-08 14:53 ` [PATCH v2 3/8] iommupt: Add PT_FEAT_DETAILED_GATHER Jason Gunthorpe
2026-05-08 20:35   ` Pranjal Shrivastava
2026-05-08 14:53 ` [PATCH v2 4/8] iommu/riscv: Enable PT_FEAT_DETAILED_GATHER and pass gather to iotlb_inval Jason Gunthorpe
2026-05-08 14:53 ` [PATCH v2 5/8] iommu/riscv: Compute best stride for single invalidation Jason Gunthorpe
2026-05-08 14:53 ` [PATCH v2 6/8] iommu/riscv: Add RISCV_IOMMU_CAPABILITIES_NL Jason Gunthorpe
2026-05-08 14:53 ` [PATCH v2 7/8] iommu/riscv: Include the dword number in RISCV_IOMMU_CMD macros Jason Gunthorpe
2026-05-08 14:53 ` [PATCH v2 8/8] iommu/riscv: Add NAPOT range invalidation support Jason Gunthorpe
2026-05-09 20:39 ` [PATCH v2 0/8] Support non-leaf and range invalidation features in RISC-V Andrew Jones

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