Skip to content

Rework IOMMU API to allow for batching of invalidation

Will Deacon linux-iommu 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13iommu: Remove empty iommu_tlb_range_add() callback from iommu_opsdrivers/iommu/amd_iommu.c drivers/iommu/iommu.c drivers/vfio/vfio_iommu_type1.c +1 more+0 -250 replies
2/13iommu/io-pgtable-arm: Remove redundant call to io_pgtable_tlb_sync()drivers/iommu/io-pgtable-arm-v7s.c drivers/iommu/io-pgtable-arm.c+0 -23 replies
3/13iommu/io-pgtable: Rename iommu_gather_ops to iommu_flush_opsdrivers/gpu/drm/panfrost/panfrost_mmu.c drivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c +7 more+20 -200 replies
4/13iommu: Introduce struct iommu_iotlb_gather for batching TLB flushesdrivers/iommu/dma-iommu.c drivers/iommu/iommu.c drivers/vfio/vfio_iommu_type1.c +1 more+75 -220 replies
5/13iommu: Introduce iommu_iotlb_gather_add_page()include/linux/iommu.h+31 -00 replies
6/13iommu: Pass struct iommu_iotlb_gather to ->unmap() and ->iotlb_sync()drivers/iommu/amd_iommu.c drivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c +15 more+73 -330 replies
7/13iommu/io-pgtable: Introduce tlb_flush_walk() and tlb_flush_leaf()include/linux/io-pgtable.h+19 -51 reply
8/13iommu/io-pgtable: Hook up ->tlb_flush_walk() and ->tlb_flush_leaf() in driversdrivers/gpu/drm/panfrost/panfrost_mmu.c drivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c +4 more+116 -00 replies
9/13iommu/io-pgtable-arm: Call ->tlb_flush_walk() and ->tlb_flush_leaf()drivers/iommu/io-pgtable-arm-v7s.c drivers/iommu/io-pgtable-arm.c include/linux/io-pgtable.h+41 -150 replies
10/13iommu/io-pgtable: Replace ->tlb_add_flush() with ->tlb_add_page()drivers/gpu/drm/panfrost/panfrost_mmu.c drivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c +7 more+105 -713 replies
11/13iommu/io-pgtable: Remove unused ->tlb_sync() callbackdrivers/gpu/drm/panfrost/panfrost_mmu.c drivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c +7 more+16 -540 replies
12/13iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->unmap()drivers/gpu/drm/panfrost/panfrost_mmu.c drivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c +7 more+16 -150 replies
13/13iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->tlb_add_page()drivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c drivers/iommu/io-pgtable-arm-v7s.c +5 more+47 -290 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/13] Rework IOMMU API to allow for batching of invalidation

Hi everybody,

These are the core IOMMU changes that I have posted previously as part of my ongoing effort to reduce the lock contention of the SMMUv3 command queue. I thought it would be better to split this out as a separate series, since I think it's ready to go and all the driver conversions mean that it's quite a pain for me to maintain out of tree!

The idea of the patch series is to allow TLB invalidation to be batched up into a new 'struct iommu_iotlb_gather' structure, which tracks the properties of the virtual address range being invalidated so that it can be deferred until the driver's ->iotlb_sync() function is called. This allows for more efficient invalidation on hardware that can submit multiple invalidations in one go.

The previous series was included in:

https://lkml.kernel.org/r/[email protected]

The only real change since then is incorporating the newly merged virtio-iommu driver.

If you'd like to play with the patches, then I've also pushed them here:

https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=iommu/unmap

but they should behave as a no-op on their own. Patches to convert the Arm SMMUv3 driver to the new API are here:

https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=iommu/cmdq

Cheers,

Will

--->8

Cc Jean-Philippe Brucker <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Jayachandran Chandrasekharan Nair <[email protected]>
Cc Jan Glauber <[email protected]>
Cc Jon Masters <[email protected]>
Cc Eric Auger <[email protected]>
Cc Zhen Lei <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Vijay Kilary <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc John Garry <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc David Woodhouse <[email protected]>

Will Deacon (13):
iommu: Remove empty iommu_tlb_range_add() callback from iommu_ops iommu/io-pgtable-arm: Remove redundant call to io_pgtable_tlb_sync() iommu/io-pgtable: Rename iommu_gather_ops to iommu_flush_ops
iommu: Introduce struct iommu_iotlb_gather for batching TLB flushes
iommu: Introduce iommu_iotlb_gather_add_page()
iommu: Pass struct iommu_iotlb_gather to ->unmap() and ->iotlb_sync() iommu/io-pgtable: Introduce tlb_flush_walk() and tlb_flush_leaf() iommu/io-pgtable: Hook up ->tlb_flush_walk() and ->tlb_flush_leaf() in
drivers
iommu/io-pgtable-arm: Call ->tlb_flush_walk() and ->tlb_flush_leaf() iommu/io-pgtable: Replace ->tlb_add_flush() with ->tlb_add_page() iommu/io-pgtable: Remove unused ->tlb_sync() callback iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->unmap() iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->tlb_add_page()

 drivers/gpu/drm/panfrost/panfrost_mmu.c |  24 +++++---
 drivers/iommu/amd_iommu.c               |  11 ++--
 drivers/iommu/arm-smmu-v3.c             |  52 +++++++++++-----
 drivers/iommu/arm-smmu.c                | 103 ++++++++++++++++++++++++--------
 drivers/iommu/dma-iommu.c               |   9 ++-
 drivers/iommu/exynos-iommu.c            |   3 +-
 drivers/iommu/intel-iommu.c             |   3 +-
 drivers/iommu/io-pgtable-arm-v7s.c      |  57 +++++++++---------
 drivers/iommu/io-pgtable-arm.c          |  48 ++++++++-------
 drivers/iommu/iommu.c                   |  24 ++++----
 drivers/iommu/ipmmu-vmsa.c              |  28 +++++----
 drivers/iommu/msm_iommu.c               |  42 +++++++++----
 drivers/iommu/mtk_iommu.c               |  45 +++++++++++---
 drivers/iommu/mtk_iommu_v1.c            |   3 +-
 drivers/iommu/omap-iommu.c              |   2 +-
 drivers/iommu/qcom_iommu.c              |  44 +++++++++++---
 drivers/iommu/rockchip-iommu.c          |   2 +-
 drivers/iommu/s390-iommu.c              |   3 +-
 drivers/iommu/tegra-gart.c              |  12 +++-
 drivers/iommu/tegra-smmu.c              |   2 +-
 drivers/iommu/virtio-iommu.c            |   5 +-
 drivers/vfio/vfio_iommu_type1.c         |  27 +++++----
 include/linux/io-pgtable.h              |  57 ++++++++++++------
 include/linux/iommu.h                   |  92 +++++++++++++++++++++-------
 24 files changed, 483 insertions(+), 215 deletions(-)
Signature · 6 lines
2.11.0

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu