arm64: tlb: Add DSB ISHST prior to TLBI in __flush_tlb_[kernel_]pgtable()
authorWill Deacon <will.deacon@arm.com>
Wed, 22 Aug 2018 20:40:30 +0000 (21:40 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 11 Sep 2018 15:49:10 +0000 (16:49 +0100)
__flush_tlb_[kernel_]pgtable() rely on set_pXd() having a DSB after
writing the new table entry and therefore avoid the barrier prior to the
TLBI instruction.

In preparation for delaying our walk-cache invalidation on the unmap()
path, move the DSB into the TLB invalidation routines.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/tlbflush.h

index 7e2a35424ca4176471e771ae9e0aa8cda8f8de5f..e257f8655b841ca3da1aa2053755cf8f0a0540a4 100644 (file)
@@ -213,6 +213,7 @@ static inline void __flush_tlb_pgtable(struct mm_struct *mm,
 {
        unsigned long addr = __TLBI_VADDR(uaddr, ASID(mm));
 
+       dsb(ishst);
        __tlbi(vae1is, addr);
        __tlbi_user(vae1is, addr);
        dsb(ish);
@@ -222,6 +223,7 @@ static inline void __flush_tlb_kernel_pgtable(unsigned long kaddr)
 {
        unsigned long addr = __TLBI_VADDR(kaddr, 0);
 
+       dsb(ishst);
        __tlbi(vaae1is, addr);
        dsb(ish);
 }