kernel-ark/arch/powerpc/perf
Ravi Bangoria 5aa04b3eb6 powerpc/perf: Fix oops when grouping different pmu events
When user tries to group imc (In-Memory Collections) event with
normal event, (sometime) kernel crashes with following log:

    Faulting instruction address: 0x00000000
    [link register   ] c00000000010ce88 power_check_constraints+0x128/0x980
    ...
    c00000000010e238 power_pmu_event_init+0x268/0x6f0
    c0000000002dc60c perf_try_init_event+0xdc/0x1a0
    c0000000002dce88 perf_event_alloc+0x7b8/0xac0
    c0000000002e92e0 SyS_perf_event_open+0x530/0xda0
    c00000000000b004 system_call+0x38/0xe0

'event_base' field of 'struct hw_perf_event' is used as flags for
normal hw events and used as memory address for imc events. While
grouping these two types of events, collect_events() tries to
interpret imc 'event_base' as a flag, which causes a corruption
resulting in a crash.

Consider only those events which belongs to 'perf_hw_context' in
collect_events().

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Reviewed-By: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-12-04 16:03:19 +11:00
..
req-gen License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
8xx-pmu.c powerpc/8xx: Perf events on PPC 8xx 2017-01-26 17:49:34 -06:00
bhrb.S powerpc/perf: Add basic assembly code to read BHRB entries on POWER8 2013-04-26 16:11:11 +10:00
callchain.c powerpc/mm: Rename find_linux_pte_or_hugepte() 2017-08-17 23:13:46 +10:00
core-book3s.c powerpc/perf: Fix oops when grouping different pmu events 2017-12-04 16:03:19 +11:00
core-fsl-emb.c perf/powerpc: reset event hw state when adding it to the PMU 2015-01-29 23:44:18 -06:00
e500-pmu.c
e6500-pmu.c powerpc/perf: Add e6500 PMU driver 2013-08-07 18:38:04 -05:00
hv-24x7-catalog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-24x7-domains.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-24x7.c powerpc/perf/hv-24x7: Fix incorrect comparison in memord 2017-10-22 12:08:31 +02:00
hv-24x7.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-common.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-gpci-requests.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-gpci.c powerpc/sparse: Make a bunch of things static 2016-09-13 17:35:47 +10:00
hv-gpci.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
imc-pmu.c powerpc/perf: Fix IMC_MAX_PMU macro 2017-11-22 23:04:23 +11:00
isa207-common.c powerpc/perf: Factor out PPMU_ONLY_COUNT_RUN check code from power8 2017-08-10 22:30:05 +10:00
isa207-common.h powerpc/perf: Factor out PPMU_ONLY_COUNT_RUN check code from power8 2017-08-10 22:30:05 +10:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mpc7450-pmu.c powerpc/perf: Pass the struct perf_events down to compute_mmcr() 2014-07-28 14:30:47 +10:00
perf_regs.c powerpc/perf: Fix oops when kthread execs user process 2017-06-16 21:02:46 +10:00
power4-pmu.c powerpc/perf: Pass the struct perf_events down to compute_mmcr() 2014-07-28 14:30:47 +10:00
power5-pmu.c powerpc/perf: Pass the struct perf_events down to compute_mmcr() 2014-07-28 14:30:47 +10:00
power5+-pmu.c powerpc/perf: Pass the struct perf_events down to compute_mmcr() 2014-07-28 14:30:47 +10:00
power6-pmu.c powerpc/perf: Pass the struct perf_events down to compute_mmcr() 2014-07-28 14:30:47 +10:00
power7-events-list.h powerpc/perf: Make some new raw event codes available in sysfs 2014-03-24 09:48:23 +11:00
power7-pmu.c powerpc/sparse: Make a bunch of things static 2016-09-13 17:35:47 +10:00
power8-events-list.h powerpc/perf: Add Power8 mem_access event to sysfs 2017-04-19 20:00:23 +10:00
power8-pmu.c powerpc/perf: Factor out PPMU_ONLY_COUNT_RUN check code from power8 2017-08-10 22:30:05 +10:00
power9-events-list.h powerpc/perf: Cleanup of PM_BR_CMPL vs. PM_BRU_CMPL in Power9 event list 2017-08-10 22:30:06 +10:00
power9-pmu.c powerpc/perf: Cleanup of PM_BR_CMPL vs. PM_BRU_CMPL in Power9 event list 2017-08-10 22:30:06 +10:00
ppc970-pmu.c powerpc/perf: Pass the struct perf_events down to compute_mmcr() 2014-07-28 14:30:47 +10:00