lkml.org 
[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 16/17] 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@infradead.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,7 +6,12 @@

#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)
+
#define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tln)->mm, pmd)

#endif

\
 
 \ /
  Last update: 2019-12-11 13:32    [W:0.287 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site