Skip to contentSkip to conversation

iommu/arm-smmu-v3: Add missing S2FWB feature detection

PATCH Applied Aneesh Kumar K.V (Arm) 5 participants 6 messages Apr 8, 2025 – Apr 17, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/arm-smmu-v3: Add missing S2FWB feature detection

Commit 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains") introduced S2FWB usage but omitted the corresponding feature detection. As a result, vIOMMU allocation fails on FVP in arm_vsmmu_alloc(), due to the following check:

	if (!arm_smmu_master_canwbs(master) &&
	    !(smmu->features & ARM_SMMU_FEAT_S2FWB))
		return ERR_PTR(-EOPNOTSUPP);

This patch adds the missing detection logic to prevent allocation failure when S2FWB is supported.

Fixes 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains")
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +2 -0
index 358072b4e293..c7d297ceabdb 100644
@@ -4405,6 +4405,8 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
 	reg = readl_relaxed(smmu->base + ARM_SMMU_IDR3);
 	if (FIELD_GET(IDR3_RIL, reg))
 		smmu->features |= ARM_SMMU_FEAT_RANGE_INV;
+	if (FIELD_GET(IDR3_FWB, reg))
+		smmu->features |= ARM_SMMU_FEAT_S2FWB;
 
 	/* IDR5 */
 	reg = readl_relaxed(smmu->base + ARM_SMMU_IDR5);
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · Aneesh Kumar K.V (Arm)

Commit 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains") introduced S2FWB usage but omitted the corresponding feature detection. As a result, vIOMMU allocation fails on FVP in arm_vsmmu_alloc(), due to the following check:

	if (!arm_smmu_master_canwbs(master) &&
	    !(smmu->features & ARM_SMMU_FEAT_S2FWB))
		return ERR_PTR(-EOPNOTSUPP);

This patch adds the missing detection logic to prevent allocation failure when S2FWB is supported.

Fixes 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains")
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +0 -0
index 358072b4e293..c7d297ceabdb 100644

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) · line 4412

Quoted 8 lines
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +2 -0
@@ -4405,6 +4405,8 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
 	reg = readl_relaxed(smmu->base + ARM_SMMU_IDR3);
 	if (FIELD_GET(IDR3_RIL, reg))
 		smmu->features |= ARM_SMMU_FEAT_RANGE_INV;
+	if (FIELD_GET(IDR3_FWB, reg))
+		smmu->features |= ARM_SMMU_FEAT_S2FWB;
 
 	/* IDR5 */
 	reg = readl_relaxed(smmu->base + ARM_SMMU_IDR5);

Indeed. Looks like setting the feature flag was missed previously.

Thanks,
Praan

Reviewed-by on v1 1/1
#2 lore raw
In reply to Aneesh Kumar K.V (Arm)
Quoted 9 lines · Aneesh Kumar K.V (Arm)

Commit 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains") introduced S2FWB usage but omitted the corresponding feature detection. As a result, vIOMMU allocation fails on FVP in arm_vsmmu_alloc(), due to the following check:

	if (!arm_smmu_master_canwbs(master) &&
	    !(smmu->features & ARM_SMMU_FEAT_S2FWB))
		return ERR_PTR(-EOPNOTSUPP);
Quoted 5 lines

This patch adds the missing detection logic to prevent allocation failure when S2FWB is supported.

Fixes 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains")
Reviewed-by on v1 1/1
#3 lore raw
In reply to Aneesh Kumar K.V (Arm)
Quoted 9 lines · Aneesh Kumar K.V (Arm)

Commit 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains") introduced S2FWB usage but omitted the corresponding feature detection. As a result, vIOMMU allocation fails on FVP in arm_vsmmu_alloc(), due to the following check:

	if (!arm_smmu_master_canwbs(master) &&
	    !(smmu->features & ARM_SMMU_FEAT_S2FWB))
		return ERR_PTR(-EOPNOTSUPP);
Quoted 8 lines

This patch adds the missing detection logic to prevent allocation failure when S2FWB is supported.

Fixes 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains")
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 ++
 1 file changed, 2 insertions(+)

This should go to rc

Jason

maintainer
#4 lore raw
Quoted 19 lines · Jason Gunthorpe
Quoted 9 lines · Aneesh Kumar K.V (Arm)

Commit 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains") introduced S2FWB usage but omitted the corresponding feature detection. As a result, vIOMMU allocation fails on FVP in arm_vsmmu_alloc(), due to the following check:

	if (!arm_smmu_master_canwbs(master) &&
	    !(smmu->features & ARM_SMMU_FEAT_S2FWB))
		return ERR_PTR(-EOPNOTSUPP);
Quoted 8 lines

This patch adds the missing detection logic to prevent allocation failure when S2FWB is supported.

Fixes 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains")
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 3 lines

This should go to rc

Yup. I'll pick this up next week along with any other SMMU fixes kicking around.

Cheers,

Will

maintainer Applied
#5 lore raw
In reply to Aneesh Kumar K.V (Arm)
Quoted 10 lines · Aneesh Kumar K.V (Arm)

Commit 67e4fe398513 ("iommu/arm-smmu-v3: Use S2FWB for NESTED domains") introduced S2FWB usage but omitted the corresponding feature detection. As a result, vIOMMU allocation fails on FVP in arm_vsmmu_alloc(), due to the following check:

	if (!arm_smmu_master_canwbs(master) &&
	    !(smmu->features & ARM_SMMU_FEAT_S2FWB))
		return ERR_PTR(-EOPNOTSUPP);

[...]

Applied to iommu (arm/smmu/fixes), thanks!

[1/1] iommu/arm-smmu-v3: Add missing S2FWB feature detection

      https://git.kernel.org/iommu/c/45e00e367189

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev