]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/arm-smmu-v3: Introduce struct arm_smmu_vmaster
authorNicolin Chen <nicolinc@nvidia.com>
Tue, 11 Mar 2025 19:44:30 +0000 (12:44 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 18 Mar 2025 17:17:48 +0000 (14:17 -0300)
commitf0ea207ed7813bdf17e65aa042d023d1c59e49e3
tree14b58b28a6d0a8df37770166e1ad8cb6c8de3225
parent2ec0458eb0e5a84d80f82667e358c4f2c187d2e4
iommu/arm-smmu-v3: Introduce struct arm_smmu_vmaster

Use it to store all vSMMU-related data. The vsid (Virtual Stream ID) will
be the first use case. Since the vsid reader will be the eventq handler
that already holds a streams_mutex, reuse that to fence the vmaster too.

Also add a pair of arm_smmu_attach_prepare/commit_vmaster helpers to set
or unset the master->vmaster pointer. Put the helpers inside the existing
arm_smmu_attach_prepare/commit().

For identity/blocked ops that don't call arm_smmu_attach_prepare/commit(),
add a simpler arm_smmu_master_clear_vmaster helper to unset the vmaster.

Link: https://patch.msgid.link/r/a7f282e1a531279e25f06c651e95d56f6b120886.1741719725.git.nicolinc@nvidia.com
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h