Skip to content

Commit 1d9777b

Browse files
rmurphy-armwilldeacon
authored andcommitted
iommu/arm-smmu-v3: Add explicit feature for nesting
In certain cases we may want to refuse to allow nested translation even when both stages are implemented, so let's add an explicit feature for nesting support which we can control in its own right. For now this merely serves as documentation, but it means a nice convenient check will be ready and waiting for the future nesting code. Signed-off-by: Robin Murphy <[email protected]> Reviewed-by: Nicolin Chen <[email protected]> Link: https://lore.kernel.org/r/136c3f4a3a84cc14a5a1978ace57dfd3ed67b688.1683731256.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]>
1 parent 309a15c commit 1d9777b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,6 +3674,10 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
36743674

36753675
smmu->ias = max(smmu->ias, smmu->oas);
36763676

3677+
if ((smmu->features & ARM_SMMU_FEAT_TRANS_S1) &&
3678+
(smmu->features & ARM_SMMU_FEAT_TRANS_S2))
3679+
smmu->features |= ARM_SMMU_FEAT_NESTING;
3680+
36773681
arm_smmu_device_iidr_probe(smmu);
36783682

36793683
if (arm_smmu_sva_supported(smmu))

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ struct arm_smmu_device {
645645
#define ARM_SMMU_FEAT_BTM (1 << 16)
646646
#define ARM_SMMU_FEAT_SVA (1 << 17)
647647
#define ARM_SMMU_FEAT_E2H (1 << 18)
648+
#define ARM_SMMU_FEAT_NESTING (1 << 19)
648649
u32 features;
649650

650651
#define ARM_SMMU_OPT_SKIP_PREFETCH (1 << 0)

0 commit comments

Comments
 (0)