linux/arch/powerpc/mm
Nathan Fontenot b2d3b5ee66 powerpc/pseries: Track LMB nid instead of using device tree
When removing memory we need to remove the memory from the node
it was added to instead of looking up the node it should be in
in the device tree.

During testing we have seen scenarios where the affinity for a
LMB changes due to a partition migration or PRRN event. In these
cases the node the LMB exists in may not match the node the device
tree indicates it belongs in. This can lead to a system crash
when trying to DLPAR remove the LMB after a migration or PRRN
event. The current code looks up the node in the device tree to
remove the LMB from, the crash occurs when we try to offline this
node and it does not have any data, i.e. node_data[nid] == NULL.

36:mon> e
cpu 0x36: Vector: 300 (Data Access) at [c0000001828b7810]
    pc: c00000000036d08c: try_offline_node+0x2c/0x1b0
    lr: c0000000003a14ec: remove_memory+0xbc/0x110
    sp: c0000001828b7a90
   msr: 800000000280b033
   dar: 9a28
 dsisr: 40000000
  current = 0xc0000006329c4c80
  paca    = 0xc000000007a55200   softe: 0        irq_happened: 0x01
    pid   = 76926, comm = kworker/u320:3

36:mon> t
[link register   ] c0000000003a14ec remove_memory+0xbc/0x110
[c0000001828b7a90] c00000000006a1cc arch_remove_memory+0x9c/0xd0 (unreliable)
[c0000001828b7ad0] c0000000003a14e0 remove_memory+0xb0/0x110
[c0000001828b7b20] c0000000000c7db4 dlpar_remove_lmb+0x94/0x160
[c0000001828b7b60] c0000000000c8ef8 dlpar_memory+0x7e8/0xd10
[c0000001828b7bf0] c0000000000bf828 handle_dlpar_errorlog+0xf8/0x160
[c0000001828b7c60] c0000000000bf8cc pseries_hp_work_fn+0x3c/0xa0
[c0000001828b7c90] c000000000128cd8 process_one_work+0x298/0x5a0
[c0000001828b7d20] c000000000129068 worker_thread+0x88/0x620
[c0000001828b7dc0] c00000000013223c kthread+0x1ac/0x1c0
[c0000001828b7e30] c00000000000b45c ret_from_kernel_thread+0x5c/0x80

