powerpc/mm/radix: Improve _tlbiel_pid to be usable for PWC flushes
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 19 Jul 2017 04:49:04 +0000 (14:49 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 2 Aug 2017 03:11:05 +0000 (13:11 +1000)
The PWC flush only needs a single set call, just like the
full (RIC=2) flush.

This will allow us to get rid of the dedicated _tlbiel_pwc()

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/tlb-radix.c

index 744e0164ecf58551f036ef30e19a79638adcaa76..2f2967a2db934a2661818d6ce800e1aa68f389b0 100644 (file)
@@ -54,12 +54,15 @@ static inline void _tlbiel_pid(unsigned long pid, unsigned long ric)
         */
        __tlbiel_pid(pid, 0, ric);
 
-       if (ric == RIC_FLUSH_ALL)
-               /* For the remaining sets, just flush the TLB */
-               ric = RIC_FLUSH_TLB;
+       /* For PWC, only one flush is needed */
+       if (ric == RIC_FLUSH_PWC) {
+               asm volatile("ptesync": : :"memory");
+               return;
+       }
 
+       /* For the remaining sets, just flush the TLB */
        for (set = 1; set < POWER9_TLB_SETS_RADIX ; set++)
-               __tlbiel_pid(pid, set, ric);
+               __tlbiel_pid(pid, set, RIC_FLUSH_TLB);
 
        asm volatile("ptesync": : :"memory");
        asm volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory");