]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s/radix: Fix missing global invalidations when removing copro
authorFrederic Barrat <fbarrat@linux.ibm.com>
Tue, 31 Jul 2018 13:24:52 +0000 (15:24 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 1 Aug 2018 13:23:41 +0000 (23:23 +1000)
commit2c4a96992b8a6c9cbd8b9700f069511deb7d03e3
tree1c64ea127a8a4df5c6d9513a33ac200e111097bb
parent1128f7d6eedad6a0d7c8651817e9da66c32bcdb3
powerpc/64s/radix: Fix missing global invalidations when removing copro

With the optimizations for TLB invalidation from commit 202f5ac1b724
("powerpc/64s/radix: flush remote CPUs out of single-threaded
mm_cpumask"), the scope of a TLBI (global vs. local) can now be
influenced by the value of the 'copros' counter of the memory context.

When calling mm_context_remove_copro(), the 'copros' counter is
decremented first before flushing. It may have the unintended side
effect of sending local TLBIs when we explicitly need global
invalidations in this case. Thus breaking any nMMU user in a bad and
unpredictable way.

Fix it by flushing first, before updating the 'copros' counter, so
that invalidations will be global.

Fixes: 202f5ac1b724 ("powerpc/64s/radix: flush remote CPUs out of single-threaded mm_cpumask")
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/mmu_context.h