To resolve this we need to track the node a LMB belongs to when
it is added to the system so we can remove it from that node instead
of the node that the device tree indicates it should belong to.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2019-04-29 22:27:16 +10:00
..
ptdump powerpc/mm/hash64: Map all the kernel regions in the same 0xc range 2019-04-21 23:12:39 +10:00
8xx_mmu.c powerpc/8xx: Add Kernel Userspace Access Protection 2019-04-21 23:11:46 +10:00
40x_mmu.c powerpc/mm/32: add base address to mmu_mapin_ram() 2019-02-23 21:04:31 +11:00
44x_mmu.c powerpc/mm/32: add base address to mmu_mapin_ram() 2019-02-23 21:04:31 +11:00
copro_fault.c powerpc/mm/hash: Rename KERNEL_REGION_ID to LINEAR_MAP_REGION_ID 2019-04-21 23:12:40 +10:00
dma-noncoherent.c powerpc/dma: use the generic direct mapping bypass 2019-02-18 22:41:04 +11:00
drmem.c powerpc/pseries: Track LMB nid instead of using device tree 2019-04-29 22:27:16 +10:00
fault.c powerpc/mm: Detect bad KUAP faults 2019-04-21 23:06:04 +10:00
fsl_booke_mmu.c powerpc/mm/32: add base address to mmu_mapin_ram() 2019-02-23 21:04:31 +11:00
hash64_4k.c powerpc/mm/hash: Remove the superfluous bitwise operation when find hpte group 2018-07-24 22:03:17 +10:00
hash64_64k.c powerpc/mm/hash: Remove the superfluous bitwise operation when find hpte group 2018-07-24 22:03:17 +10:00
hash_low_32.S powerpc/32s: Prepare Kernel Userspace Access Protection 2019-04-21 23:11:46 +10:00
hash_native_64.c powerpc/64s/hash: Do not use PPC_INVALIDATE_ERAT on CPUs before POWER9 2018-10-04 23:16:53 +10:00
hash_utils_64.c powerpc/mm: fix spelling mistake "Outisde" -> "Outside" 2019-04-28 16:28:23 +10:00
highmem.c powerpc/highmem: Change BUG_ON() to WARN_ON() 2019-04-20 22:02:11 +10:00
hugepage-hash64.c arch/powerpc/mm/hash: validate the pte entries before handling the hash fault 2018-10-03 15:39:59 +10:00
hugetlbpage-book3e.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hugetlbpage-hash64.c powerpc updates for 5.1 2019-03-07 12:56:26 -08:00
hugetlbpage-radix.c powerpc updates for 5.1 2019-03-07 12:56:26 -08:00
hugetlbpage.c powerpc updates for 4.21 2018-12-27 10:43:24 -08:00
init_32.c powerpc: Add framework for Kernel Userspace Protection 2019-04-21 23:05:54 +10:00
init_64.c powerpc/mm: fix "section_base" set but not used 2019-03-02 14:43:05 +11:00
init-common.c powerpc/64: Setup KUP on secondary CPUs 2019-04-21 23:05:59 +10:00
Makefile powerpc/mm: Disable kcov for SLB routines 2019-03-12 14:06:12 +11:00
mem.c powerpc/mm: Fix section mismatch warning 2019-04-21 23:12:40 +10:00
mmap.c exec: pass stack rlimit into mm layout functions 2018-04-11 10:28:37 -07:00
mmu_context_book3s64.c powerc/mm/hash: Reduce hash_mm_context size 2019-04-21 23:12:39 +10:00
mmu_context_hash32.c powerpc: remove unnecessary inclusion of asm/tlbflush.h 2018-07-30 22:48:20 +10:00
mmu_context_iommu.c powerpc/mm/iommu: allow large IOMMU page size only for hugetlb backing 2019-03-05 21:07:19 -08:00
mmu_context_nohash.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
mmu_context.c powerpc/mm: Extend pte_fragment functionality to PPC32 2018-12-04 19:45:01 +11:00
mmu_decl.h powerpc/8xx: don't disable large TLBs with CONFIG_STRICT_KERNEL_RWX 2019-02-23 21:04:32 +11:00
numa.c powerpc/numa: document topology_updates_enabled, disable by default 2019-04-20 22:03:59 +10:00
pgtable_32.c powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX 2019-02-23 21:04:32 +11:00
pgtable_64.c powerpc/mm: fix spelling mistake "Outisde" -> "Outside" 2019-04-28 16:28:23 +10:00
pgtable-book3e.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
pgtable-book3s64.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
pgtable-frag.c mm: treewide: remove unused address argument from pte_alloc functions 2019-01-04 13:13:47 -08:00
pgtable-hash64.c powerpc/mm: fix spelling mistake "Outisde" -> "Outside" 2019-04-28 16:28:23 +10:00
pgtable-radix.c powerpc/mm: fix spelling mistake "Outisde" -> "Outside" 2019-04-28 16:28:23 +10:00
pgtable.c powerpc/mm: add exec protection on powerpc 603 2018-12-19 18:56:32 +11:00
pkeys.c powerpc/64s: Implement KUAP for Radix MMU 2019-04-21 23:06:02 +10:00
ppc_mmu_32.c powerpc/32s: Implement Kernel Userspace Access Protection 2019-04-21 23:11:47 +10:00
slb.c powerpc/mm/hash: Rename KERNEL_REGION_ID to LINEAR_MAP_REGION_ID 2019-04-21 23:12:40 +10:00
slice.c powerpc/mm: Add helpers for accessing hash translation related variables 2019-04-21 23:12:38 +10:00
subpage-prot.c powerc/mm/hash: Reduce hash_mm_context size 2019-04-21 23:12:39 +10:00
tlb_hash32.c powerpc/sparse: Fix plain integer as NULL pointer warning 2018-05-25 12:04:38 +10:00
tlb_hash64.c powerpc/mm: Add support for handling > 512TB address in SLB miss 2018-03-31 00:10:38 +11:00
tlb_low_64e.S powerpc/fsl: Flush the branch predictor at each kernel entry (64bit) 2018-12-20 22:59:03 +11:00
tlb_nohash_low.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
tlb_nohash.c powerpc/mm: Move slb_addr_linit to early_init_mmu 2019-04-21 23:12:39 +10:00
tlb-radix.c powerpc updates for 4.20 2018-10-26 14:36:21 -07:00
vphn.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vphn.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00