OSDN Git Service

powerpc/perf: Infrastructure to support checking of attr.config*
authorMadhavan Srinivasan <maddy@linux.ibm.com>
Thu, 8 Apr 2021 07:45:03 +0000 (13:15 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 14 Apr 2021 13:04:19 +0000 (23:04 +1000)
commit2e2a441d2c0bb639b6fdbb64b15ee0a43599bcec
tree4a41289e05c6b4abce5e817706987ff47caba53e
parent59fd366b9bef2d048af763e27cd1622ee5a1dfd4
powerpc/perf: Infrastructure to support checking of attr.config*

Introduce code to support the checking of attr.config* for
values which are reserved for a given platform.
Performance Monitoring Unit (PMU) configuration registers
have fields that are reserved and some specific values for
bit fields are reserved. For ex., MMCRA[61:62] is
Random Sampling Mode (SM) and value of 0b11 for this field
is reserved.

Writing non-zero or invalid values in these fields will
have unknown behaviours.

Patch adds a generic call-back function "check_attr_config"
in "struct power_pmu", to be called in event_init to
check for attr.config* values for a given platform.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210408074504.248211-1-maddy@linux.ibm.com
arch/powerpc/include/asm/perf_event_server.h
arch/powerpc/perf/core-book3s.c