iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg
authorMichael Shavit <mshavit@google.com>
Fri, 15 Sep 2023 13:17:32 +0000 (21:17 +0800)
committerWill Deacon <will@kernel.org>
Thu, 12 Oct 2023 16:08:16 +0000 (17:08 +0100)
commit987a878e09c6c22b9c1a517900bd94d5ed0cc459
tree6fa8b4addff86430c76ee8a1a84bab68cd109072
parent70c613602b55d7011ccc4883ab5c0095db307db7
iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg

arm_smmu_s1_cfg (and by extension arm_smmu_domain) owns both a CD table
and the CD inserted into that table's non-pasid CD entry. This limits
arm_smmu_domain's ability to represent non-pasid domains, where multiple
domains need to be inserted into a common CD table. Rather than describing
an STE entry (which may have multiple domains installed into it with
PASID), a domain should describe a single CD entry instead. This is
precisely the role of arm_smmu_ctx_desc. A subsequent commit will also
move the CD table outside of arm_smmu_domain.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Michael Shavit <mshavit@google.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Link: https://lore.kernel.org/r/20230915211705.v8.1.I67ab103c18d882aedc8a08985af1fba70bca084e@changeid
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h