linux-stable/arch/powerpc
Kajol Jain c2019f0a68 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 14:56:38 +02:00
..
boot powerpc/boot: Disable power10 features after BOOTAFLAGS assignment 2023-09-13 09:42:20 +02:00
configs - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
crypto treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
include powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-09-13 09:42:48 +02:00
kernel powerpc/iommu: Fix notifiers being shared by PCI and VIO buses 2023-09-13 09:42:48 +02:00
kexec powerpc/64/kdump: Limit kdump base to 512MB 2022-09-28 19:22:09 +10:00
kvm powerpc: Don't include lppaca.h in paca.h 2023-09-13 09:42:48 +02:00
lib powerpc: Fix reschedule bug in KUAP-unlocked user copy 2022-10-18 22:46:19 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc: Don't include lppaca.h in paca.h 2023-09-13 09:42:48 +02:00
net powerpc/bpf/32: Only set a stack frame when necessary 2023-03-17 08:50:30 +01:00
perf powerpc/perf/hv-24x7: Update domain value check 2023-10-06 14:56:38 +02:00
platforms powerpc/pseries: fix possible memory leak in ibmebus_bus_init() 2023-09-23 11:11:05 +02:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-21 16:00:55 +02:00
sysdev powerpc/mpc5xxx: Add missing fwnode_handle_put() 2023-09-13 09:42:48 +02:00
tools powerpc/64: Add UADDR64 relocation support 2022-03-09 21:47:53 +11:00
xmon powerpc: Don't include lppaca.h in paca.h 2023-09-13 09:42:48 +02:00
Kbuild
Kconfig powerpc/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:24 +02:00
Kconfig.debug powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y 2023-07-19 16:22:04 +02:00
Makefile powerpc: Fail build if using recordmcount with binutils v2.37 2023-07-23 13:49:32 +02:00
Makefile.postlink