Skip to content

Commit 5ac66ed

Browse files
misalehwilldeacon
authored andcommitted
iommu/arm-smmu-v3: Remove IAS
The driver only supports AArch64 page tables where OAS == IAS. Remove the extra IAS tracking for AArch32 as this feature was never implemented and that was creating BAD_STEs for SMMUv3 with stage-2 and OAS < 40. Further discussion on this in: https://lore.kernel.org/linux-iommu/20251130194506.593700-1-smostafa@google.com/ Reported-by: Tomasz Nowicki <tnowicki@google.com> Fixes: f0c453d ("iommu/arm-smmu: Ensure IAS is set correctly for AArch32-capable SMMUs") Signed-off-by: Mostafa Saleh <smostafa@google.com> Signed-off-by: Will Deacon <will@kernel.org>
1 parent 2026159 commit 5ac66ed

2 files changed

Lines changed: 5 additions & 15 deletions

File tree

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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,7 +2562,7 @@ static int arm_smmu_domain_finalise(struct arm_smmu_domain *smmu_domain,
25622562
ARM_SMMU_FEAT_VAX) ? 52 : 48;
25632563

25642564
pgtbl_cfg.ias = min_t(unsigned long, ias, VA_BITS);
2565-
pgtbl_cfg.oas = smmu->ias;
2565+
pgtbl_cfg.oas = smmu->oas;
25662566
if (enable_dirty)
25672567
pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_ARM_HD;
25682568
fmt = ARM_64_LPAE_S1;
@@ -2572,7 +2572,7 @@ static int arm_smmu_domain_finalise(struct arm_smmu_domain *smmu_domain,
25722572
case ARM_SMMU_DOMAIN_S2:
25732573
if (enable_dirty)
25742574
return -EOPNOTSUPP;
2575-
pgtbl_cfg.ias = smmu->ias;
2575+
pgtbl_cfg.ias = smmu->oas;
25762576
pgtbl_cfg.oas = smmu->oas;
25772577
fmt = ARM_64_LPAE_S2;
25782578
finalise_stage_fn = arm_smmu_domain_finalise_s2;
@@ -4406,13 +4406,7 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
44064406
}
44074407

44084408
/* We only support the AArch64 table format at present */
4409-
switch (FIELD_GET(IDR0_TTF, reg)) {
4410-
case IDR0_TTF_AARCH32_64:
4411-
smmu->ias = 40;
4412-
fallthrough;
4413-
case IDR0_TTF_AARCH64:
4414-
break;
4415-
default:
4409+
if (!(FIELD_GET(IDR0_TTF, reg) & IDR0_TTF_AARCH64)) {
44164410
dev_err(smmu->dev, "AArch64 table format not supported!\n");
44174411
return -ENXIO;
44184412
}
@@ -4525,8 +4519,6 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
45254519
dev_warn(smmu->dev,
45264520
"failed to set DMA mask for table walker\n");
45274521

4528-
smmu->ias = max(smmu->ias, smmu->oas);
4529-
45304522
if ((smmu->features & ARM_SMMU_FEAT_TRANS_S1) &&
45314523
(smmu->features & ARM_SMMU_FEAT_TRANS_S2))
45324524
smmu->features |= ARM_SMMU_FEAT_NESTING;
@@ -4536,8 +4528,8 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
45364528
if (arm_smmu_sva_supported(smmu))
45374529
smmu->features |= ARM_SMMU_FEAT_SVA;
45384530

4539-
dev_info(smmu->dev, "ias %lu-bit, oas %lu-bit (features 0x%08x)\n",
4540-
smmu->ias, smmu->oas, smmu->features);
4531+
dev_info(smmu->dev, "oas %lu-bit (features 0x%08x)\n",
4532+
smmu->oas, smmu->features);
45414533
return 0;
45424534
}
45434535

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ struct arm_vsmmu;
4343
#define IDR0_COHACC (1 << 4)
4444
#define IDR0_TTF GENMASK(3, 2)
4545
#define IDR0_TTF_AARCH64 2
46-
#define IDR0_TTF_AARCH32_64 3
4746
#define IDR0_S1P (1 << 1)
4847
#define IDR0_S2P (1 << 0)
4948

@@ -784,7 +783,6 @@ struct arm_smmu_device {
784783
int gerr_irq;
785784
int combined_irq;
786785

787-
unsigned long ias; /* IPA */
788786
unsigned long oas; /* PA */
789787
unsigned long pgsize_bitmap;
790788

0 commit comments

Comments
 (0)