[PATCH v6 3/7] iommu/arm-smmu-v3: Introduce a per-domain arm_smmu_invs array
Jason Gunthorpe
jgg at nvidia.com
Wed Nov 26 10:36:10 PST 2025
On Tue, Nov 25, 2025 at 05:10:08PM -0800, Nicolin Chen wrote:
> From: Jason Gunthorpe <jgg at nvidia.com>
>
> Create a new data structure to hold an array of invalidations that need to
> be performed for the domain based on what masters are attached, to replace
> the single smmu pointer and linked list of masters in the current design.
>
> Each array entry holds one of the invalidation actions - S1_ASID, S2_VMID,
> ATS or their variant with information to feed invalidation commands to HW.
> It is structured so that multiple SMMUs can participate in the same array,
> removing one key limitation of the current system.
>
> To maximize performance, a sorted array is used as the data structure. It
> allows grouping SYNCs together to parallelize invalidations. For instance,
> it will group all the ATS entries after the ASID/VMID entry, so they will
> all be pushed to the PCI devices in parallel with one SYNC.
>
> To minimize the locking cost on the invalidation fast path (reader of the
> invalidation array), the array is managed with RCU.
>
> Provide a set of APIs to add/delete entries to/from an array, which cover
> cannot-fail attach cases, e.g. attaching to arm_smmu_blocked_domain. Also
> add kunit coverage for those APIs.
>
> Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
> Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>
> Co-developed-by: Nicolin Chen <nicolinc at nvidia.com>
> Signed-off-by: Nicolin Chen <nicolinc at nvidia.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 97 +++++++
> .../iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c | 92 +++++++
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 256 ++++++++++++++++++
> 3 files changed, 445 insertions(+)
New version looks good
Jason
More information about the linux-arm-kernel
mailing list