hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/powerpc/include/asm/perf_event_server.h
....@@ -1,12 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Performance event support - PowerPC classic/server specific definitions.
34 *
45 * Copyright 2008-2009 Paul Mackerras, IBM Corporation.
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
106 */
117
128 #include <linux/types.h>
....@@ -21,6 +17,13 @@
2117
2218 struct perf_event;
2319
20
+struct mmcr_regs {
21
+ unsigned long mmcr0;
22
+ unsigned long mmcr1;
23
+ unsigned long mmcr2;
24
+ unsigned long mmcra;
25
+ unsigned long mmcr3;
26
+};
2427 /*
2528 * This struct provides the constants and functions needed to
2629 * describe the PMU on a particular POWER-family CPU.
....@@ -32,7 +35,7 @@
3235 unsigned long add_fields;
3336 unsigned long test_adder;
3437 int (*compute_mmcr)(u64 events[], int n_ev,
35
- unsigned int hwc[], unsigned long mmcr[],
38
+ unsigned int hwc[], struct mmcr_regs *mmcr,
3639 struct perf_event *pevents[]);
3740 int (*get_constraint)(u64 event_id, unsigned long *mskp,
3841 unsigned long *valp);
....@@ -41,15 +44,17 @@
4144 void (*get_mem_data_src)(union perf_mem_data_src *dsrc,
4245 u32 flags, struct pt_regs *regs);
4346 void (*get_mem_weight)(u64 *weight);
47
+ unsigned long group_constraint_mask;
48
+ unsigned long group_constraint_val;
4449 u64 (*bhrb_filter_map)(u64 branch_sample_type);
4550 void (*config_bhrb)(u64 pmu_bhrb_filter);
46
- void (*disable_pmc)(unsigned int pmc, unsigned long mmcr[]);
51
+ void (*disable_pmc)(unsigned int pmc, struct mmcr_regs *mmcr);
4752 int (*limited_pmc_event)(u64 event_id);
4853 u32 flags;
4954 const struct attribute_group **attr_groups;
5055 int n_generic;
5156 int *generic_events;
52
- int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
57
+ u64 (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
5358 [PERF_COUNT_HW_CACHE_OP_MAX]
5459 [PERF_COUNT_HW_CACHE_RESULT_MAX];
5560
....@@ -57,6 +62,11 @@
5762 int *blacklist_ev;
5863 /* BHRB entries in the PMU */
5964 int bhrb_nr;
65
+ /*
66
+ * set this flag with `PERF_PMU_CAP_EXTENDED_REGS` if
67
+ * the pmu supports extended perf regs capability
68
+ */
69
+ int capabilities;
6070 };
6171
6272 /*
....@@ -71,6 +81,7 @@
7181 #define PPMU_HAS_SIER 0x00000040 /* Has SIER */
7282 #define PPMU_ARCH_207S 0x00000080 /* PMC is architecture v2.07S */
7383 #define PPMU_NO_SIAR 0x00000100 /* Do not use SIAR */
84
+#define PPMU_ARCH_31 0x00000200 /* Has MMCR3, SIER2 and SIER3 */
7485
7586 /*
7687 * Values for flags to get_alternatives()