[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200717111349.883694582@infradead.org>
Date: Fri, 17 Jul 2020 13:10:14 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Will Deacon <will@...nel.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Nick Piggin <npiggin@...il.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: linux-arch@...r.kernel.org, linux-sh@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>,
"David S. Miller" <davem@...emloft.net>,
Helge Deller <deller@....de>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Paul Burton <paulburton@...nel.org>,
Tony Luck <tony.luck@...el.com>,
Richard Henderson <rth@...ddle.net>,
Nick Hu <nickhu@...estech.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
Christoph Hellwig <hch@....de>
Subject: [PATCH v2 09/11] nds32/tlb: Fix __p*_free_tlb()
Just like regular pages, page directories need to observe the
following order:
1) unhook
2) TLB invalidate
3) free
to ensure it is safe against concurrent accesses.
Even though NDS32 is UP only, we still need to observe this order
because mmu_gather is preemptible.
NDS32 does not in fact have PMDs.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
arch/nds32/include/asm/tlb.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/arch/nds32/include/asm/tlb.h
+++ b/arch/nds32/include/asm/tlb.h
@@ -6,6 +6,11 @@
#include <asm-generic/tlb.h>
-#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte)
+#define __pte_free_tlb(tlb, pte, address) \
+do { \
+ pgtable_pte_page_dtor(pte); \
+ tlb_remove_table((tlb), (pte)); \
+} while (0)
+
#endif
Powered by blists - more mailing lists