]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf: arm_pmu: Move PMUv3-specific data
authorMark Rutland <mark.rutland@arm.com>
Tue, 18 Feb 2025 20:40:02 +0000 (14:40 -0600)
committerWill Deacon <will@kernel.org>
Sat, 1 Mar 2025 05:08:10 +0000 (05:08 +0000)
A few fields in struct arm_pmu are only used with PMUv3, and soon we
will need to add more for BRBE. Group the fields together so that we
have a logical place to add more data in future.

At the same time, remove the comment for reg_pmmir as it doesn't convey
anything useful.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Tested-by: James Clark <james.clark@linaro.org>
Link: https://lore.kernel.org/r/20250218-arm-brbe-v19-v20-7-4e9922fc2e8e@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
include/linux/perf/arm_pmu.h

index 4b5b83677e3f28b578c1d63a5f89b5f248e06876..c70d528594f26a39a74e00ec353824a484cb55e8 100644 (file)
@@ -84,7 +84,6 @@ struct arm_pmu {
        struct pmu      pmu;
        cpumask_t       supported_cpus;
        char            *name;
-       int             pmuver;
        irqreturn_t     (*handle_irq)(struct arm_pmu *pmu);
        void            (*enable)(struct perf_event *event);
        void            (*disable)(struct perf_event *event);
@@ -102,18 +101,20 @@ struct arm_pmu {
        int             (*map_event)(struct perf_event *event);
        DECLARE_BITMAP(cntr_mask, ARMPMU_MAX_HWEVENTS);
        bool            secure_access; /* 32-bit ARM only */
-#define ARMV8_PMUV3_MAX_COMMON_EVENTS          0x40
-       DECLARE_BITMAP(pmceid_bitmap, ARMV8_PMUV3_MAX_COMMON_EVENTS);
-#define ARMV8_PMUV3_EXT_COMMON_EVENT_BASE      0x4000
-       DECLARE_BITMAP(pmceid_ext_bitmap, ARMV8_PMUV3_MAX_COMMON_EVENTS);
        struct platform_device  *plat_device;
        struct pmu_hw_events    __percpu *hw_events;
        struct hlist_node       node;
        struct notifier_block   cpu_pm_nb;
        /* the attr_groups array must be NULL-terminated */
        const struct attribute_group *attr_groups[ARMPMU_NR_ATTR_GROUPS + 1];
-       /* store the PMMIR_EL1 to expose slots */
+
+       /* PMUv3 only */
+       int             pmuver;
        u64             reg_pmmir;
+#define ARMV8_PMUV3_MAX_COMMON_EVENTS          0x40
+       DECLARE_BITMAP(pmceid_bitmap, ARMV8_PMUV3_MAX_COMMON_EVENTS);
+#define ARMV8_PMUV3_EXT_COMMON_EVENT_BASE      0x4000
+       DECLARE_BITMAP(pmceid_ext_bitmap, ARMV8_PMUV3_MAX_COMMON_EVENTS);
 
        /* Only to be used by ACPI probing code */
        unsigned long acpi_cpuid;