Skip to content

iommu/vt-d: Remove superfluous IOMMU IOTLB invalidations

Tina Zhang linux-iommu 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest13 patches 1 replyIn review
  2. v111 patches 14 repliesSuperseded

Changes in v2 from the cover letter

- Rebase on v6.8-rc4.
- Sort dev_pasids list to make the devices behine the same IOMMU stay together.
- Doesn't allocate iommu_domain_info for sva domain and add comments
to tell the reason.
- Make intel_iommu_set_dev_pasid() be compatible with sva domain.
v1: https://lore.kernel.org/linux-iommu/[email protected]/
RFC: https://lore.kernel.org/linux-iommu/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13iommu/vt-d: Retire the treatment for revoking PASIDs with pending pgfaultsdrivers/iommu/intel/svm.c+0 -70 replies
2/13iommu/vt-d: Remove initialization for dynamically heap-allocated rcu_headdrivers/iommu/intel/svm.c+0 -10 replies
3/13iommu/vt-d: Refactor intel_svm_set_dev_pasid functiondrivers/iommu/intel/svm.c+3 -110 replies
4/13iommu/vt-d: Retire struct intel_svm_devdrivers/iommu/intel/iommu.h drivers/iommu/intel/svm.c+55 -630 replies
5/13iommu: Add ops->domain_alloc_sva()drivers/iommu/iommu-sva.c drivers/iommu/iommu.c include/linux/iommu.h+14 -50 replies
6/13iommu/vt-d: Retire struct intel_svmdrivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h drivers/iommu/intel/svm.c+61 -1360 replies
7/13iommu/vt-d: Use RCU for dev_pasids list updates in set/remove_dev_pasid()drivers/iommu/intel/iommu.c+9 -30 replies
8/13iommu/vt-d: Add domain_type_is_sva helper functiondrivers/iommu/intel/iommu.c+6 -10 replies
9/13iommu/vt-d: Reuse intel_iommu_set_dev_pasid functiondrivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h drivers/iommu/intel/svm.c+33 -420 replies
10/13iommu/vt-d: Use dev_pasid->sid fielddrivers/iommu/intel/iommu.c+1 -10 replies
11/13iommu/vt-d: Retire intel_svm_remove_dev_pasid functiondrivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h drivers/iommu/intel/svm.c+1 -490 replies
12/13iommu/vt-d: Sort dev_pasids listdrivers/iommu/intel/iommu.c+11 -20 replies
13/13iommu/vt-d: Remove superfluous IOMMU IOTLB invalidationsdrivers/iommu/intel/svm.c+37 -330 replies

Reviews trailers per patch

1 of 13 patches has a Reviewed-by or Acked-by.

PatchTina Zhang
1/13
2/13
3/13
4/13
5/13R-b
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/13] iommu/vt-d: Remove superfluous IOMMU IOTLB invalidations

In the current VT-d driver, IOMMU IOTLB invalidation commands and device-TLB commands are performed per device, which leads to superfluous IOTLB invalidations. For example, if there are four devices behind a IOMMU are attached to one sva domain (which could be a common case in virtualization scenarios where one virtual IOMMU working for all the virtual devices), four IOTLB invalidation commands and four device-IOTLB invalidation commands will be issued. However, only one IOTLB invalidation command and four device-IOTLB invalidation commands are necessary. Superfluous IOMMU IOTLB invalidations impact run-time performance.

The first 12 patches of this patch-set are for refactoring:
1) Retire struct intel_svm_set_dev_pasid and struct intel_svm_dev to avoid duplicating code for sva domain.
2) Reuse intel_iommu_set/remove_dev_pasid functions for both sva domain and dmar_domain.

The last patch removes the superfluous IOMMU IOTLB invalidations.

[1]: https://lore.kernel.org/linux-iommu/[email protected]/

v2:
- Rebase on v6.8-rc4.
- Sort dev_pasids list to make the devices behine the same IOMMU stay together.
- Doesn't allocate iommu_domain_info for sva domain and add comments
to tell the reason.
- Make intel_iommu_set_dev_pasid() be compatible with sva domain.
v1: https://lore.kernel.org/linux-iommu/[email protected]/
RFC: https://lore.kernel.org/linux-iommu/[email protected]/

Jason Gunthorpe (1):
iommu: Add ops->domain_alloc_sva()

Tina Zhang (12):
iommu/vt-d: Retire the treatment for revoking PASIDs with pending
pgfaults
iommu/vt-d: Remove initialization for dynamically heap-allocated
rcu_head
iommu/vt-d: Refactor intel_svm_set_dev_pasid function iommu/vt-d: Retire struct intel_svm_dev
iommu/vt-d: Retire struct intel_svm
iommu/vt-d: Use RCU for dev_pasids list updates in
set/remove_dev_pasid()
iommu/vt-d: Add domain_type_is_sva helper function iommu/vt-d: Reuse intel_iommu_set_dev_pasid function iommu/vt-d: Use dev_pasid->sid field
iommu/vt-d: Retire intel_svm_remove_dev_pasid function iommu/vt-d: Sort dev_pasids list
iommu/vt-d: Remove superfluous IOMMU IOTLB invalidations

 drivers/iommu/intel/iommu.c |  75 ++++++---
 drivers/iommu/intel/iommu.h |  31 ++--
 drivers/iommu/intel/svm.c   | 300 +++++++++---------------------------
 drivers/iommu/iommu-sva.c   |   4 +-
 drivers/iommu/iommu.c       |  12 +-
 include/linux/iommu.h       |   3 +
 6 files changed, 151 insertions(+), 274 deletions(-)
Signature · 1 line
2.34.1