[PATCH] iommu/arm-smmu-v3-sva: Relax ASID requirements

From: Mostafa Saleh

Date: Mon Sep 07 2026 - 11:52:25 EST


arm_smmu_sva_supported() have some residual checks for ASID from the
original commit d744f9e6c222 ("iommu/arm-smmu-v3: Check for SVA features")

As DVM was used for TLB invalidation and the ASID of the domain was shared
with the CPU process.

However, the commit
d38c28dbefee ("iommu/arm-smmu-v3: Put the SVA mmu notifier in the smmu_domain")
removed that support.

So matching the SMMU ASID space to the CPU is unnecessary and can be
relaxed.

Remove the CPU ASID related code, and update the print for the SMMUv3.

Signed-off-by: Mostafa Saleh <smostafa@xxxxxxxxxx>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
index 0a429c64fbf3..a071f9841839 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
@@ -199,7 +199,6 @@ bool arm_smmu_sva_supported(struct arm_smmu_device *smmu)
{
unsigned long reg, fld;
unsigned long oas;
- unsigned long asid_bits;
u32 feat_mask = ARM_SMMU_FEAT_COHERENCY;

if (vabits_actual == 52) {
@@ -232,20 +231,7 @@ bool arm_smmu_sva_supported(struct arm_smmu_device *smmu)
if (smmu->oas < oas)
return false;

- /* We can support bigger ASIDs than the CPU, but not smaller */
- fld = cpuid_feature_extract_unsigned_field(reg, ID_AA64MMFR0_EL1_ASIDBITS_SHIFT);
- asid_bits = fld ? 16 : 8;
- if (smmu->asid_bits < asid_bits)
- return false;
-
- /*
- * See max_pinned_asids in arch/arm64/mm/context.c. The following is
- * generally the maximum number of bindable processes.
- */
- if (arm64_kernel_unmapped_at_el0())
- asid_bits--;
- dev_dbg(smmu->dev, "%d shared contexts\n", (1 << asid_bits) -
- num_possible_cpus() - 2);
+ dev_dbg(smmu->dev, "Max SMMUv3 SVA contexts: %u\n", 1 << smmu->asid_bits);

return true;
}
--
2.55.0.979.g7e5102b832-goog