]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/arm-smmu-v3: Make domain_alloc_paging_flags() directly determine the S1/S2
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 5 Dec 2024 15:43:28 +0000 (11:43 -0400)
committerWill Deacon <will@kernel.org>
Mon, 9 Dec 2024 23:08:06 +0000 (23:08 +0000)
commitbb857c5c015033026d82d404061b26bbb37c821d
tree5f99f088b6b25222442fa7923e46f0e5307af057
parent48e7b8e284e5be9fd1b54b60246bcbe9711d43e4
iommu/arm-smmu-v3: Make domain_alloc_paging_flags() directly determine the S1/S2

The selection of S1/S2 is a bit indirect today, make
domain_alloc_paging_flags() directly decode the flags and select the
correct S1/S2 type.

Directly reject flag combinations the HW doesn't support when processing
the flags.

Fix missing rejection of some flag combinations that are not supported
today (ie NEST_PARENT | DIRTY_TRACKING) by using a switch statement to
list out exactly the combinations that are currently supported.

Move the determination of the stage out of arm_smmu_domain_finalise() and
into both callers. As today the default stage is S1 if supported in HW.

This makes arm_smmu_domain_alloc_paging_flags() self contained and no
longer calling arm_smmu_domain_alloc_paging().

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/2-v1-0bb8d5313a27+27b-smmuv3_paging_flags_jgg@nvidia.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c