powerpc/mm/radix: Invalidate ERAT on tlbiel for POWER9 DD1
authorMichael Neuling <mikey@neuling.org>
Fri, 18 Nov 2016 03:08:56 +0000 (14:08 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 18 Nov 2016 04:12:24 +0000 (15:12 +1100)
On POWER9 DD1, when we do a local TLB invalidate we also need to explicitly
invalidate the ERAT.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/mm/tlb-radix.c

index 0132831b3081934254b71e4f032d755a01a1d16a..c56ea8c84abb1771ff65f66ba91ffff02bff5fae 100644 (file)
 
 #define PPC_SLBIA(IH)  stringify_in_c(.long PPC_INST_SLBIA | \
                                       ((IH & 0x7) << 21))
+#define PPC_INVALIDATE_ERAT    PPC_SLBIA(7)
 
 #endif /* _ASM_POWERPC_PPC_OPCODE_H */
index bda8c43be78a4df85d067bc4a7759c63c388d29b..3493cf4e045258df20f5cf47990e991b6af265b7 100644 (file)
@@ -50,6 +50,8 @@ static inline void _tlbiel_pid(unsigned long pid, unsigned long ric)
        for (set = 0; set < POWER9_TLB_SETS_RADIX ; set++) {
                __tlbiel_pid(pid, set, ric);
        }
+       if (cpu_has_feature(CPU_FTR_POWER9_DD1))
+               asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
        return;
 }
 
@@ -83,6 +85,8 @@ static inline void _tlbiel_va(unsigned long va, unsigned long pid,
        asm volatile(PPC_TLBIEL(%0, %4, %3, %2, %1)
                     : : "r"(rb), "i"(r), "i"(prs), "i"(ric), "r"(rs) : "memory");
        asm volatile("ptesync": : :"memory");
+       if (cpu_has_feature(CPU_FTR_POWER9_DD1))
+               asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
 }
 
 static inline void _tlbie_va(unsigned long va, unsigned long pid,