Skip to content

Introduce IOMMU-API TLB Flushing Interface

Joerg Roedel dri-devel kvm linux-arm-kernel linux-arm-msm linux-iommu linux-rdma linux-remoteproc linux-rockchip linux-tegra lkml nouveau 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13iommu/amd: Rename a few flush functionsdrivers/iommu/amd_iommu.c+8 -80 replies
2/13iommu: Introduce Interface for IOMMU TLB Flushingdrivers/iommu/iommu.c include/linux/iommu.h+105 -15 replies
3/13vfio/type1: Use sychronized interface of the IOMMU-APIdrivers/vfio/vfio_iommu_type1.c+20 -180 replies
4/13iommu/dma: Use sychronized interface of the IOMMU-APIdrivers/iommu/dma-iommu.c+4 -40 replies
5/13arm: dma-mapping: Use sychronized interface of the IOMMU-APIarch/arm/mm/dma-mapping.c+11 -100 replies
6/13drm/etnaviv: Use sychronized interface of the IOMMU-APIdrivers/gpu/drm/etnaviv/etnaviv_mmu.c+5 -56 replies
7/13drm/msm: Use sychronized interface of the IOMMU-APIdrivers/gpu/drm/msm/msm_iommu.c+3 -21 reply
8/13drm/nouveau/imem/gk20a: Use sychronized interface of the IOMMU-APIdrivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c+7 -50 replies
9/13drm/rockchip: Use sychronized interface of the IOMMU-APIdrivers/gpu/drm/rockchip/rockchip_drm_gem.c+3 -30 replies
10/13drm/tegra: Use sychronized interface of the IOMMU-APIdrivers/gpu/drm/tegra/drm.c drivers/gpu/drm/tegra/gem.c+6 -61 reply
11/13gpu: host1x: Use sychronized interface of the IOMMU-APIdrivers/gpu/host1x/cdma.c drivers/gpu/host1x/job.c+6 -61 reply
12/13IB/usnic: Use sychronized interface of the IOMMU-APIdrivers/infiniband/hw/usnic/usnic_uiom.c+5 -50 replies
13/13remoteproc: Use sychronized interface of the IOMMU-APIdrivers/remoteproc/remoteproc_core.c+6 -41 reply

Reviews trailers per patch

4 of 13 patches have a Reviewed-by or Acked-by.

PatchThierry RedingRob ClarkBjorn Andersson
1/13
2/13
3/13
4/13
5/13
6/13
7/13A-b
8/13
9/13
10/13A-b
11/13A-b
12/13
13/13A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/13] Introduce IOMMU-API TLB Flushing Interface

Hi,

here is a patch-set to introduce an explicit interface to the IOMMU-API to flush IOMMU and device IO/TLBs. Currently the iommu_map(), iommu_map_sg(), and iommu_unmap() functions have to make sure all IO/TLBs in the system are synchronized with the page-table updates they made.

This is very inefficient in some scenarios, for example when a large address space is unmapped and an IO/TLB flush has to be done in every call of iommu_unmap(). Or in a scenario where it makes sense to queue up some changes to the page-tables and flush them together.

To optimize these scenarios, the need to synchronize with the IOMMU and device TLBs has been removed from the map/unmap functions of the IOMMU-API and an interface to explicitly do the flushes has been introduced.

To make the conversion of existing users of the IOMMU-API easier, new functions - iommu_map_sync(), iommu_map_sg_sync(), and iommu_unmap_sync() - have been introduced. These functions guarantee that the IO/TLBs are synchronized with any page-table update when they return. The optimizations possible with the new interface are subject to separate patch-sets.

Patch 1 just renames a few functions in the AMD-Vi driver that would otherwise collide with the new TLB-flush functions from the IOMMU-API.

Patch 2 introduces the new IO/TLB Flush-Interface.

Patch 3-13 convert existing users of the IOMMU-API to use the *_sync functions for now.

Please review.

Thanks,

Joerg

Joerg Roedel (13):
iommu/amd: Rename a few flush functions
iommu: Introduce Interface for IOMMU TLB Flushing vfio/type1: Use sychronized interface of the IOMMU-API iommu/dma: Use sychronized interface of the IOMMU-API
arm: dma-mapping: Use sychronized interface of the IOMMU-API drm/etnaviv: Use sychronized interface of the IOMMU-API drm/msm: Use sychronized interface of the IOMMU-API drm/nouveau/imem/gk20a: Use sychronized interface of the IOMMU-API drm/rockchip: Use sychronized interface of the IOMMU-API drm/tegra: Use sychronized interface of the IOMMU-API
gpu: host1x: Use sychronized interface of the IOMMU-API IB/usnic: Use sychronized interface of the IOMMU-API
remoteproc: Use sychronized interface of the IOMMU-API

 arch/arm/mm/dma-mapping.c                          | 21 +++---
 drivers/gpu/drm/etnaviv/etnaviv_mmu.c              | 10 +--
 drivers/gpu/drm/msm/msm_iommu.c                    |  5 +-
 .../gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c    | 12 ++--
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c        |  6 +-
 drivers/gpu/drm/tegra/drm.c                        |  6 +-
 drivers/gpu/drm/tegra/gem.c                        |  6 +-
 drivers/gpu/host1x/cdma.c                          |  6 +-
 drivers/gpu/host1x/job.c                           |  6 +-
 drivers/infiniband/hw/usnic/usnic_uiom.c           | 10 +--
 drivers/iommu/amd_iommu.c                          | 16 ++---
 drivers/iommu/dma-iommu.c                          |  8 +--
 drivers/iommu/iommu.c                              | 26 +++++++
 drivers/remoteproc/remoteproc_core.c               | 10 +--
 drivers/vfio/vfio_iommu_type1.c                    | 38 +++++-----
 include/linux/iommu.h                              | 80 +++++++++++++++++++++-
 16 files changed, 189 insertions(+), 77 deletions(-)
Signature · 1 line
2.7.4