]> 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)
commit8ba31b612e68db765f199ddbe88d0e4ef4d8e223
treeeff8f7bd95d4d150ef5ab023f986fc26d4a1734c
parent6ad476cba4a7917eeee04c7a458043ba9ee7a125
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