linux-stable/arch/powerpc/perf
Kajol Jain 1f55797de0 powerpc/perf/hv-24x7: Update domain value check
[ Upstream commit 4ff3ba4db5 ]

Valid domain value is in range 1 to HV_PERF_DOMAIN_MAX. Current code has
check for domain value greater than or equal to HV_PERF_DOMAIN_MAX. But
the check for domain value 0 is missing.

Fix this issue by adding check for domain value 0.

Before:
  # ./perf stat -v -e hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/ sleep 1
  Using CPUID 00800200
  Control descriptor is not initialized
  Error:
  The sys_perf_event_open() syscall returned with 5 (Input/output error) for
  event (hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/).
  /bin/dmesg | grep -i perf may provide additional information.

  Result from dmesg:
  [   37.819387] hv-24x7: hcall failed: [0 0x60040000 0x100 0] => ret
  0xfffffffffffffffc (-4) detail=0x2000000 failing ix=0

After:
  # ./perf stat -v -e hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/ sleep 1
  Using CPUID 00800200
  Control descriptor is not initialized
  Warning:
  hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/ event is not supported by the kernel.
  failed to read counter hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/

Fixes: ebd4a5a3eb ("powerpc/perf/hv-24x7: Minor improvements")
Reported-by: Krishan Gopal Sarawast <krishang@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Tested-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230825055601.360083-1-kjain@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-06 13:15:53 +02:00
..
req-gen powerpc/hv-gpci: Fix hv_gpci event list 2022-12-02 20:39:26 +11:00
8xx-pmu.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
bhrb.S powerpc/64: asm use consistent global variable declaration and access 2022-09-28 19:22:12 +10:00
callchain.c powerpc: split validate_sp into two functions 2022-12-02 17:54:09 +11:00
callchain.h powerpc/64s/hash: Make hash faults work in NMI context 2022-02-24 12:46:54 +11:00
callchain_32.c powerpc: Include all arch-specific syscall prototypes 2022-09-28 19:22:08 +10:00
callchain_64.c powerpc/64s/hash: Make hash faults work in NMI context 2022-02-24 12:46:54 +11:00
core-book3s.c perf/core: Add perf_sample_save_brstack() helper 2023-01-18 11:57:20 +01:00
core-fsl-emb.c powerpc/perf: Convert fsl_emb notifier to state machine callbacks 2023-09-13 09:53:31 +02:00
e500-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00
e6500-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00
generic-compat-pmu.c powerpc/perf: Add support for caps under sysfs in powerpc 2022-07-18 10:39:54 +10:00
hv-24x7-catalog.h
hv-24x7-domains.h
hv-24x7.c powerpc/perf/hv-24x7: Update domain value check 2023-10-06 13:15:53 +02:00
hv-24x7.h
hv-common.c
hv-common.h
hv-gpci-requests.h powerpc/hv-gpci: Fix hv_gpci event list 2022-12-02 20:39:26 +11:00
hv-gpci.c powerpc/hv-gpci: Fix hv_gpci event list 2022-12-02 20:39:26 +11:00
hv-gpci.h powerpc/hv-gpci: Fix hv_gpci event list 2022-12-02 20:39:26 +11:00
imc-pmu.c powerpc/imc-pmu: Revert nest_init_lock to being a mutex 2023-01-31 11:24:17 +11:00
internal.h powerpc/perf: Add __init attribute to eligible functions 2021-12-23 22:33:11 +11:00
isa207-common.c powerpc/perf: Update MMCR2 to support event exclude_idle 2022-06-29 19:42:41 +10:00
isa207-common.h powerpc/perf: Update MMCR2 to support event exclude_idle 2022-06-29 19:42:41 +10:00
Makefile powerpc/perf: Fix 32bit compile 2022-04-21 23:26:47 +10:00
mpc7450-pmu.c powerpc/perf: Properly detect mpc7450 family 2023-03-30 23:35:43 +11:00
perf_regs.c powerpc: Use the newly added is_tsk_32bit_task() macro 2022-02-12 22:47:42 +11:00
power5+-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00
power5-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00
power6-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00
power7-events-list.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
power7-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00
power8-events-list.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
power8-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00
power9-events-list.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
power9-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00
power10-events-list.h powerpc/perf: Fix cycles/instructions as PM_CYC/PM_INST_CMPL in power10 2021-10-14 21:46:45 +11:00
power10-pmu.c powerpc/perf: Include caps feature for power10 DD1 version 2022-08-01 22:21:18 +10:00
ppc970-pmu.c powerpc/perf: Use PVR rather than oprofile field to determine CPU version 2022-07-27 21:36:05 +10:00