diff options
author | Madhavan Srinivasan <maddy@linux.ibm.com> | 2024-02-21 07:46:23 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2024-02-21 15:11:00 +0300 |
commit | b22ea627225b53ec7ce25c19d6df9fa8217d1643 (patch) | |
tree | 3e55159e1e1a86fa35aebe8f39ba398ed9c4d5a6 /arch/powerpc/perf/power10-pmu.c | |
parent | c2ed087ed35ca569d8179924ba560be248c758e5 (diff) | |
download | linux-b22ea627225b53ec7ce25c19d6df9fa8217d1643.tar.xz |
powerpc/perf: Power11 Performance Monitoring support
Base enablement patch to register performance monitoring
hardware support for Power11. Most of fields are copied
from power10_pmu struct for power11_pmu struct.
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240221044623.1598642-2-mpe@ellerman.id.au
Diffstat (limited to 'arch/powerpc/perf/power10-pmu.c')
-rw-r--r-- | arch/powerpc/perf/power10-pmu.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/powerpc/perf/power10-pmu.c b/arch/powerpc/perf/power10-pmu.c index 9b5133e361a7..62a68b6b2d4b 100644 --- a/arch/powerpc/perf/power10-pmu.c +++ b/arch/powerpc/perf/power10-pmu.c @@ -634,3 +634,30 @@ int __init init_power10_pmu(void) return 0; } + +static struct power_pmu power11_pmu; + +int __init init_power11_pmu(void) +{ + unsigned int pvr; + int rc; + + pvr = mfspr(SPRN_PVR); + if (PVR_VER(pvr) != PVR_POWER11) + return -ENODEV; + + /* Set the PERF_REG_EXTENDED_MASK here */ + PERF_REG_EXTENDED_MASK = PERF_REG_PMU_MASK_31; + + power11_pmu = power10_pmu; + power11_pmu.name = "Power11"; + + rc = register_power_pmu(&power11_pmu); + if (rc) + return rc; + + /* Tell userspace that EBB is supported */ + cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB; + + return 0; +} |