]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm/radix: Use tlbiel only if we ever ran on the current cpu
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 24 Oct 2016 03:20:43 +0000 (08:50 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 27 Oct 2016 10:55:13 +0000 (21:55 +1100)
commit6848f3fb9ec6f42c6d12e98d8d18fed8f5848701
tree0c9b440569016a254614d7b3eb1ce05f57cd920c
parent5fceb7966a79be96c6b652900d40f5ca65af88ec
powerpc/mm/radix: Use tlbiel only if we ever ran on the current cpu

Before this patch, we used tlbiel, if we ever ran only on this core.
That was mostly derived from the nohash usage of the same. But is
incorrect, the ISA 3.0 clarifies tlbiel such that:

"All TLB entries that have all of the following properties are made
invalid on the thread executing the tlbiel instruction"

ie. tlbiel only invalidates TLB entries on the current thread. So if the
mm has been used on any other thread (aka. cpu) then we must broadcast
the invalidate.

This bug could lead to invalid TLB entries if a program runs on multiple
threads of a core.

Hence use tlbiel, if we only ever ran on only the current cpu.

Fixes: c843caf99663 ("powerpc/mm/radix: Add tlbflush routines")
Cc: stable@vger.kernel.org # v4.7+
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/tlb.h
arch/powerpc/mm/tlb-radix.c