linux_dsm_epyc7002/arch/powerpc/mm/book3s64
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
..
hash_4k.c powerpc/mm: Move book3s64 specifics in subdirectory mm/book3s64 2019-05-03 01:18:38 +10:00
hash_64k.c powerpc/mm: Move book3s64 specifics in subdirectory mm/book3s64 2019-05-03 01:18:38 +10:00
hash_hugepage.c powerpc/mm: Move book3s64 specifics in subdirectory mm/book3s64 2019-05-03 01:18:38 +10:00
hash_hugetlbpage.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
hash_native.c powerpc/64s/pseries: Fix hash tlbiel_all_isa300 for guest kernels 2020-11-27 00:10:39 +11:00
hash_pgtable.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
hash_tlb.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
hash_utils.c powerpc updates for 5.10 2020-10-16 12:21:15 -07:00
internal.h powerpc/mm/64s: Fix slb_setup_new_exec() sparse warning 2020-09-18 19:59:43 +10:00
iommu_api.c mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
Makefile powerpc/pseries: Move mm/book3s64/vphn.c under platforms/pseries/ 2019-07-04 22:23:38 +10:00
mmu_context.c powerpc/64s: Trim offlined CPUs from mm_cpumasks 2020-11-27 00:10:39 +11:00
pgtable.c powerpc/book3s64/keys/kuap: Reset AMR/IAMR values on kexec 2020-07-20 22:57:59 +10:00
pkeys.c powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne X1000) 2020-08-10 23:07:21 +10:00
radix_hugetlbpage.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
radix_pgtable.c powerpc updates for 5.10 2020-10-16 12:21:15 -07:00
radix_tlb.c powerpc/64s: Add cp_abort after tlbiel to invalidate copy-buffer address 2020-10-06 23:22:23 +11:00
slb.c powerpc/mm/book3s: Split radix and hash MAX_PHYSMEM limit 2020-09-15 22:13:22 +10:00
subpage_prot.c mmap locking API: convert mmap_sem comments 2020-06-09 09:39:14 -07:00