Skip to content

Commit

Permalink
powerpc/perf: Power11 Performance Monitoring support
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/[email protected]
  • Loading branch information
maddy-kerneldev authored and mpe committed Feb 21, 2024
1 parent c2ed087 commit b22ea62
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -2593,6 +2593,8 @@ static int __init init_ppc64_pmu(void)
return 0;
else if (!init_power10_pmu())
return 0;
else if (!init_power11_pmu())
return 0;
else if (!init_ppc970_pmu())
return 0;
else
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/perf/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ int __init init_power7_pmu(void);
int __init init_power8_pmu(void);
int __init init_power9_pmu(void);
int __init init_power10_pmu(void);
int __init init_power11_pmu(void);
int __init init_generic_compat_pmu(void);
27 changes: 27 additions & 0 deletions arch/powerpc/perf/power10-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit b22ea62

Please sign in to comment.