linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm/32: Fix pgtable_page_dtor call
@ 2018-06-25  8:15 Aneesh Kumar K.V
  2018-06-27 21:41 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Aneesh Kumar K.V @ 2018-06-25  8:15 UTC (permalink / raw)
  To: npiggin, benh, paulus, mpe, Christophe Leroy
  Cc: linuxppc-dev, 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")
Reported-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 arch/powerpc/include/asm/book3s/32/pgalloc.h | 1 -
 arch/powerpc/include/asm/nohash/32/pgalloc.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/32/pgalloc.h b/arch/powerpc/include/asm/book3s/32/pgalloc.h
index e4633803fe43..82e44b1a00ae 100644
--- a/arch/powerpc/include/asm/book3s/32/pgalloc.h
+++ b/arch/powerpc/include/asm/book3s/32/pgalloc.h
@@ -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 */
diff --git a/arch/powerpc/include/asm/nohash/32/pgalloc.h b/arch/powerpc/include/asm/nohash/32/pgalloc.h
index 9de40eb614da..8825953c225b 100644
--- a/arch/powerpc/include/asm/nohash/32/pgalloc.h
+++ b/arch/powerpc/include/asm/nohash/32/pgalloc.h
@@ -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 */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: powerpc/mm/32: Fix pgtable_page_dtor call
  2018-06-25  8:15 [PATCH] powerpc/mm/32: Fix pgtable_page_dtor call Aneesh Kumar K.V
@ 2018-06-27 21:41 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-06-27 21:41 UTC (permalink / raw)
  To: Aneesh Kumar K.V, npiggin, benh, paulus, Christophe Leroy
  Cc: Aneesh Kumar K.V, linuxppc-dev

On Mon, 2018-06-25 at 08:15:09 UTC, "Aneesh Kumar K.V" wrote:
> 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")
> Reported-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>

Applied to powerpc fixes, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-27 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25  8:15 [PATCH] powerpc/mm/32: Fix pgtable_page_dtor call Aneesh Kumar K.V
2018-06-27 21:41 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).