Skip to contentSkip to conversation

powerpc/mm/32: Fix pgtable_page_dtor call

PATCH Applied Aneesh Kumar K.V 2 participants 2 messages Jun 25, 2018 – Jun 27, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/mm/32: Fix pgtable_page_dtor call

Commit 667416f38554 ("powerpc/mm: Fix kernel crash on page table free") added a call for pgtable_page_dtor in the rcu page table free routine. We missed the fact that for 32 bit platforms we did call the 'dtor' early. Drop the extra call for pgtable_page_dtor. We remove the call from __pte_free_tlb so that we do the page table free and 'dtor' call together. This should help when we switch these platforms to pte fragments.

Fixes 667416f38554 ("powerpc/mm: Fix kernel crash on page table free")
---
 arch/powerpc/include/asm/book3s/32/pgalloc.h | 1 -
 arch/powerpc/include/asm/nohash/32/pgalloc.h | 1 -
 2 files changed, 2 deletions(-)
arch/powerpc/include/asm/book3s/32/pgalloc.h +0 -1
index e4633803fe43..82e44b1a00ae 100644
@@ -138,7 +138,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb,
 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
 				  unsigned long address)
 {
-	pgtable_page_dtor(table);
 	pgtable_free_tlb(tlb, page_address(table), 0);
 }
 #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */
arch/powerpc/include/asm/nohash/32/pgalloc.h +0 -1
index 9de40eb614da..8825953c225b 100644
@@ -140,7 +140,6 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
 				  unsigned long address)
 {
 	tlb_flush_pgtable(tlb, address);
-	pgtable_page_dtor(table);
 	pgtable_free_tlb(tlb, page_address(table), 0);
 }
 #endif /* _ASM_POWERPC_PGALLOC_32_H */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines · Aneesh Kumar K.V

Commit 667416f38554 ("powerpc/mm: Fix kernel crash on page table free") added a call for pgtable_page_dtor in the rcu page table free routine. We missed the fact that for 32 bit platforms we did call the 'dtor' early. Drop the extra call for pgtable_page_dtor. We remove the call from __pte_free_tlb so that we do the page table free and 'dtor' call together. This should help when we switch these platforms to pte fragments.

Fixes 667416f38554 ("powerpc/mm: Fix kernel crash on page table free")

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/941c06d58503b9f2718b20bc45ee7f

cheers