linux-stable/arch/powerpc
Anju T Sudhakar 385aeea712 powerpc/perf/imc: Fix nest-imc cpuhotplug callback failure
[ Upstream commit ad2b6e0102 ]

Oops is observed during boot:

  Faulting instruction address: 0xc000000000248340
  cpu 0x0: Vector: 380 (Data Access Out of Range) at [c000000ff66fb850]
      pc: c000000000248340: event_function_call+0x50/0x1f0
      lr: c00000000024878c: perf_remove_from_context+0x3c/0x100
      sp: c000000ff66fbad0
     msr: 9000000000009033
     dar: 7d20e2a6f92d03c0
    pid = 14, comm = cpuhp/0

While registering the cpuhotplug callbacks for nest-imc, if we fail in
the cpuhotplug online path for any random node in a multi node
system (because the opal call to stop nest-imc counters fails for that
node), ppc_nest_imc_cpu_offline() will get invoked for other nodes who
successfully returned from cpuhotplug online path.

This call trace is generated since in the ppc_nest_imc_cpu_offline()
path we are trying to migrate the event context, when nest-imc
counters are not even initialized.

Patch to add a check to ensure that nest-imc is registered before
migrating the event context.

Fixes: 885dcd709b ("powerpc/perf: Add nest IMC PMU support")
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25 11:08:03 +01:00
..
boot .gitignore: move *.dtb and *.dtb.S patterns to the top-level .gitignore 2018-02-13 10:19:46 +01:00
configs powerpc/configs: Update for CONFIG_SND changes 2017-09-20 13:30:09 +10:00
crypto crypto: hash - annotate algorithms taking optional key 2018-02-16 20:23:00 +01:00
include kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK 2018-02-22 15:42:23 +01:00
kernel powerpc: Fix DABR match on hash based systems 2018-02-22 15:42:17 +01:00
kvm KVM: PPC: Book3S PR: Fix broken select due to misspelling 2018-02-16 20:23:03 +01:00
lib powerpc/64s: Add support for RFI flush of L1-D cache 2018-01-23 19:58:10 +01:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm powerpc/mm/radix: Split linear mapping on hot-unplug 2018-02-22 15:42:19 +01:00
net bpf, ppc64: do not reload skb pointers in non-skb context 2017-12-25 14:26:32 +01:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf powerpc/perf/imc: Fix nest-imc cpuhotplug callback failure 2018-02-25 11:08:03 +01:00
platforms powerpc/numa: Invalidate numa_cpu_lookup_table on cpu remove 2018-02-22 15:42:16 +01:00
purgatory License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysdev powerpc/xive: Use hw CPU ids when configuring the CPU queues 2018-02-22 15:42:16 +01:00
tools License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xmon powerpc/xmon: Avoid tripping SMP hardlockup watchdog 2017-12-25 14:26:28 +01:00
Kconfig powerpc/64s: Wire up cpu_show_meltdown() 2018-02-07 11:12:17 -08:00
Kconfig.debug License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile Merge branch 'fixes' into next 2017-08-23 22:20:10 +10:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00