Skip to contentSkip to conversation

iommu/arm-smmu: fix panic in arm_smmu_alloc_init_pte

PATCH New Bin Wang 3 participants 3 messages Mar 21, 2014 IOMMU

lore
Share & tools
lore

Bin Wang

author
#0 lore raw

PATCH 1/1 iommu/arm-smmu: fix panic in arm_smmu_alloc_init_pte

kernel panic happened when iommu_unmap a buffer larger than 2MB, more than expected pmd entries got ?invalidated?, due to a wrong range passed to arm_smmu_alloc_init_pte. it was likely a typo, now we fix it, passing the correct "end" address to arm_smmu_alloc_init_pte.

---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +1 -1
index 1d9ab39..52d0c34 100644
@@ -1346,7 +1346,7 @@ static int arm_smmu_alloc_init_pmd(struct arm_smmu_device *smmu, pud_t *pud,
 
 	do {
 		next = pmd_addr_end(addr, end);
-		ret = arm_smmu_alloc_init_pte(smmu, pmd, addr, end, pfn,
+		ret = arm_smmu_alloc_init_pte(smmu, pmd, addr, next, pfn,
 					      flags, stage);
 		phys += next - addr;
 	} while (pmd++, addr = next, addr < end);
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 iommu/arm-smmu: fix panic in arm_smmu_alloc_init_pte

Hi Bin,

Quoted 16 lines · Bin Wang

kernel panic happened when iommu_unmap a buffer larger than 2MB, more than expected pmd entries got ?invalidated?, due to a wrong range passed to arm_smmu_alloc_init_pte. it was likely a typo, now we fix it, passing the correct "end" address to arm_smmu_alloc_init_pte.

---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +0 -0
index 1d9ab39..52d0c34 100644

drivers/iommu/arm-smmu.c static int arm_smmu_alloc_init_pmd(struct arm_smmu_device *smmu, pud_t *pud, · line 1352

Quoted 8 lines
drivers/iommu/arm-smmu.c +1 -1
@@ -1346,7 +1346,7 @@ static int arm_smmu_alloc_init_pmd(struct arm_smmu_device *smmu, pud_t *pud,
 
 	do {
 		next = pmd_addr_end(addr, end);
-		ret = arm_smmu_alloc_init_pte(smmu, pmd, addr, end, pfn,
+		ret = arm_smmu_alloc_init_pte(smmu, pmd, addr, next, pfn,
 					      flags, stage);
 		phys += next - addr;
 	} while (pmd++, addr = next, addr < end);

Looks like a valid fix. In Will's absence ([1]), I'll queue it for 3.15, and CC stable.

Joerg: are you still taking pull requests for 3.15, or shall I wait until rc1?

Thanks,

	M.

[1]: http://www.spinics.net/lists/arm-kernel/msg315615.html

Signature · 1 line
Jazz is not dead. It just smells funny...
maintainer
#2 lore raw

PATCH 1/1 iommu/arm-smmu: fix panic in arm_smmu_alloc_init_pte

Quoted 2 lines · Marc Zyngier

Joerg: are you still taking pull requests for 3.15, or shall I wait until rc1?

No need to wait for rc1, send me a pull-request and I will send the fix upstream.

Joerg