]> 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)
commit659131e808a493ce125062765873a29867742dab
tree0c9b440569016a254614d7b3eb1ce05f57cd920c
parent4313434642fd8a18c094310c9c307d4b73f8f836
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: 0a3b7547a068 ("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