]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/powerpc/pmu: Add macros to parse event codes
authorMadhavan Srinivasan <maddy@linux.ibm.com>
Thu, 27 Jan 2022 07:19:55 +0000 (12:49 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 1 Mar 2022 12:38:12 +0000 (23:38 +1100)
commit26a9f4d6557916cede748e60b035c99add614c3a
treeeff8f7bd95d4d150ef5ab023f986fc26d4a1734c
parentbc852f59a73c740a2605769caf9d6c32c4f211df
selftests/powerpc/pmu: Add macros to parse event codes

Each platform has raw event encoding format which specifies the bit
positions for different fields. The fields from event code gets
translated into performance monitoring mode control register (MMCRx)
settings. Patch add macros to extract individual fields from the event
code.

Add functions for sanity checks, since testcases currently are only
supported in power9 and power10.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
[mpe: Read PVR directly rather than using /proc/cpuinfo]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-4-kjain@linux.ibm.com
tools/testing/selftests/powerpc/include/reg.h
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h
tools/testing/selftests/powerpc/security/spectre_v2.c