Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Madhavan Srinivasan and committed by
Michael Ellerman
b22ea627 c2ed087e

+30
+2
arch/powerpc/perf/core-book3s.c
··· 2593 2593 return 0; 2594 2594 else if (!init_power10_pmu()) 2595 2595 return 0; 2596 + else if (!init_power11_pmu()) 2597 + return 0; 2596 2598 else if (!init_ppc970_pmu()) 2597 2599 return 0; 2598 2600 else
+1
arch/powerpc/perf/internal.h
··· 10 10 int __init init_power8_pmu(void); 11 11 int __init init_power9_pmu(void); 12 12 int __init init_power10_pmu(void); 13 + int __init init_power11_pmu(void); 13 14 int __init init_generic_compat_pmu(void);
+27
arch/powerpc/perf/power10-pmu.c
··· 634 634 635 635 return 0; 636 636 } 637 + 638 + static struct power_pmu power11_pmu; 639 + 640 + int __init init_power11_pmu(void) 641 + { 642 + unsigned int pvr; 643 + int rc; 644 + 645 + pvr = mfspr(SPRN_PVR); 646 + if (PVR_VER(pvr) != PVR_POWER11) 647 + return -ENODEV; 648 + 649 + /* Set the PERF_REG_EXTENDED_MASK here */ 650 + PERF_REG_EXTENDED_MASK = PERF_REG_PMU_MASK_31; 651 + 652 + power11_pmu = power10_pmu; 653 + power11_pmu.name = "Power11"; 654 + 655 + rc = register_power_pmu(&power11_pmu); 656 + if (rc) 657 + return rc; 658 + 659 + /* Tell userspace that EBB is supported */ 660 + cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB; 661 + 662 + return 0; 663 + }