.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Performance event support - PowerPC classic/server specific definitions. |
---|
3 | 4 | * |
---|
4 | 5 | * 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. |
---|
10 | 6 | */ |
---|
11 | 7 | |
---|
12 | 8 | #include <linux/types.h> |
---|
.. | .. |
---|
21 | 17 | |
---|
22 | 18 | struct perf_event; |
---|
23 | 19 | |
---|
| 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 | +}; |
---|
24 | 27 | /* |
---|
25 | 28 | * This struct provides the constants and functions needed to |
---|
26 | 29 | * describe the PMU on a particular POWER-family CPU. |
---|
.. | .. |
---|
32 | 35 | unsigned long add_fields; |
---|
33 | 36 | unsigned long test_adder; |
---|
34 | 37 | int (*compute_mmcr)(u64 events[], int n_ev, |
---|
35 | | - unsigned int hwc[], unsigned long mmcr[], |
---|
| 38 | + unsigned int hwc[], struct mmcr_regs *mmcr, |
---|
36 | 39 | struct perf_event *pevents[]); |
---|
37 | 40 | int (*get_constraint)(u64 event_id, unsigned long *mskp, |
---|
38 | 41 | unsigned long *valp); |
---|
.. | .. |
---|
41 | 44 | void (*get_mem_data_src)(union perf_mem_data_src *dsrc, |
---|
42 | 45 | u32 flags, struct pt_regs *regs); |
---|
43 | 46 | void (*get_mem_weight)(u64 *weight); |
---|
| 47 | + unsigned long group_constraint_mask; |
---|
| 48 | + unsigned long group_constraint_val; |
---|
44 | 49 | u64 (*bhrb_filter_map)(u64 branch_sample_type); |
---|
45 | 50 | 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); |
---|
47 | 52 | int (*limited_pmc_event)(u64 event_id); |
---|
48 | 53 | u32 flags; |
---|
49 | 54 | const struct attribute_group **attr_groups; |
---|
50 | 55 | int n_generic; |
---|
51 | 56 | int *generic_events; |
---|
52 | | - int (*cache_events)[PERF_COUNT_HW_CACHE_MAX] |
---|
| 57 | + u64 (*cache_events)[PERF_COUNT_HW_CACHE_MAX] |
---|
53 | 58 | [PERF_COUNT_HW_CACHE_OP_MAX] |
---|
54 | 59 | [PERF_COUNT_HW_CACHE_RESULT_MAX]; |
---|
55 | 60 | |
---|
.. | .. |
---|
57 | 62 | int *blacklist_ev; |
---|
58 | 63 | /* BHRB entries in the PMU */ |
---|
59 | 64 | 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; |
---|
60 | 70 | }; |
---|
61 | 71 | |
---|
62 | 72 | /* |
---|
.. | .. |
---|
71 | 81 | #define PPMU_HAS_SIER 0x00000040 /* Has SIER */ |
---|
72 | 82 | #define PPMU_ARCH_207S 0x00000080 /* PMC is architecture v2.07S */ |
---|
73 | 83 | #define PPMU_NO_SIAR 0x00000100 /* Do not use SIAR */ |
---|
| 84 | +#define PPMU_ARCH_31 0x00000200 /* Has MMCR3, SIER2 and SIER3 */ |
---|
74 | 85 | |
---|
75 | 86 | /* |
---|
76 | 87 | * Values for flags to get_alternatives() |
---|