linux/arch/powerpc/platforms/powermac
Nicholas Piggin 01b0f0eae0 powerpc/64s: Trim offlined CPUs from mm_cpumasks
When offlining a CPU, powerpc/64s does not flush TLBs, rather it just
leaves the CPU set in mm_cpumasks, so it continues to receive TLBIEs
to manage its TLBs.

However the exit_flush_lazy_tlbs() function expects that after
returning, all CPUs (except self) have flushed TLBs for that mm, in
which case TLBIEL can be used for this flush. This breaks for offline
CPUs because they don't get the IPI to flush their TLB. This can lead
to stale translations.

Fix this by clearing the CPU from mm_cpumasks, then flushing all TLBs
before going offline.

These offlined CPU bits stuck in the cpumask also prevents the cpumask
from being trimmed back to local mode, which means continual broadcast
IPIs or TLBIEs are needed for TLB flushing. This patch prevents that
situation too.

A cast of many were involved in working this out, but in particular
Milton, Aneesh, Paul made key discoveries.

Fixes: 0cef77c779 ("powerpc/64s/radix: flush remote CPUs out of single-threaded mm_cpumask")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Debugged-by: Milton Miller <miltonm@us.ibm.com>
Debugged-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Debugged-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201126102530.691335-5-npiggin@gmail.com
2020-11-27 00:10:39 +11:00
..
backlight.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
bootx_init.c powerpc: Replace _ALIGN() by ALIGN() 2020-05-11 23:15:16 +10:00
cache.S powerpc/powermac: Blacklist functions running with MMU disabled for kprobe 2020-06-02 20:59:09 +10:00
feature.c powerpc: Use fallthrough pseudo-keyword 2020-07-29 21:09:37 +10:00
Kconfig powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac 2019-06-19 22:31:20 +10:00
low_i2c.c powerpc: use for_each_child_of_node() macro 2020-07-29 22:30:33 +10:00
Makefile kbuild: remove cc-option test of -fno-stack-protector 2020-07-07 11:13:10 +09:00
nvram.c powerpc: Replace zero-length array with flexible-array 2020-05-15 11:58:54 +10:00
pci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pfunc_base.c powerpc: use for_each_child_of_node() macro 2020-07-29 22:30:33 +10:00
pfunc_core.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
pic.c powerpc: Replace setup_irq() by request_irq() 2020-03-25 12:07:57 +11:00
pmac.h powerpc/smp: Move ppc_md.cpu_die() to smp_ops.cpu_offline_self() 2020-09-18 19:59:43 +10:00
setup.c powerpc: Remove support for PowerPC 601 2020-10-08 21:17:13 +11:00
sleep.S powerpc/smp: Move ppc_md.cpu_die() to smp_ops.cpu_offline_self() 2020-09-18 19:59:43 +10:00
smp.c powerpc/64s: Trim offlined CPUs from mm_cpumasks 2020-11-27 00:10:39 +11:00
time.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
udbg_adb.c powerpc: Use device_type helpers to access the node type 2018-11-26 22:33:37 +11:00
udbg_scc.c powerpc: use for_each_child_of_node() macro 2020-07-29 22:30:33 +10:00