[PATCH v2 00/18] Add PASID support to SMMUv3 unmanaged domains

From: Michael Shavit
Date: Tue Jun 06 2023 - 08:09:23 EST


Hi all,

This patch series implements the set_dev_pasid operation for DMA
and UNMANAGED iommu domains.

As a first step, the patch series refactors stage 1 domains so that
they describe a single CD entry. On attach, stage 1 domains are
inserted into a CD table that is now owned by the arm_smmu_master
struct. Note that this does not preclude from attaching domains that
represent a CD table, such as for the proposed iommufd NESTED domains.

The patch series also heavily refactors the arm-smmu-v3-sva
implementation. The first set of clean-up patches were enabled by
earlier changes in the iommu pasid framework. Later patches take
advantage of the arm-smmu-v3 changes and makes use of its set_dev_pasid
implementation.

This patch series is also available on gerrit with Jean's SMMU test
engine patches rebased on top:
https://linux-review.googlesource.com/id/I0fcd9adc058d1c58a12d2599cc82fba73da7697a
This allowed testing of basic SVA functionality (e.g.: attaching, page
fault handling, and detaching).

Thanks,
Michael Shavit

Changelog
v2:
* Reworded cover letter and commits based on v1 feedback.
* Added SVA clean-up and refactor.
* Split and reworked iommu/arm-smmu-v3: Move cdtable to
arm_smmu_master
* A few other small bug fixes and cosmetics.
v1: https://lore.kernel.org/all/20230510205054.2667898-1-mshavit@xxxxxxxxxx/

Michael Shavit (18):
iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg
iommu/arm-smmu-v3: Add smmu_s1_cfg to smmu_master
iommu/arm-smmu-v3: Refactor write_strtab_ent
iommu/arm-smmu-v3: Refactor write_ctx_desc
iommu/arm-smmu-v3: Use the master-owned s1_cfg
iommu/arm-smmu-v3: Simplify arm_smmu_enable_ats
iommu/arm-smmu-v3: Keep track of attached ssids
iommu/arm-smmu-v3: Add helper for atc invalidation
iommu/arm-smmu-v3: Implement set_dev_pasid
iommu/arm-smmu-v3-sva: Remove bond refcount
iommu/arm-smmu-v3-sva: Clean unused iommu_sva
iommu/arm-smmu-v3-sva: Remove arm_smmu_bond
iommu/arm-smmu-v3-sva: Add check when enabling sva
iommu/arm-smmu-v3: Support domains with shared CDs
iommu/arm-smmu-v3: Allow more re-use for SVA
iommu/arm-smmu-v3-sva: Attach S1_SHARED_CD domain
iommu/arm-smmu-v3-sva: Alloc notifier for {smmu,mn}
iommu/arm-smmu-v3-sva: Remove atc_inv_domain_ssid

.../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 164 +++---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 493 ++++++++++++------
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 62 ++-
3 files changed, 457 insertions(+), 262 deletions(-)


base-commit: 884fe9da1b7ccbea31b118f902fbc78f58366b4a
--
2.41.0.rc0.172.g3f132b7071-goog