xref: /freebsd/sys/dev/hwpmc/pmc_events.h (revision d4eeb02986980bf33dd56c41ceb9fc5f180c0d47)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2005  Joseph Koshy
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30 
31 #ifndef _DEV_HWPMC_PMC_EVENTS_H_
32 #define	_DEV_HWPMC_PMC_EVENTS_H_
33 
34 /*
35  * Note: Documentation on adding events can be found both in
36  * the source tree at src/share/doc/papers/hwpmc/hwpmc.ms
37  * as well as on-line at:
38  *
39  * https://wiki.freebsd.org/PmcTools/PmcHardwareHowTo
40  *
41  * Please refer to those resources before you attempt to modify
42  * this file or the hwpmc driver/subsystem.
43  */
44 
45 /* * PMC event codes.
46  *
47  * __PMC_EV(CLASS, SYMBOLIC-NAME)
48  *
49  */
50 /* timestamp counters. */
51 #define        __PMC_EV_TSC()                                                  \
52 	__PMC_EV(TSC, TSC)
53 
54 #define        PMC_EV_TSC_FIRST        PMC_EV_TSC_TSC
55 #define        PMC_EV_TSC_LAST         PMC_EV_TSC_TSC
56 
57 #define	__PMC_EV_ALIAS_TSC()			\
58 __PMC_EV_ALIAS("cycles",	TSC_TSC)
59 
60 /*
61  * Software events are dynamically defined.
62  */
63 
64 #define        PMC_EV_DYN_COUNT        0x1000
65 
66 #define        PMC_EV_SOFT_FIRST       0x20000
67 #define        PMC_EV_SOFT_LAST        (PMC_EV_SOFT_FIRST + PMC_EV_DYN_COUNT - 1)
68 
69 /*
70  * AMD K7 Events, from "The AMD Athlon(tm) Processor x86 Code
71  * Optimization Guide" [Doc#22007K, Feb 2002]
72  */
73 
74 #define	__PMC_EV_K7()					\
75 __PMC_EV(K7, DC_ACCESSES)				\
76 __PMC_EV(K7, DC_MISSES)					\
77 __PMC_EV(K7, DC_REFILLS_FROM_L2)			\
78 __PMC_EV(K7, DC_REFILLS_FROM_SYSTEM)			\
79 __PMC_EV(K7, DC_WRITEBACKS)				\
80 __PMC_EV(K7, L1_DTLB_MISS_AND_L2_DTLB_HITS)		\
81 __PMC_EV(K7, L1_AND_L2_DTLB_MISSES)			\
82 __PMC_EV(K7, MISALIGNED_REFERENCES)			\
83 __PMC_EV(K7, IC_FETCHES)				\
84 __PMC_EV(K7, IC_MISSES)					\
85 __PMC_EV(K7, L1_ITLB_MISSES)				\
86 __PMC_EV(K7, L1_L2_ITLB_MISSES)				\
87 __PMC_EV(K7, RETIRED_INSTRUCTIONS)			\
88 __PMC_EV(K7, RETIRED_OPS)				\
89 __PMC_EV(K7, RETIRED_BRANCHES)				\
90 __PMC_EV(K7, RETIRED_BRANCHES_MISPREDICTED)		\
91 __PMC_EV(K7, RETIRED_TAKEN_BRANCHES)			\
92 __PMC_EV(K7, RETIRED_TAKEN_BRANCHES_MISPREDICTED)	\
93 __PMC_EV(K7, RETIRED_FAR_CONTROL_TRANSFERS)		\
94 __PMC_EV(K7, RETIRED_RESYNC_BRANCHES)			\
95 __PMC_EV(K7, INTERRUPTS_MASKED_CYCLES)			\
96 __PMC_EV(K7, INTERRUPTS_MASKED_WHILE_PENDING_CYCLES)	\
97 __PMC_EV(K7, HARDWARE_INTERRUPTS)
98 
99 #define	PMC_EV_K7_FIRST	PMC_EV_K7_DC_ACCESSES
100 #define	PMC_EV_K7_LAST	PMC_EV_K7_HARDWARE_INTERRUPTS
101 
102 /* AMD K8 PMCs */
103 
104 #define	__PMC_EV_K8()							\
105 __PMC_EV(K8, FP_DISPATCHED_FPU_OPS)					\
106 __PMC_EV(K8, FP_CYCLES_WITH_NO_FPU_OPS_RETIRED)				\
107 __PMC_EV(K8, FP_DISPATCHED_FPU_FAST_FLAG_OPS)				\
108 __PMC_EV(K8, LS_SEGMENT_REGISTER_LOAD)					\
109 __PMC_EV(K8, LS_MICROARCHITECTURAL_RESYNC_BY_SELF_MODIFYING_CODE)	\
110 __PMC_EV(K8, LS_MICROARCHITECTURAL_RESYNC_BY_SNOOP)			\
111 __PMC_EV(K8, LS_BUFFER2_FULL)						\
112 __PMC_EV(K8, LS_LOCKED_OPERATION)					\
113 __PMC_EV(K8, LS_MICROARCHITECTURAL_LATE_CANCEL)				\
114 __PMC_EV(K8, LS_RETIRED_CFLUSH_INSTRUCTIONS)				\
115 __PMC_EV(K8, LS_RETIRED_CPUID_INSTRUCTIONS)				\
116 __PMC_EV(K8, DC_ACCESS)							\
117 __PMC_EV(K8, DC_MISS)							\
118 __PMC_EV(K8, DC_REFILL_FROM_L2)						\
119 __PMC_EV(K8, DC_REFILL_FROM_SYSTEM)					\
120 __PMC_EV(K8, DC_COPYBACK)						\
121 __PMC_EV(K8, DC_L1_DTLB_MISS_AND_L2_DTLB_HIT)				\
122 __PMC_EV(K8, DC_L1_DTLB_MISS_AND_L2_DTLB_MISS)				\
123 __PMC_EV(K8, DC_MISALIGNED_DATA_REFERENCE)				\
124 __PMC_EV(K8, DC_MICROARCHITECTURAL_LATE_CANCEL)				\
125 __PMC_EV(K8, DC_MICROARCHITECTURAL_EARLY_CANCEL)			\
126 __PMC_EV(K8, DC_ONE_BIT_ECC_ERROR)					\
127 __PMC_EV(K8, DC_DISPATCHED_PREFETCH_INSTRUCTIONS)			\
128 __PMC_EV(K8, DC_DCACHE_ACCESSES_BY_LOCKS)				\
129 __PMC_EV(K8, BU_CPU_CLK_UNHALTED)					\
130 __PMC_EV(K8, BU_INTERNAL_L2_REQUEST)					\
131 __PMC_EV(K8, BU_FILL_REQUEST_L2_MISS)					\
132 __PMC_EV(K8, BU_FILL_INTO_L2)						\
133 __PMC_EV(K8, IC_FETCH)							\
134 __PMC_EV(K8, IC_MISS)							\
135 __PMC_EV(K8, IC_REFILL_FROM_L2)						\
136 __PMC_EV(K8, IC_REFILL_FROM_SYSTEM)					\
137 __PMC_EV(K8, IC_L1_ITLB_MISS_AND_L2_ITLB_HIT)				\
138 __PMC_EV(K8, IC_L1_ITLB_MISS_AND_L2_ITLB_MISS)				\
139 __PMC_EV(K8, IC_MICROARCHITECTURAL_RESYNC_BY_SNOOP)			\
140 __PMC_EV(K8, IC_INSTRUCTION_FETCH_STALL)				\
141 __PMC_EV(K8, IC_RETURN_STACK_HIT)					\
142 __PMC_EV(K8, IC_RETURN_STACK_OVERFLOW)					\
143 __PMC_EV(K8, FR_RETIRED_X86_INSTRUCTIONS)				\
144 __PMC_EV(K8, FR_RETIRED_UOPS)						\
145 __PMC_EV(K8, FR_RETIRED_BRANCHES)					\
146 __PMC_EV(K8, FR_RETIRED_BRANCHES_MISPREDICTED)				\
147 __PMC_EV(K8, FR_RETIRED_TAKEN_BRANCHES)					\
148 __PMC_EV(K8, FR_RETIRED_TAKEN_BRANCHES_MISPREDICTED)			\
149 __PMC_EV(K8, FR_RETIRED_FAR_CONTROL_TRANSFERS)				\
150 __PMC_EV(K8, FR_RETIRED_RESYNCS)					\
151 __PMC_EV(K8, FR_RETIRED_NEAR_RETURNS)					\
152 __PMC_EV(K8, FR_RETIRED_NEAR_RETURNS_MISPREDICTED)			\
153 __PMC_EV(K8, FR_RETIRED_TAKEN_BRANCHES_MISPREDICTED_BY_ADDR_MISCOMPARE)	\
154 __PMC_EV(K8, FR_RETIRED_FPU_INSTRUCTIONS)				\
155 __PMC_EV(K8, FR_RETIRED_FASTPATH_DOUBLE_OP_INSTRUCTIONS)		\
156 __PMC_EV(K8, FR_INTERRUPTS_MASKED_CYCLES)				\
157 __PMC_EV(K8, FR_INTERRUPTS_MASKED_WHILE_PENDING_CYCLES)			\
158 __PMC_EV(K8, FR_TAKEN_HARDWARE_INTERRUPTS)				\
159 __PMC_EV(K8, FR_DECODER_EMPTY)						\
160 __PMC_EV(K8, FR_DISPATCH_STALLS)					\
161 __PMC_EV(K8, FR_DISPATCH_STALL_FROM_BRANCH_ABORT_TO_RETIRE)		\
162 __PMC_EV(K8, FR_DISPATCH_STALL_FOR_SERIALIZATION)			\
163 __PMC_EV(K8, FR_DISPATCH_STALL_FOR_SEGMENT_LOAD)			\
164 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_REORDER_BUFFER_IS_FULL)		\
165 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_RESERVATION_STATIONS_ARE_FULL)	\
166 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_FPU_IS_FULL)			\
167 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_LS_IS_FULL)				\
168 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_WAITING_FOR_ALL_TO_BE_QUIET)	\
169 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_FAR_XFER_OR_RESYNC_BRANCH_PENDING)	\
170 __PMC_EV(K8, FR_FPU_EXCEPTIONS)						\
171 __PMC_EV(K8, FR_NUMBER_OF_BREAKPOINTS_FOR_DR0)				\
172 __PMC_EV(K8, FR_NUMBER_OF_BREAKPOINTS_FOR_DR1)				\
173 __PMC_EV(K8, FR_NUMBER_OF_BREAKPOINTS_FOR_DR2)				\
174 __PMC_EV(K8, FR_NUMBER_OF_BREAKPOINTS_FOR_DR3)				\
175 __PMC_EV(K8, NB_MEMORY_CONTROLLER_PAGE_ACCESS_EVENT)			\
176 __PMC_EV(K8, NB_MEMORY_CONTROLLER_PAGE_TABLE_OVERFLOW)			\
177 __PMC_EV(K8, NB_MEMORY_CONTROLLER_DRAM_COMMAND_SLOTS_MISSED)		\
178 __PMC_EV(K8, NB_MEMORY_CONTROLLER_TURNAROUND)				\
179 __PMC_EV(K8, NB_MEMORY_CONTROLLER_BYPASS_SATURATION)			\
180 __PMC_EV(K8, NB_SIZED_COMMANDS)						\
181 __PMC_EV(K8, NB_PROBE_RESULT)						\
182 __PMC_EV(K8, NB_HT_BUS0_BANDWIDTH)					\
183 __PMC_EV(K8, NB_HT_BUS1_BANDWIDTH)					\
184 __PMC_EV(K8, NB_HT_BUS2_BANDWIDTH)
185 
186 #define	PMC_EV_K8_FIRST		PMC_EV_K8_FP_DISPATCHED_FPU_OPS
187 #define	PMC_EV_K8_LAST		PMC_EV_K8_NB_HT_BUS2_BANDWIDTH
188 
189 /*
190  * Events supported by Intel architectural fixed function counters,
191  * from the "Intel 64 and IA-32 Architectures Software Developer's
192  * Manual Volume 3B: System Programming Guide, Part 2", July 2008.
193  */
194 #define	__PMC_EV_IAF()							\
195 __PMC_EV(IAF, INSTR_RETIRED_ANY)					\
196 __PMC_EV(IAF, CPU_CLK_UNHALTED_CORE)					\
197 __PMC_EV(IAF, CPU_CLK_UNHALTED_REF)
198 
199 #define	PMC_EV_IAF_FIRST	PMC_EV_IAF_INSTR_RETIRED_ANY
200 #define	PMC_EV_IAF_LAST		PMC_EV_IAF_CPU_CLK_UNHALTED_REF
201 
202 #define	__PMC_EV_ALIAS_IAF()						\
203 __PMC_EV_ALIAS("instruction-retired",	IAF_INSTR_RETIRED_ANY)		\
204 __PMC_EV_ALIAS("unhalted-core-cycles",	IAF_CPU_CLK_UNHALTED_CORE)	\
205 __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF)
206 
207 
208 #define	PMC_EV_IAP_FIRST	PMC_EV_IAP_ARCH_BR_INS_RET
209 #define	PMC_EV_IAP_LAST		PMC_EV_IAP_EVENT_FDH_40H
210 
211 /*
212  * Map "architectural" event names to event ids.
213  */
214 #define	__PMC_EV_ALIAS_INTEL_ARCHITECTURAL()				\
215 __PMC_EV_ALIAS("branch-instruction-retired",	IAP_ARCH_BR_INS_RET)	\
216 __PMC_EV_ALIAS("branch-misses-retired",		IAP_ARCH_BR_MIS_RET)	\
217 __PMC_EV_ALIAS("instruction-retired",		IAP_ARCH_INS_RET)	\
218 __PMC_EV_ALIAS("llc-misses",			IAP_ARCH_LLC_MIS)	\
219 __PMC_EV_ALIAS("llc-reference",			IAP_ARCH_LLC_REF)	\
220 __PMC_EV_ALIAS("unhalted-reference-cycles",	IAP_ARCH_UNH_REF_CYC)	\
221 __PMC_EV_ALIAS("unhalted-core-cycles",		IAP_ARCH_UNH_COR_CYC)
222 
223 #define        __PMC_EV_UCP()                          \
224 	__PMC_EV(UCP, EVENT_0CH_04H_E)					   \
225 	__PMC_EV(UCP, EVENT_0CH_04H_F)					   \
226 	__PMC_EV(UCP, EVENT_0CH_04H_M)					   \
227 	__PMC_EV(UCP, EVENT_0CH_04H_S)					   \
228 	__PMC_EV(UCP, EVENT_0CH_08H_E)					   \
229 	__PMC_EV(UCP, EVENT_0CH_08H_F)					   \
230 	__PMC_EV(UCP, EVENT_0CH_08H_M)					   \
231 	__PMC_EV(UCP, EVENT_0CH_08H_S)					   \
232 
233 /*
234  * ARMv7 Events
235  */
236 
237 #define	__PMC_EV_ARMV7()			\
238 	__PMC_EV(ARMV7, EVENT_00H)		\
239 	__PMC_EV(ARMV7, EVENT_01H)		\
240 	__PMC_EV(ARMV7, EVENT_02H)		\
241 	__PMC_EV(ARMV7, EVENT_03H)		\
242 	__PMC_EV(ARMV7, EVENT_04H)		\
243 	__PMC_EV(ARMV7, EVENT_05H)		\
244 	__PMC_EV(ARMV7, EVENT_06H)		\
245 	__PMC_EV(ARMV7, EVENT_07H)		\
246 	__PMC_EV(ARMV7, EVENT_08H)		\
247 	__PMC_EV(ARMV7, EVENT_09H)		\
248 	__PMC_EV(ARMV7, EVENT_0AH)		\
249 	__PMC_EV(ARMV7, EVENT_0BH)		\
250 	__PMC_EV(ARMV7, EVENT_0CH)		\
251 	__PMC_EV(ARMV7, EVENT_0DH)		\
252 	__PMC_EV(ARMV7, EVENT_0EH)		\
253 	__PMC_EV(ARMV7, EVENT_0FH)		\
254 	__PMC_EV(ARMV7, EVENT_10H)		\
255 	__PMC_EV(ARMV7, EVENT_11H)		\
256 	__PMC_EV(ARMV7, EVENT_12H)		\
257 	__PMC_EV(ARMV7, EVENT_13H)		\
258 	__PMC_EV(ARMV7, EVENT_14H)		\
259 	__PMC_EV(ARMV7, EVENT_15H)		\
260 	__PMC_EV(ARMV7, EVENT_16H)		\
261 	__PMC_EV(ARMV7, EVENT_17H)		\
262 	__PMC_EV(ARMV7, EVENT_18H)		\
263 	__PMC_EV(ARMV7, EVENT_19H)		\
264 	__PMC_EV(ARMV7, EVENT_1AH)		\
265 	__PMC_EV(ARMV7, EVENT_1BH)		\
266 	__PMC_EV(ARMV7, EVENT_1CH)		\
267 	__PMC_EV(ARMV7, EVENT_1DH)		\
268 	__PMC_EV(ARMV7, EVENT_1EH)		\
269 	__PMC_EV(ARMV7, EVENT_1FH)		\
270 	__PMC_EV(ARMV7, EVENT_20H)		\
271 	__PMC_EV(ARMV7, EVENT_21H)		\
272 	__PMC_EV(ARMV7, EVENT_22H)		\
273 	__PMC_EV(ARMV7, EVENT_23H)		\
274 	__PMC_EV(ARMV7, EVENT_24H)		\
275 	__PMC_EV(ARMV7, EVENT_25H)		\
276 	__PMC_EV(ARMV7, EVENT_26H)		\
277 	__PMC_EV(ARMV7, EVENT_27H)		\
278 	__PMC_EV(ARMV7, EVENT_28H)		\
279 	__PMC_EV(ARMV7, EVENT_29H)		\
280 	__PMC_EV(ARMV7, EVENT_2AH)		\
281 	__PMC_EV(ARMV7, EVENT_2BH)		\
282 	__PMC_EV(ARMV7, EVENT_2CH)		\
283 	__PMC_EV(ARMV7, EVENT_2DH)		\
284 	__PMC_EV(ARMV7, EVENT_2EH)		\
285 	__PMC_EV(ARMV7, EVENT_2FH)		\
286 	__PMC_EV(ARMV7, EVENT_30H)		\
287 	__PMC_EV(ARMV7, EVENT_31H)		\
288 	__PMC_EV(ARMV7, EVENT_32H)		\
289 	__PMC_EV(ARMV7, EVENT_33H)		\
290 	__PMC_EV(ARMV7, EVENT_34H)		\
291 	__PMC_EV(ARMV7, EVENT_35H)		\
292 	__PMC_EV(ARMV7, EVENT_36H)		\
293 	__PMC_EV(ARMV7, EVENT_37H)		\
294 	__PMC_EV(ARMV7, EVENT_38H)		\
295 	__PMC_EV(ARMV7, EVENT_39H)		\
296 	__PMC_EV(ARMV7, EVENT_3AH)		\
297 	__PMC_EV(ARMV7, EVENT_3BH)		\
298 	__PMC_EV(ARMV7, EVENT_3CH)		\
299 	__PMC_EV(ARMV7, EVENT_3DH)		\
300 	__PMC_EV(ARMV7, EVENT_3EH)		\
301 	__PMC_EV(ARMV7, EVENT_3FH)		\
302 	__PMC_EV(ARMV7, EVENT_40H)		\
303 	__PMC_EV(ARMV7, EVENT_41H)		\
304 	__PMC_EV(ARMV7, EVENT_42H)		\
305 	__PMC_EV(ARMV7, EVENT_43H)		\
306 	__PMC_EV(ARMV7, EVENT_44H)		\
307 	__PMC_EV(ARMV7, EVENT_45H)		\
308 	__PMC_EV(ARMV7, EVENT_46H)		\
309 	__PMC_EV(ARMV7, EVENT_47H)		\
310 	__PMC_EV(ARMV7, EVENT_48H)		\
311 	__PMC_EV(ARMV7, EVENT_49H)		\
312 	__PMC_EV(ARMV7, EVENT_4AH)		\
313 	__PMC_EV(ARMV7, EVENT_4BH)		\
314 	__PMC_EV(ARMV7, EVENT_4CH)		\
315 	__PMC_EV(ARMV7, EVENT_4DH)		\
316 	__PMC_EV(ARMV7, EVENT_4EH)		\
317 	__PMC_EV(ARMV7, EVENT_4FH)		\
318 	__PMC_EV(ARMV7, EVENT_50H)		\
319 	__PMC_EV(ARMV7, EVENT_51H)		\
320 	__PMC_EV(ARMV7, EVENT_52H)		\
321 	__PMC_EV(ARMV7, EVENT_53H)		\
322 	__PMC_EV(ARMV7, EVENT_54H)		\
323 	__PMC_EV(ARMV7, EVENT_55H)		\
324 	__PMC_EV(ARMV7, EVENT_56H)		\
325 	__PMC_EV(ARMV7, EVENT_57H)		\
326 	__PMC_EV(ARMV7, EVENT_58H)		\
327 	__PMC_EV(ARMV7, EVENT_59H)		\
328 	__PMC_EV(ARMV7, EVENT_5AH)		\
329 	__PMC_EV(ARMV7, EVENT_5BH)		\
330 	__PMC_EV(ARMV7, EVENT_5CH)		\
331 	__PMC_EV(ARMV7, EVENT_5DH)		\
332 	__PMC_EV(ARMV7, EVENT_5EH)		\
333 	__PMC_EV(ARMV7, EVENT_5FH)		\
334 	__PMC_EV(ARMV7, EVENT_60H)		\
335 	__PMC_EV(ARMV7, EVENT_61H)		\
336 	__PMC_EV(ARMV7, EVENT_62H)		\
337 	__PMC_EV(ARMV7, EVENT_63H)		\
338 	__PMC_EV(ARMV7, EVENT_64H)		\
339 	__PMC_EV(ARMV7, EVENT_65H)		\
340 	__PMC_EV(ARMV7, EVENT_66H)		\
341 	__PMC_EV(ARMV7, EVENT_67H)		\
342 	__PMC_EV(ARMV7, EVENT_68H)		\
343 	__PMC_EV(ARMV7, EVENT_69H)		\
344 	__PMC_EV(ARMV7, EVENT_6AH)		\
345 	__PMC_EV(ARMV7, EVENT_6BH)		\
346 	__PMC_EV(ARMV7, EVENT_6CH)		\
347 	__PMC_EV(ARMV7, EVENT_6DH)		\
348 	__PMC_EV(ARMV7, EVENT_6EH)		\
349 	__PMC_EV(ARMV7, EVENT_6FH)		\
350 	__PMC_EV(ARMV7, EVENT_70H)		\
351 	__PMC_EV(ARMV7, EVENT_71H)		\
352 	__PMC_EV(ARMV7, EVENT_72H)		\
353 	__PMC_EV(ARMV7, EVENT_73H)		\
354 	__PMC_EV(ARMV7, EVENT_74H)		\
355 	__PMC_EV(ARMV7, EVENT_75H)		\
356 	__PMC_EV(ARMV7, EVENT_76H)		\
357 	__PMC_EV(ARMV7, EVENT_77H)		\
358 	__PMC_EV(ARMV7, EVENT_78H)		\
359 	__PMC_EV(ARMV7, EVENT_79H)		\
360 	__PMC_EV(ARMV7, EVENT_7AH)		\
361 	__PMC_EV(ARMV7, EVENT_7BH)		\
362 	__PMC_EV(ARMV7, EVENT_7CH)		\
363 	__PMC_EV(ARMV7, EVENT_7DH)		\
364 	__PMC_EV(ARMV7, EVENT_7EH)		\
365 	__PMC_EV(ARMV7, EVENT_7FH)		\
366 	__PMC_EV(ARMV7, EVENT_80H)		\
367 	__PMC_EV(ARMV7, EVENT_81H)		\
368 	__PMC_EV(ARMV7, EVENT_82H)		\
369 	__PMC_EV(ARMV7, EVENT_83H)		\
370 	__PMC_EV(ARMV7, EVENT_84H)		\
371 	__PMC_EV(ARMV7, EVENT_85H)		\
372 	__PMC_EV(ARMV7, EVENT_86H)		\
373 	__PMC_EV(ARMV7, EVENT_87H)		\
374 	__PMC_EV(ARMV7, EVENT_88H)		\
375 	__PMC_EV(ARMV7, EVENT_89H)		\
376 	__PMC_EV(ARMV7, EVENT_8AH)		\
377 	__PMC_EV(ARMV7, EVENT_8BH)		\
378 	__PMC_EV(ARMV7, EVENT_8CH)		\
379 	__PMC_EV(ARMV7, EVENT_8DH)		\
380 	__PMC_EV(ARMV7, EVENT_8EH)		\
381 	__PMC_EV(ARMV7, EVENT_8FH)		\
382 	__PMC_EV(ARMV7, EVENT_90H)		\
383 	__PMC_EV(ARMV7, EVENT_91H)		\
384 	__PMC_EV(ARMV7, EVENT_92H)		\
385 	__PMC_EV(ARMV7, EVENT_93H)		\
386 	__PMC_EV(ARMV7, EVENT_94H)		\
387 	__PMC_EV(ARMV7, EVENT_95H)		\
388 	__PMC_EV(ARMV7, EVENT_96H)		\
389 	__PMC_EV(ARMV7, EVENT_97H)		\
390 	__PMC_EV(ARMV7, EVENT_98H)		\
391 	__PMC_EV(ARMV7, EVENT_99H)		\
392 	__PMC_EV(ARMV7, EVENT_9AH)		\
393 	__PMC_EV(ARMV7, EVENT_9BH)		\
394 	__PMC_EV(ARMV7, EVENT_9CH)		\
395 	__PMC_EV(ARMV7, EVENT_9DH)		\
396 	__PMC_EV(ARMV7, EVENT_9EH)		\
397 	__PMC_EV(ARMV7, EVENT_9FH)		\
398 	__PMC_EV(ARMV7, EVENT_A0H)		\
399 	__PMC_EV(ARMV7, EVENT_A1H)		\
400 	__PMC_EV(ARMV7, EVENT_A2H)		\
401 	__PMC_EV(ARMV7, EVENT_A3H)		\
402 	__PMC_EV(ARMV7, EVENT_A4H)		\
403 	__PMC_EV(ARMV7, EVENT_A5H)		\
404 	__PMC_EV(ARMV7, EVENT_A6H)		\
405 	__PMC_EV(ARMV7, EVENT_A7H)		\
406 	__PMC_EV(ARMV7, EVENT_A8H)		\
407 	__PMC_EV(ARMV7, EVENT_A9H)		\
408 	__PMC_EV(ARMV7, EVENT_AAH)		\
409 	__PMC_EV(ARMV7, EVENT_ABH)		\
410 	__PMC_EV(ARMV7, EVENT_ACH)		\
411 	__PMC_EV(ARMV7, EVENT_ADH)		\
412 	__PMC_EV(ARMV7, EVENT_AEH)		\
413 	__PMC_EV(ARMV7, EVENT_AFH)		\
414 	__PMC_EV(ARMV7, EVENT_B0H)		\
415 	__PMC_EV(ARMV7, EVENT_B1H)		\
416 	__PMC_EV(ARMV7, EVENT_B2H)		\
417 	__PMC_EV(ARMV7, EVENT_B3H)		\
418 	__PMC_EV(ARMV7, EVENT_B4H)		\
419 	__PMC_EV(ARMV7, EVENT_B5H)		\
420 	__PMC_EV(ARMV7, EVENT_B6H)		\
421 	__PMC_EV(ARMV7, EVENT_B7H)		\
422 	__PMC_EV(ARMV7, EVENT_B8H)		\
423 	__PMC_EV(ARMV7, EVENT_B9H)		\
424 	__PMC_EV(ARMV7, EVENT_BAH)		\
425 	__PMC_EV(ARMV7, EVENT_BBH)		\
426 	__PMC_EV(ARMV7, EVENT_BCH)		\
427 	__PMC_EV(ARMV7, EVENT_BDH)		\
428 	__PMC_EV(ARMV7, EVENT_BEH)		\
429 	__PMC_EV(ARMV7, EVENT_BFH)		\
430 	__PMC_EV(ARMV7, EVENT_C0H)		\
431 	__PMC_EV(ARMV7, EVENT_C1H)		\
432 	__PMC_EV(ARMV7, EVENT_C2H)		\
433 	__PMC_EV(ARMV7, EVENT_C3H)		\
434 	__PMC_EV(ARMV7, EVENT_C4H)		\
435 	__PMC_EV(ARMV7, EVENT_C5H)		\
436 	__PMC_EV(ARMV7, EVENT_C6H)		\
437 	__PMC_EV(ARMV7, EVENT_C7H)		\
438 	__PMC_EV(ARMV7, EVENT_C8H)		\
439 	__PMC_EV(ARMV7, EVENT_C9H)		\
440 	__PMC_EV(ARMV7, EVENT_CAH)		\
441 	__PMC_EV(ARMV7, EVENT_CBH)		\
442 	__PMC_EV(ARMV7, EVENT_CCH)		\
443 	__PMC_EV(ARMV7, EVENT_CDH)		\
444 	__PMC_EV(ARMV7, EVENT_CEH)		\
445 	__PMC_EV(ARMV7, EVENT_CFH)		\
446 	__PMC_EV(ARMV7, EVENT_D0H)		\
447 	__PMC_EV(ARMV7, EVENT_D1H)		\
448 	__PMC_EV(ARMV7, EVENT_D2H)		\
449 	__PMC_EV(ARMV7, EVENT_D3H)		\
450 	__PMC_EV(ARMV7, EVENT_D4H)		\
451 	__PMC_EV(ARMV7, EVENT_D5H)		\
452 	__PMC_EV(ARMV7, EVENT_D6H)		\
453 	__PMC_EV(ARMV7, EVENT_D7H)		\
454 	__PMC_EV(ARMV7, EVENT_D8H)		\
455 	__PMC_EV(ARMV7, EVENT_D9H)		\
456 	__PMC_EV(ARMV7, EVENT_DAH)		\
457 	__PMC_EV(ARMV7, EVENT_DBH)		\
458 	__PMC_EV(ARMV7, EVENT_DCH)		\
459 	__PMC_EV(ARMV7, EVENT_DDH)		\
460 	__PMC_EV(ARMV7, EVENT_DEH)		\
461 	__PMC_EV(ARMV7, EVENT_DFH)		\
462 	__PMC_EV(ARMV7, EVENT_E0H)		\
463 	__PMC_EV(ARMV7, EVENT_E1H)		\
464 	__PMC_EV(ARMV7, EVENT_E2H)		\
465 	__PMC_EV(ARMV7, EVENT_E3H)		\
466 	__PMC_EV(ARMV7, EVENT_E4H)		\
467 	__PMC_EV(ARMV7, EVENT_E5H)		\
468 	__PMC_EV(ARMV7, EVENT_E6H)		\
469 	__PMC_EV(ARMV7, EVENT_E7H)		\
470 	__PMC_EV(ARMV7, EVENT_E8H)		\
471 	__PMC_EV(ARMV7, EVENT_E9H)		\
472 	__PMC_EV(ARMV7, EVENT_EAH)		\
473 	__PMC_EV(ARMV7, EVENT_EBH)		\
474 	__PMC_EV(ARMV7, EVENT_ECH)		\
475 	__PMC_EV(ARMV7, EVENT_EDH)		\
476 	__PMC_EV(ARMV7, EVENT_EEH)		\
477 	__PMC_EV(ARMV7, EVENT_EFH)		\
478 	__PMC_EV(ARMV7, EVENT_F0H)		\
479 	__PMC_EV(ARMV7, EVENT_F1H)		\
480 	__PMC_EV(ARMV7, EVENT_F2H)		\
481 	__PMC_EV(ARMV7, EVENT_F3H)		\
482 	__PMC_EV(ARMV7, EVENT_F4H)		\
483 	__PMC_EV(ARMV7, EVENT_F5H)		\
484 	__PMC_EV(ARMV7, EVENT_F6H)		\
485 	__PMC_EV(ARMV7, EVENT_F7H)		\
486 	__PMC_EV(ARMV7, EVENT_F8H)		\
487 	__PMC_EV(ARMV7, EVENT_F9H)		\
488 	__PMC_EV(ARMV7, EVENT_FAH)		\
489 	__PMC_EV(ARMV7, EVENT_FBH)		\
490 	__PMC_EV(ARMV7, EVENT_FCH)		\
491 	__PMC_EV(ARMV7, EVENT_FDH)		\
492 	__PMC_EV(ARMV7, EVENT_FEH)		\
493 	__PMC_EV(ARMV7, EVENT_FFH)
494 
495 #define	PMC_EV_ARMV7_FIRST	PMC_EV_ARMV7_EVENT_00H
496 #define	PMC_EV_ARMV7_LAST	PMC_EV_ARMV7_EVENT_FFH
497 
498 #define	__PMC_EV_ALIAS_ARMV7_COMMON()					\
499 	__PMC_EV_ALIAS("PMNC_SW_INCR",		ARMV7_EVENT_00H)	\
500 	__PMC_EV_ALIAS("L1_ICACHE_REFILL",	ARMV7_EVENT_01H)	\
501 	__PMC_EV_ALIAS("ITLB_REFILL",		ARMV7_EVENT_02H)	\
502 	__PMC_EV_ALIAS("L1_DCACHE_REFILL",	ARMV7_EVENT_03H)	\
503 	__PMC_EV_ALIAS("L1_DCACHE_ACCESS",	ARMV7_EVENT_04H)	\
504 	__PMC_EV_ALIAS("DTLB_REFILL",		ARMV7_EVENT_05H)	\
505 	__PMC_EV_ALIAS("MEM_READ",		ARMV7_EVENT_06H)	\
506 	__PMC_EV_ALIAS("MEM_WRITE",		ARMV7_EVENT_07H)	\
507 	__PMC_EV_ALIAS("EXC_TAKEN",		ARMV7_EVENT_09H)	\
508 	__PMC_EV_ALIAS("EXC_EXECUTED",		ARMV7_EVENT_0AH)	\
509 	__PMC_EV_ALIAS("CID_WRITE",		ARMV7_EVENT_0BH)	\
510 	__PMC_EV_ALIAS("PC_WRITE",		ARMV7_EVENT_0CH)	\
511 	__PMC_EV_ALIAS("PC_IMM_BRANCH",		ARMV7_EVENT_0DH)	\
512 	__PMC_EV_ALIAS("MEM_UNALIGNED_ACCESS",	ARMV7_EVENT_0FH)	\
513 	__PMC_EV_ALIAS("PC_BRANCH_MIS_PRED",	ARMV7_EVENT_10H)	\
514 	__PMC_EV_ALIAS("CLOCK_CYCLES",		ARMV7_EVENT_11H)	\
515 	__PMC_EV_ALIAS("PC_BRANCH_PRED",	ARMV7_EVENT_12H)
516 
517 #define	__PMC_EV_ALIAS_ARMV7_COMMON_A8()				\
518 	__PMC_EV_ALIAS_ARMV7_COMMON()					\
519 	__PMC_EV_ALIAS("INSTR_EXECUTED",	ARMV7_EVENT_08H)	\
520 	__PMC_EV_ALIAS("PC_PROC_RETURN",	ARMV7_EVENT_0EH)	\
521 	__PMC_EV_ALIAS("MEM_ACCESS",		ARMV7_EVENT_13H)	\
522 	__PMC_EV_ALIAS("L1_ICACHE_ACCESS",	ARMV7_EVENT_14H)	\
523 	__PMC_EV_ALIAS("L1_DCACHE_WB",		ARMV7_EVENT_15H)	\
524 	__PMC_EV_ALIAS("L2_CACHE_ACCESS",	ARMV7_EVENT_16H)	\
525 	__PMC_EV_ALIAS("L2_CACHE_REFILL",	ARMV7_EVENT_17H)	\
526 	__PMC_EV_ALIAS("L2_CACHE_WB",		ARMV7_EVENT_18H)	\
527 	__PMC_EV_ALIAS("BUS_ACCESS",		ARMV7_EVENT_19H)	\
528 	__PMC_EV_ALIAS("MEM_ERROR",		ARMV7_EVENT_1AH)	\
529 	__PMC_EV_ALIAS("INSTR_SPEC",		ARMV7_EVENT_1BH)	\
530 	__PMC_EV_ALIAS("TTBR_WRITE",		ARMV7_EVENT_1CH)	\
531 	__PMC_EV_ALIAS("BUS_CYCLES",		ARMV7_EVENT_1DH)	\
532 	__PMC_EV_ALIAS("CPU_CYCLES",		ARMV7_EVENT_FFH)
533 
534 #define	__PMC_EV_ALIAS_ARMV7_CORTEX_A8()				 \
535 	__PMC_EV_ALIAS_ARMV7_COMMON_A8()				 \
536 	__PMC_EV_ALIAS("WRITE_BUF_FULL",		ARMV7_EVENT_40H) \
537 	__PMC_EV_ALIAS("L2_STORE_MERGED",		ARMV7_EVENT_41H) \
538 	__PMC_EV_ALIAS("L2_STORE_BUFFERABLE",		ARMV7_EVENT_42H) \
539 	__PMC_EV_ALIAS("L2_ACCESS",			ARMV7_EVENT_43H) \
540 	__PMC_EV_ALIAS("L2_CACHE_MISS",			ARMV7_EVENT_44H) \
541 	__PMC_EV_ALIAS("AXI_READ",			ARMV7_EVENT_45H) \
542 	__PMC_EV_ALIAS("AXI_WRITE",			ARMV7_EVENT_46H) \
543 	__PMC_EV_ALIAS("MEM_REPLAY_EVT",		ARMV7_EVENT_47H) \
544 	__PMC_EV_ALIAS("MEM_UNALIGNED_ACCESS_REPLAY",	ARMV7_EVENT_48H) \
545 	__PMC_EV_ALIAS("L1_DCACHE_HASH_MISS",		ARMV7_EVENT_49H) \
546 	__PMC_EV_ALIAS("L1_ICACHE_HASH_MISS",		ARMV7_EVENT_4AH) \
547 	__PMC_EV_ALIAS("L1_CACHE_PAGECOL_ALIAS",	ARMV7_EVENT_4BH) \
548 	__PMC_EV_ALIAS("L1_DCACHE_NEON_ACCESS",		ARMV7_EVENT_4CH) \
549 	__PMC_EV_ALIAS("L1_DCACHE_NEON_CACHEABLE",	ARMV7_EVENT_4DH) \
550 	__PMC_EV_ALIAS("L2_CACHE_NEON_MEM_ACCESS",	ARMV7_EVENT_4EH) \
551 	__PMC_EV_ALIAS("L2_CACHE_NEON_HIT",		ARMV7_EVENT_4FH) \
552 	__PMC_EV_ALIAS("L1_CACHE_ACCESS_NOCP15",	ARMV7_EVENT_50H) \
553 	__PMC_EV_ALIAS("RET_STACK_MISPREDICT",		ARMV7_EVENT_51H) \
554 	__PMC_EV_ALIAS("BRANCH_DIR_MISPREDICT",		ARMV7_EVENT_52H) \
555 	__PMC_EV_ALIAS("PRED_BRANCH_PRED_TAKEN",	ARMV7_EVENT_53H) \
556 	__PMC_EV_ALIAS("PRED_BRANCH_EXEC_TAKEN",	ARMV7_EVENT_54H) \
557 	__PMC_EV_ALIAS("OPS_ISSUED",			ARMV7_EVENT_55H) \
558 	__PMC_EV_ALIAS("CYCLES_NO_INSTRUCTION",		ARMV7_EVENT_56H) \
559 	__PMC_EV_ALIAS("INSTRUCTIONS_ISSUED_CYCLE",	ARMV7_EVENT_57H) \
560 	__PMC_EV_ALIAS("CYCLES_STALLED_NEON_MRC",	ARMV7_EVENT_58H) \
561 	__PMC_EV_ALIAS("CYCLES_STALLED_NEON_FULLQ",	ARMV7_EVENT_59H) \
562 	__PMC_EV_ALIAS("CYCLES_NONIDLE_NEON_INT",	ARMV7_EVENT_5AH) \
563 	__PMC_EV_ALIAS("PMUEXTIN0_EVT",			ARMV7_EVENT_70H) \
564 	__PMC_EV_ALIAS("PMUEXTIN1_EVT",			ARMV7_EVENT_71H) \
565 	__PMC_EV_ALIAS("PMUEXTIN_EVT",			ARMV7_EVENT_72H)
566 #define	PMC_EV_ARMV7_CORTEX_A8_FIRST	PMC_EV_ARMV7_PMNC_SW_INCR
567 #define	PMC_EV_ARMV7_CORTEX_A8_LAST	PMC_EV_ARMV7_PMUEXTIN_EVT
568 
569 #define	__PMC_EV_ALIAS_ARMV7_CORTEX_A9()					\
570 	__PMC_EV_ALIAS_ARMV7_COMMON()						\
571 	__PMC_EV_ALIAS("JAVA_BYTECODE",			ARMV7_EVENT_40H)	\
572 	__PMC_EV_ALIAS("SOFTWARE_JAVA_BYTECODE",	ARMV7_EVENT_41H)	\
573 	__PMC_EV_ALIAS("JAZELLE_BACKWARD_BRANCH",	ARMV7_EVENT_42H)	\
574 	__PMC_EV_ALIAS("COHERENT_LINEFILL_MISSC",	ARMV7_EVENT_50H)	\
575 	__PMC_EV_ALIAS("COHERENT_LINEFILL_HITC",	ARMV7_EVENT_51H)	\
576 	__PMC_EV_ALIAS("INSTR_CACHE_DEPENDENT_STALL",	ARMV7_EVENT_60H)	\
577 	__PMC_EV_ALIAS("DATA_CACHE_DEPENDENT_STALL",	ARMV7_EVENT_61H)	\
578 	__PMC_EV_ALIAS("MAIN_TLB_MISS_STALL",		ARMV7_EVENT_62H)	\
579 	__PMC_EV_ALIAS("STREX_PASSED",			ARMV7_EVENT_63H)	\
580 	__PMC_EV_ALIAS("STREX_FAILED",			ARMV7_EVENT_64H)	\
581 	__PMC_EV_ALIAS("DATA_EVICTION",			ARMV7_EVENT_65H)	\
582 	__PMC_EV_ALIAS("ISSUE_DNOT_DISPATCH_ANY_INSTR",	ARMV7_EVENT_66H)	\
583 	__PMC_EV_ALIAS("ISSUE_IS_EMPTY",		ARMV7_EVENT_67H)	\
584 	__PMC_EV_ALIAS("INSTR_RENAMED",			ARMV7_EVENT_68H)	\
585 	__PMC_EV_ALIAS("PREDICTABLE_FUNCTION_RETURN",	ARMV7_EVENT_6EH)	\
586 	__PMC_EV_ALIAS("MAIN_EXECUTION_UNIT_PIPE",	ARMV7_EVENT_70H)	\
587 	__PMC_EV_ALIAS("SECOND_EXECUTION_UNIT_PIPE",	ARMV7_EVENT_71H)	\
588 	__PMC_EV_ALIAS("LOAD_STORE_PIPE",		ARMV7_EVENT_72H)	\
589 	__PMC_EV_ALIAS("FLOATING_POINT_INSTR_RENAMED",	ARMV7_EVENT_73H)	\
590 	__PMC_EV_ALIAS("NEON_INSTRS_RENAMED",		ARMV7_EVENT_74H)	\
591 	__PMC_EV_ALIAS("PLD_STALL",			ARMV7_EVENT_80H)	\
592 	__PMC_EV_ALIAS("WRITE_STALL",			ARMV7_EVENT_81H)	\
593 	__PMC_EV_ALIAS("INSTR_MAIN_TLB_MISS_STALL",	ARMV7_EVENT_82H)	\
594 	__PMC_EV_ALIAS("DATA_MAIN_TLB_MISS_STALL",	ARMV7_EVENT_83H)	\
595 	__PMC_EV_ALIAS("INSTR_MICRO_TLB_MISS_STALL",	ARMV7_EVENT_84H)	\
596 	__PMC_EV_ALIAS("DATA_MICRO_TLB_MISS_STALL",	ARMV7_EVENT_85H)	\
597 	__PMC_EV_ALIAS("DMB_STALL",			ARMV7_EVENT_86H)	\
598 	__PMC_EV_ALIAS("INTEGER_CORE_CLOCK_ENABLED",	ARMV7_EVENT_8AH)	\
599 	__PMC_EV_ALIAS("DATA_ENGINE_CLOCK_ENABLED",	ARMV7_EVENT_8BH)	\
600 	__PMC_EV_ALIAS("ISB",				ARMV7_EVENT_90H)	\
601 	__PMC_EV_ALIAS("DSB",				ARMV7_EVENT_91H)	\
602 	__PMC_EV_ALIAS("DMB",				ARMV7_EVENT_92H)	\
603 	__PMC_EV_ALIAS("EXTERNAL_INTERRUPT",		ARMV7_EVENT_93H)	\
604 	__PMC_EV_ALIAS("PLE_CACHE_LINE_REQ_COMPLETED",	ARMV7_EVENT_A0H)	\
605 	__PMC_EV_ALIAS("PLE_CACHE_LINE_REQ_SKIPPED",	ARMV7_EVENT_A1H)	\
606 	__PMC_EV_ALIAS("PLE_FIFO_FLUSH",		ARMV7_EVENT_A2H)	\
607 	__PMC_EV_ALIAS("PLE_REQUEST_COMPLETED",		ARMV7_EVENT_A3H)	\
608 	__PMC_EV_ALIAS("PLE_FIFO_OVERFLOW",		ARMV7_EVENT_A4H)	\
609 	__PMC_EV_ALIAS("PLE_REQUEST_PROGRAMMED",	ARMV7_EVENT_A5H)
610 
611 /*
612  * ARMv8 Events
613  */
614 
615 #define	__PMC_EV_ARMV8()			\
616 	__PMC_EV(ARMV8, EVENT_00H)		\
617 	__PMC_EV(ARMV8, EVENT_01H)		\
618 	__PMC_EV(ARMV8, EVENT_02H)		\
619 	__PMC_EV(ARMV8, EVENT_03H)		\
620 	__PMC_EV(ARMV8, EVENT_04H)		\
621 	__PMC_EV(ARMV8, EVENT_05H)		\
622 	__PMC_EV(ARMV8, EVENT_06H)		\
623 	__PMC_EV(ARMV8, EVENT_07H)		\
624 	__PMC_EV(ARMV8, EVENT_08H)		\
625 	__PMC_EV(ARMV8, EVENT_09H)		\
626 	__PMC_EV(ARMV8, EVENT_0AH)		\
627 	__PMC_EV(ARMV8, EVENT_0BH)		\
628 	__PMC_EV(ARMV8, EVENT_0CH)		\
629 	__PMC_EV(ARMV8, EVENT_0DH)		\
630 	__PMC_EV(ARMV8, EVENT_0EH)		\
631 	__PMC_EV(ARMV8, EVENT_0FH)		\
632 	__PMC_EV(ARMV8, EVENT_10H)		\
633 	__PMC_EV(ARMV8, EVENT_11H)		\
634 	__PMC_EV(ARMV8, EVENT_12H)		\
635 	__PMC_EV(ARMV8, EVENT_13H)		\
636 	__PMC_EV(ARMV8, EVENT_14H)		\
637 	__PMC_EV(ARMV8, EVENT_15H)		\
638 	__PMC_EV(ARMV8, EVENT_16H)		\
639 	__PMC_EV(ARMV8, EVENT_17H)		\
640 	__PMC_EV(ARMV8, EVENT_18H)		\
641 	__PMC_EV(ARMV8, EVENT_19H)		\
642 	__PMC_EV(ARMV8, EVENT_1AH)		\
643 	__PMC_EV(ARMV8, EVENT_1BH)		\
644 	__PMC_EV(ARMV8, EVENT_1CH)		\
645 	__PMC_EV(ARMV8, EVENT_1DH)		\
646 	__PMC_EV(ARMV8, EVENT_1EH)		\
647 	__PMC_EV(ARMV8, EVENT_1FH)		\
648 	__PMC_EV(ARMV8, EVENT_20H)		\
649 	__PMC_EV(ARMV8, EVENT_21H)		\
650 	__PMC_EV(ARMV8, EVENT_22H)		\
651 	__PMC_EV(ARMV8, EVENT_23H)		\
652 	__PMC_EV(ARMV8, EVENT_24H)		\
653 	__PMC_EV(ARMV8, EVENT_25H)		\
654 	__PMC_EV(ARMV8, EVENT_26H)		\
655 	__PMC_EV(ARMV8, EVENT_27H)		\
656 	__PMC_EV(ARMV8, EVENT_28H)		\
657 	__PMC_EV(ARMV8, EVENT_29H)		\
658 	__PMC_EV(ARMV8, EVENT_2AH)		\
659 	__PMC_EV(ARMV8, EVENT_2BH)		\
660 	__PMC_EV(ARMV8, EVENT_2CH)		\
661 	__PMC_EV(ARMV8, EVENT_2DH)		\
662 	__PMC_EV(ARMV8, EVENT_2EH)		\
663 	__PMC_EV(ARMV8, EVENT_2FH)		\
664 	__PMC_EV(ARMV8, EVENT_30H)		\
665 	__PMC_EV(ARMV8, EVENT_31H)		\
666 	__PMC_EV(ARMV8, EVENT_32H)		\
667 	__PMC_EV(ARMV8, EVENT_33H)		\
668 	__PMC_EV(ARMV8, EVENT_34H)		\
669 	__PMC_EV(ARMV8, EVENT_35H)		\
670 	__PMC_EV(ARMV8, EVENT_36H)		\
671 	__PMC_EV(ARMV8, EVENT_37H)		\
672 	__PMC_EV(ARMV8, EVENT_38H)		\
673 	__PMC_EV(ARMV8, EVENT_39H)		\
674 	__PMC_EV(ARMV8, EVENT_3AH)		\
675 	__PMC_EV(ARMV8, EVENT_3BH)		\
676 	__PMC_EV(ARMV8, EVENT_3CH)		\
677 	__PMC_EV(ARMV8, EVENT_3DH)		\
678 	__PMC_EV(ARMV8, EVENT_3EH)		\
679 	__PMC_EV(ARMV8, EVENT_3FH)		\
680 	__PMC_EV(ARMV8, EVENT_40H)		\
681 	__PMC_EV(ARMV8, EVENT_41H)		\
682 	__PMC_EV(ARMV8, EVENT_42H)		\
683 	__PMC_EV(ARMV8, EVENT_43H)		\
684 	__PMC_EV(ARMV8, EVENT_44H)		\
685 	__PMC_EV(ARMV8, EVENT_45H)		\
686 	__PMC_EV(ARMV8, EVENT_46H)		\
687 	__PMC_EV(ARMV8, EVENT_47H)		\
688 	__PMC_EV(ARMV8, EVENT_48H)		\
689 	__PMC_EV(ARMV8, EVENT_49H)		\
690 	__PMC_EV(ARMV8, EVENT_4AH)		\
691 	__PMC_EV(ARMV8, EVENT_4BH)		\
692 	__PMC_EV(ARMV8, EVENT_4CH)		\
693 	__PMC_EV(ARMV8, EVENT_4DH)		\
694 	__PMC_EV(ARMV8, EVENT_4EH)		\
695 	__PMC_EV(ARMV8, EVENT_4FH)		\
696 	__PMC_EV(ARMV8, EVENT_50H)		\
697 	__PMC_EV(ARMV8, EVENT_51H)		\
698 	__PMC_EV(ARMV8, EVENT_52H)		\
699 	__PMC_EV(ARMV8, EVENT_53H)		\
700 	__PMC_EV(ARMV8, EVENT_54H)		\
701 	__PMC_EV(ARMV8, EVENT_55H)		\
702 	__PMC_EV(ARMV8, EVENT_56H)		\
703 	__PMC_EV(ARMV8, EVENT_57H)		\
704 	__PMC_EV(ARMV8, EVENT_58H)		\
705 	__PMC_EV(ARMV8, EVENT_59H)		\
706 	__PMC_EV(ARMV8, EVENT_5AH)		\
707 	__PMC_EV(ARMV8, EVENT_5BH)		\
708 	__PMC_EV(ARMV8, EVENT_5CH)		\
709 	__PMC_EV(ARMV8, EVENT_5DH)		\
710 	__PMC_EV(ARMV8, EVENT_5EH)		\
711 	__PMC_EV(ARMV8, EVENT_5FH)		\
712 	__PMC_EV(ARMV8, EVENT_60H)		\
713 	__PMC_EV(ARMV8, EVENT_61H)		\
714 	__PMC_EV(ARMV8, EVENT_62H)		\
715 	__PMC_EV(ARMV8, EVENT_63H)		\
716 	__PMC_EV(ARMV8, EVENT_64H)		\
717 	__PMC_EV(ARMV8, EVENT_65H)		\
718 	__PMC_EV(ARMV8, EVENT_66H)		\
719 	__PMC_EV(ARMV8, EVENT_67H)		\
720 	__PMC_EV(ARMV8, EVENT_68H)		\
721 	__PMC_EV(ARMV8, EVENT_69H)		\
722 	__PMC_EV(ARMV8, EVENT_6AH)		\
723 	__PMC_EV(ARMV8, EVENT_6BH)		\
724 	__PMC_EV(ARMV8, EVENT_6CH)		\
725 	__PMC_EV(ARMV8, EVENT_6DH)		\
726 	__PMC_EV(ARMV8, EVENT_6EH)		\
727 	__PMC_EV(ARMV8, EVENT_6FH)		\
728 	__PMC_EV(ARMV8, EVENT_70H)		\
729 	__PMC_EV(ARMV8, EVENT_71H)		\
730 	__PMC_EV(ARMV8, EVENT_72H)		\
731 	__PMC_EV(ARMV8, EVENT_73H)		\
732 	__PMC_EV(ARMV8, EVENT_74H)		\
733 	__PMC_EV(ARMV8, EVENT_75H)		\
734 	__PMC_EV(ARMV8, EVENT_76H)		\
735 	__PMC_EV(ARMV8, EVENT_77H)		\
736 	__PMC_EV(ARMV8, EVENT_78H)		\
737 	__PMC_EV(ARMV8, EVENT_79H)		\
738 	__PMC_EV(ARMV8, EVENT_7AH)		\
739 	__PMC_EV(ARMV8, EVENT_7BH)		\
740 	__PMC_EV(ARMV8, EVENT_7CH)		\
741 	__PMC_EV(ARMV8, EVENT_7DH)		\
742 	__PMC_EV(ARMV8, EVENT_7EH)		\
743 	__PMC_EV(ARMV8, EVENT_7FH)		\
744 	__PMC_EV(ARMV8, EVENT_80H)		\
745 	__PMC_EV(ARMV8, EVENT_81H)		\
746 	__PMC_EV(ARMV8, EVENT_82H)		\
747 	__PMC_EV(ARMV8, EVENT_83H)		\
748 	__PMC_EV(ARMV8, EVENT_84H)		\
749 	__PMC_EV(ARMV8, EVENT_85H)		\
750 	__PMC_EV(ARMV8, EVENT_86H)		\
751 	__PMC_EV(ARMV8, EVENT_87H)		\
752 	__PMC_EV(ARMV8, EVENT_88H)		\
753 	__PMC_EV(ARMV8, EVENT_89H)		\
754 	__PMC_EV(ARMV8, EVENT_8AH)		\
755 	__PMC_EV(ARMV8, EVENT_8BH)		\
756 	__PMC_EV(ARMV8, EVENT_8CH)		\
757 	__PMC_EV(ARMV8, EVENT_8DH)		\
758 	__PMC_EV(ARMV8, EVENT_8EH)		\
759 	__PMC_EV(ARMV8, EVENT_8FH)		\
760 	__PMC_EV(ARMV8, EVENT_90H)		\
761 	__PMC_EV(ARMV8, EVENT_91H)		\
762 	__PMC_EV(ARMV8, EVENT_92H)		\
763 	__PMC_EV(ARMV8, EVENT_93H)		\
764 	__PMC_EV(ARMV8, EVENT_94H)		\
765 	__PMC_EV(ARMV8, EVENT_95H)		\
766 	__PMC_EV(ARMV8, EVENT_96H)		\
767 	__PMC_EV(ARMV8, EVENT_97H)		\
768 	__PMC_EV(ARMV8, EVENT_98H)		\
769 	__PMC_EV(ARMV8, EVENT_99H)		\
770 	__PMC_EV(ARMV8, EVENT_9AH)		\
771 	__PMC_EV(ARMV8, EVENT_9BH)		\
772 	__PMC_EV(ARMV8, EVENT_9CH)		\
773 	__PMC_EV(ARMV8, EVENT_9DH)		\
774 	__PMC_EV(ARMV8, EVENT_9EH)		\
775 	__PMC_EV(ARMV8, EVENT_9FH)		\
776 	__PMC_EV(ARMV8, EVENT_A0H)		\
777 	__PMC_EV(ARMV8, EVENT_A1H)		\
778 	__PMC_EV(ARMV8, EVENT_A2H)		\
779 	__PMC_EV(ARMV8, EVENT_A3H)		\
780 	__PMC_EV(ARMV8, EVENT_A4H)		\
781 	__PMC_EV(ARMV8, EVENT_A5H)		\
782 	__PMC_EV(ARMV8, EVENT_A6H)		\
783 	__PMC_EV(ARMV8, EVENT_A7H)		\
784 	__PMC_EV(ARMV8, EVENT_A8H)		\
785 	__PMC_EV(ARMV8, EVENT_A9H)		\
786 	__PMC_EV(ARMV8, EVENT_AAH)		\
787 	__PMC_EV(ARMV8, EVENT_ABH)		\
788 	__PMC_EV(ARMV8, EVENT_ACH)		\
789 	__PMC_EV(ARMV8, EVENT_ADH)		\
790 	__PMC_EV(ARMV8, EVENT_AEH)		\
791 	__PMC_EV(ARMV8, EVENT_AFH)		\
792 	__PMC_EV(ARMV8, EVENT_B0H)		\
793 	__PMC_EV(ARMV8, EVENT_B1H)		\
794 	__PMC_EV(ARMV8, EVENT_B2H)		\
795 	__PMC_EV(ARMV8, EVENT_B3H)		\
796 	__PMC_EV(ARMV8, EVENT_B4H)		\
797 	__PMC_EV(ARMV8, EVENT_B5H)		\
798 	__PMC_EV(ARMV8, EVENT_B6H)		\
799 	__PMC_EV(ARMV8, EVENT_B7H)		\
800 	__PMC_EV(ARMV8, EVENT_B8H)		\
801 	__PMC_EV(ARMV8, EVENT_B9H)		\
802 	__PMC_EV(ARMV8, EVENT_BAH)		\
803 	__PMC_EV(ARMV8, EVENT_BBH)		\
804 	__PMC_EV(ARMV8, EVENT_BCH)		\
805 	__PMC_EV(ARMV8, EVENT_BDH)		\
806 	__PMC_EV(ARMV8, EVENT_BEH)		\
807 	__PMC_EV(ARMV8, EVENT_BFH)		\
808 	__PMC_EV(ARMV8, EVENT_C0H)		\
809 	__PMC_EV(ARMV8, EVENT_C1H)		\
810 	__PMC_EV(ARMV8, EVENT_C2H)		\
811 	__PMC_EV(ARMV8, EVENT_C3H)		\
812 	__PMC_EV(ARMV8, EVENT_C4H)		\
813 	__PMC_EV(ARMV8, EVENT_C5H)		\
814 	__PMC_EV(ARMV8, EVENT_C6H)		\
815 	__PMC_EV(ARMV8, EVENT_C7H)		\
816 	__PMC_EV(ARMV8, EVENT_C8H)		\
817 	__PMC_EV(ARMV8, EVENT_C9H)		\
818 	__PMC_EV(ARMV8, EVENT_CAH)		\
819 	__PMC_EV(ARMV8, EVENT_CBH)		\
820 	__PMC_EV(ARMV8, EVENT_CCH)		\
821 	__PMC_EV(ARMV8, EVENT_CDH)		\
822 	__PMC_EV(ARMV8, EVENT_CEH)		\
823 	__PMC_EV(ARMV8, EVENT_CFH)		\
824 	__PMC_EV(ARMV8, EVENT_D0H)		\
825 	__PMC_EV(ARMV8, EVENT_D1H)		\
826 	__PMC_EV(ARMV8, EVENT_D2H)		\
827 	__PMC_EV(ARMV8, EVENT_D3H)		\
828 	__PMC_EV(ARMV8, EVENT_D4H)		\
829 	__PMC_EV(ARMV8, EVENT_D5H)		\
830 	__PMC_EV(ARMV8, EVENT_D6H)		\
831 	__PMC_EV(ARMV8, EVENT_D7H)		\
832 	__PMC_EV(ARMV8, EVENT_D8H)		\
833 	__PMC_EV(ARMV8, EVENT_D9H)		\
834 	__PMC_EV(ARMV8, EVENT_DAH)		\
835 	__PMC_EV(ARMV8, EVENT_DBH)		\
836 	__PMC_EV(ARMV8, EVENT_DCH)		\
837 	__PMC_EV(ARMV8, EVENT_DDH)		\
838 	__PMC_EV(ARMV8, EVENT_DEH)		\
839 	__PMC_EV(ARMV8, EVENT_DFH)		\
840 	__PMC_EV(ARMV8, EVENT_E0H)		\
841 	__PMC_EV(ARMV8, EVENT_E1H)		\
842 	__PMC_EV(ARMV8, EVENT_E2H)		\
843 	__PMC_EV(ARMV8, EVENT_E3H)		\
844 	__PMC_EV(ARMV8, EVENT_E4H)		\
845 	__PMC_EV(ARMV8, EVENT_E5H)		\
846 	__PMC_EV(ARMV8, EVENT_E6H)		\
847 	__PMC_EV(ARMV8, EVENT_E7H)		\
848 	__PMC_EV(ARMV8, EVENT_E8H)		\
849 	__PMC_EV(ARMV8, EVENT_E9H)		\
850 	__PMC_EV(ARMV8, EVENT_EAH)		\
851 	__PMC_EV(ARMV8, EVENT_EBH)		\
852 	__PMC_EV(ARMV8, EVENT_ECH)		\
853 	__PMC_EV(ARMV8, EVENT_EDH)		\
854 	__PMC_EV(ARMV8, EVENT_EEH)		\
855 	__PMC_EV(ARMV8, EVENT_EFH)		\
856 	__PMC_EV(ARMV8, EVENT_F0H)		\
857 	__PMC_EV(ARMV8, EVENT_F1H)		\
858 	__PMC_EV(ARMV8, EVENT_F2H)		\
859 	__PMC_EV(ARMV8, EVENT_F3H)		\
860 	__PMC_EV(ARMV8, EVENT_F4H)		\
861 	__PMC_EV(ARMV8, EVENT_F5H)		\
862 	__PMC_EV(ARMV8, EVENT_F6H)		\
863 	__PMC_EV(ARMV8, EVENT_F7H)		\
864 	__PMC_EV(ARMV8, EVENT_F8H)		\
865 	__PMC_EV(ARMV8, EVENT_F9H)		\
866 	__PMC_EV(ARMV8, EVENT_FAH)		\
867 	__PMC_EV(ARMV8, EVENT_FBH)		\
868 	__PMC_EV(ARMV8, EVENT_FCH)		\
869 	__PMC_EV(ARMV8, EVENT_FDH)		\
870 	__PMC_EV(ARMV8, EVENT_FEH)		\
871 	__PMC_EV(ARMV8, EVENT_FFH)
872 
873 #define	PMC_EV_ARMV8_FIRST	PMC_EV_ARMV8_EVENT_00H
874 #define	PMC_EV_ARMV8_LAST	PMC_EV_ARMV8_EVENT_FFH
875 
876 #define	__PMC_EV_ALIAS_ARMV8_COMMON()					\
877 	__PMC_EV_ALIAS("SW_INCR",		ARMV8_EVENT_00H)	\
878 	__PMC_EV_ALIAS("L1I_CACHE_REFILL",	ARMV8_EVENT_01H)	\
879 	__PMC_EV_ALIAS("L1I_TLB_REFILL",	ARMV8_EVENT_02H)	\
880 	__PMC_EV_ALIAS("L1D_CACHE_REFILL",	ARMV8_EVENT_03H)	\
881 	__PMC_EV_ALIAS("L1D_CACHE",		ARMV8_EVENT_04H)	\
882 	__PMC_EV_ALIAS("L1D_TLB_REFILL",	ARMV8_EVENT_05H)	\
883 	__PMC_EV_ALIAS("INST_RETIRED",		ARMV8_EVENT_08H)	\
884 	__PMC_EV_ALIAS("EXC_TAKEN",		ARMV8_EVENT_09H)	\
885 	__PMC_EV_ALIAS("EXC_RETURN",		ARMV8_EVENT_0AH)	\
886 	__PMC_EV_ALIAS("CID_WRITE_RETIRED",	ARMV8_EVENT_0BH)	\
887 	__PMC_EV_ALIAS("BR_MIS_PRED",		ARMV8_EVENT_10H)	\
888 	__PMC_EV_ALIAS("CPU_CYCLES",		ARMV8_EVENT_11H)	\
889 	__PMC_EV_ALIAS("BR_PRED",		ARMV8_EVENT_12H)	\
890 	__PMC_EV_ALIAS("MEM_ACCESS",		ARMV8_EVENT_13H)	\
891 	__PMC_EV_ALIAS("L1I_CACHE",		ARMV8_EVENT_14H)	\
892 	__PMC_EV_ALIAS("L1D_CACHE_WB",		ARMV8_EVENT_15H)	\
893 	__PMC_EV_ALIAS("L2D_CACHE",		ARMV8_EVENT_16H)	\
894 	__PMC_EV_ALIAS("L2D_CACHE_REFILL",	ARMV8_EVENT_17H)	\
895 	__PMC_EV_ALIAS("L2D_CACHE_WB",		ARMV8_EVENT_18H)	\
896 	__PMC_EV_ALIAS("BUS_ACCESS",		ARMV8_EVENT_19H)	\
897 	__PMC_EV_ALIAS("MEMORY_ERROR",		ARMV8_EVENT_1AH)	\
898 	__PMC_EV_ALIAS("BUS_CYCLES",		ARMV8_EVENT_1DH)	\
899 	__PMC_EV_ALIAS("CHAIN",			ARMV8_EVENT_1EH)	\
900 	__PMC_EV_ALIAS("BUS_ACCESS_LD",		ARMV8_EVENT_60H)	\
901 	__PMC_EV_ALIAS("BUS_ACCESS_ST",		ARMV8_EVENT_61H)	\
902 	__PMC_EV_ALIAS("BR_INDIRECT_SPEC",	ARMV8_EVENT_7AH)	\
903 	__PMC_EV_ALIAS("EXC_IRQ",		ARMV8_EVENT_86H)	\
904 	__PMC_EV_ALIAS("EXC_FIQ",		ARMV8_EVENT_87H)
905 
906 #define	__PMC_EV_ALIAS_ARMV8_CORTEX_A53()				\
907 	__PMC_EV_ALIAS_ARMV8_COMMON()					\
908 	__PMC_EV_ALIAS("LD_RETIRED",		ARMV8_EVENT_06H)	\
909 	__PMC_EV_ALIAS("ST_RETIRED",		ARMV8_EVENT_07H)	\
910 	__PMC_EV_ALIAS("PC_WRITE_RETIRED",	ARMV8_EVENT_0CH)	\
911 	__PMC_EV_ALIAS("BR_IMMED_RETIRED",	ARMV8_EVENT_0DH)	\
912 	__PMC_EV_ALIAS("BR_RETURN_RETIRED",	ARMV8_EVENT_0EH)	\
913 	__PMC_EV_ALIAS("UNALIGNED_LDST_RETIRED",ARMV8_EVENT_0FH)
914 
915 #define	__PMC_EV_ALIAS_ARMV8_CORTEX_A57_A76()				\
916 	__PMC_EV_ALIAS_ARMV8_COMMON()					\
917 	__PMC_EV_ALIAS("INST_SPEC",		ARMV8_EVENT_1BH)	\
918 	__PMC_EV_ALIAS("TTBR_WRITE_RETIRED",	ARMV8_EVENT_1CH)	\
919 	__PMC_EV_ALIAS("L1D_CACHE_LD",		ARMV8_EVENT_40H)	\
920 	__PMC_EV_ALIAS("L1D_CACHE_ST",		ARMV8_EVENT_41H)	\
921 	__PMC_EV_ALIAS("L1D_CACHE_REFILL_LD",	ARMV8_EVENT_42H)	\
922 	__PMC_EV_ALIAS("L1D_CACHE_REFILL_ST",	ARMV8_EVENT_43H)	\
923 	__PMC_EV_ALIAS("L1D_CACHE_WB_VICTIM",	ARMV8_EVENT_46H)	\
924 	__PMC_EV_ALIAS("L1D_CACHE_WB_CLEAN",	ARMV8_EVENT_47H)	\
925 	__PMC_EV_ALIAS("L1D_CACHE_INVAL",	ARMV8_EVENT_48H)	\
926 	__PMC_EV_ALIAS("L1D_TLB_REFILL_LD",	ARMV8_EVENT_4CH)	\
927 	__PMC_EV_ALIAS("L1D_TLB_REFILL_ST",	ARMV8_EVENT_4DH)	\
928 	__PMC_EV_ALIAS("L2D_CACHE_LD",		ARMV8_EVENT_50H)	\
929 	__PMC_EV_ALIAS("L2D_CACHE_ST",		ARMV8_EVENT_51H)	\
930 	__PMC_EV_ALIAS("L2D_CACHE_REFILL_LD",	ARMV8_EVENT_52H)	\
931 	__PMC_EV_ALIAS("L2D_CACHE_REFILL_ST",	ARMV8_EVENT_53H)	\
932 	__PMC_EV_ALIAS("L2D_CACHE_WB_VICTIM",	ARMV8_EVENT_56H)	\
933 	__PMC_EV_ALIAS("L2D_CACHE_WB_CLEAN",	ARMV8_EVENT_57H)	\
934 	__PMC_EV_ALIAS("L2D_CACHE_INVAL",	ARMV8_EVENT_58H)	\
935 	__PMC_EV_ALIAS("MEM_ACCESS_LD",		ARMV8_EVENT_66H)	\
936 	__PMC_EV_ALIAS("MEM_ACCESS_ST",		ARMV8_EVENT_67H)	\
937 	__PMC_EV_ALIAS("UNALIGNED_LD_SPEC",	ARMV8_EVENT_68H)	\
938 	__PMC_EV_ALIAS("UNALIGNED_ST_SPEC",	ARMV8_EVENT_69H)	\
939 	__PMC_EV_ALIAS("UNALIGNED_LDST_SPEC",	ARMV8_EVENT_6AH)	\
940 	__PMC_EV_ALIAS("LDREX_SPEC",		ARMV8_EVENT_6CH)	\
941 	__PMC_EV_ALIAS("STREX_PASS_SPEC",	ARMV8_EVENT_6DH)	\
942 	__PMC_EV_ALIAS("STREX_FAIL_SPEC",	ARMV8_EVENT_6EH)	\
943 	__PMC_EV_ALIAS("LD_SPEC",		ARMV8_EVENT_70H)	\
944 	__PMC_EV_ALIAS("ST_SPEC",		ARMV8_EVENT_71H)	\
945 	__PMC_EV_ALIAS("LDST_SPEC",		ARMV8_EVENT_72H)	\
946 	__PMC_EV_ALIAS("DP_SPEC",		ARMV8_EVENT_73H)	\
947 	__PMC_EV_ALIAS("ASE_SPEC",		ARMV8_EVENT_74H)	\
948 	__PMC_EV_ALIAS("VFP_SPEC",		ARMV8_EVENT_75H)	\
949 	__PMC_EV_ALIAS("PC_WRITE_SPEC",		ARMV8_EVENT_76H)	\
950 	__PMC_EV_ALIAS("CRYPTO_SPEC",		ARMV8_EVENT_77H)	\
951 	__PMC_EV_ALIAS("BR_IMMED_SPEC",		ARMV8_EVENT_78H)	\
952 	__PMC_EV_ALIAS("BR_RETURN_SPEC",	ARMV8_EVENT_79H)	\
953 	__PMC_EV_ALIAS("ISB_SPEC",		ARMV8_EVENT_7CH)	\
954 	__PMC_EV_ALIAS("DSB_SPEC",		ARMV8_EVENT_7DH)	\
955 	__PMC_EV_ALIAS("DMB_SPEC",		ARMV8_EVENT_7EH)	\
956 	__PMC_EV_ALIAS("EXC_UNDEF",		ARMV8_EVENT_81H)	\
957 	__PMC_EV_ALIAS("EXC_SVC",		ARMV8_EVENT_82H)	\
958 	__PMC_EV_ALIAS("EXC_PABORT",		ARMV8_EVENT_83H)	\
959 	__PMC_EV_ALIAS("EXC_DABORT",		ARMV8_EVENT_84H)	\
960 	__PMC_EV_ALIAS("EXC_SMC",		ARMV8_EVENT_88H)	\
961 	__PMC_EV_ALIAS("EXC_HVC",		ARMV8_EVENT_8AH)	\
962 	__PMC_EV_ALIAS("EXC_TRAP_PABORT",	ARMV8_EVENT_8BH)	\
963 	__PMC_EV_ALIAS("EXC_TRAP_DABORT",	ARMV8_EVENT_8CH)	\
964 	__PMC_EV_ALIAS("EXC_TRAP_OTHER",	ARMV8_EVENT_8DH)	\
965 	__PMC_EV_ALIAS("EXC_TRAP_IRQ",		ARMV8_EVENT_8EH)	\
966 	__PMC_EV_ALIAS("EXC_TRAP_FIQ",		ARMV8_EVENT_8FH)	\
967 	__PMC_EV_ALIAS("RC_LD_SPEC",		ARMV8_EVENT_90H)	\
968 	__PMC_EV_ALIAS("RC_ST_SPEC",		ARMV8_EVENT_91H)
969 
970 #define	__PMC_EV_ALIAS_ARMV8_CORTEX_A57()				\
971 	__PMC_EV_ALIAS_ARMV8_CORTEX_A57_A76()				\
972 	__PMC_EV_ALIAS("BUS_ACCESS_SHARED",	ARMV8_EVENT_62H)	\
973 	__PMC_EV_ALIAS("BUS_ACCESS_NOT_SHARED",	ARMV8_EVENT_63H)	\
974 	__PMC_EV_ALIAS("BUS_ACCESS_NORMAL",	ARMV8_EVENT_64H)	\
975 	__PMC_EV_ALIAS("BUS_ACCESS_PERIPH",	ARMV8_EVENT_65H)
976 
977 #define	__PMC_EV_ALIAS_ARMV8_CORTEX_A76()				\
978 	__PMC_EV_ALIAS_ARMV8_CORTEX_A57_A76()				\
979 	__PMC_EV_ALIAS("L2D_CACHE_ALLOCATE",	ARMV8_EVENT_20H)	\
980 	__PMC_EV_ALIAS("BR_RETIRED",		ARMV8_EVENT_21H)	\
981 	__PMC_EV_ALIAS("BR_MIS_PRED_RETIRED",	ARMV8_EVENT_22H)	\
982 	__PMC_EV_ALIAS("STALL_FRONTEND",	ARMV8_EVENT_23H)	\
983 	__PMC_EV_ALIAS("STALL_BACKEND",		ARMV8_EVENT_24H)	\
984 	__PMC_EV_ALIAS("L1D_TLB",		ARMV8_EVENT_25H)	\
985 	__PMC_EV_ALIAS("L1I_TLB",		ARMV8_EVENT_26H)	\
986 	__PMC_EV_ALIAS("L3D_CACHE_ALLOCATE",	ARMV8_EVENT_29H)	\
987 	__PMC_EV_ALIAS("L3D_CACHE_REFILL",	ARMV8_EVENT_2AH)	\
988 	__PMC_EV_ALIAS("L3D_CACHE",		ARMV8_EVENT_2BH)	\
989 	__PMC_EV_ALIAS("L2D_TLB_REFILL",	ARMV8_EVENT_2DH)	\
990 	__PMC_EV_ALIAS("L2D_TLB",		ARMV8_EVENT_2FH)	\
991 	__PMC_EV_ALIAS("REMOTE_ACCESS",		ARMV8_EVENT_31H)	\
992 	__PMC_EV_ALIAS("DTLB_WALK",		ARMV8_EVENT_34H)	\
993 	__PMC_EV_ALIAS("ITLB_WALK",		ARMV8_EVENT_35H)	\
994 	__PMC_EV_ALIAS("LL_CACHE_RD",		ARMV8_EVENT_36H)	\
995 	__PMC_EV_ALIAS("LL_CACHE_MISS_RD",	ARMV8_EVENT_37H)	\
996 	__PMC_EV_ALIAS("L1D_CACHE_REFILL_INNER", ARMV8_EVENT_44H)	\
997 	__PMC_EV_ALIAS("L1D_CACHE_REFILL_OUTER", ARMV8_EVENT_45H)	\
998 	__PMC_EV_ALIAS("L1D_TLB_RD",		ARMV8_EVENT_4EH)	\
999 	__PMC_EV_ALIAS("L1D_TLB_WR",		ARMV8_EVENT_4FH)	\
1000 	__PMC_EV_ALIAS("L2D_TLB_REFILL_RD",	ARMV8_EVENT_5CH)	\
1001 	__PMC_EV_ALIAS("L2D_TLB_REFILL_WR",	ARMV8_EVENT_5DH)	\
1002 	__PMC_EV_ALIAS("L2D_TLB_RD",		ARMV8_EVENT_5EH)	\
1003 	__PMC_EV_ALIAS("L2D_TLB_WR",		ARMV8_EVENT_5FH)	\
1004 	__PMC_EV_ALIAS("STREX_SPEC",		ARMV8_EVENT_6FH)	\
1005 	__PMC_EV_ALIAS("L3_CACHE_RD",		ARMV8_EVENT_A0H)
1006 
1007 /*
1008  * ARM DMC-620 memory controller counters.
1009  */
1010 
1011 #define	__PMC_EV_DMC620_PMU_CD2()					\
1012 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_cycle_count)			\
1013 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_allocate)			\
1014 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_queue_depth)			\
1015 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_waiting_for_wr_data)		\
1016 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_read_backlog)			\
1017 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_waiting_for_mi)		\
1018 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_hazard_resolution)		\
1019 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_enqueue)			\
1020 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_arbitrate)			\
1021 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_lrank_turnaround_activate)	\
1022 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_prank_turnaround_activate)	\
1023 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_read_depth)			\
1024 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_write_depth)			\
1025 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_highhigh_qos_depth)		\
1026 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_high_qos_depth)		\
1027 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_medium_qos_depth)		\
1028 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_low_qos_depth)			\
1029 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_activate)			\
1030 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_rdwr)				\
1031 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_refresh)			\
1032 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_training_request)		\
1033 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_t_mac_tracker)			\
1034 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_bk_fsm_tracker)		\
1035 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_bk_open_tracker)		\
1036 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_ranks_in_pwr_down)		\
1037 	__PMC_EV(DMC620_PMU_CD2, clkdiv2_ranks_in_sref)			\
1038 
1039 #define	__PMC_EV_DMC620_PMU_C()						\
1040 	__PMC_EV(DMC620_PMU_C, clk_cycle_count)				\
1041 	__PMC_EV(DMC620_PMU_C, clk_request)				\
1042 	__PMC_EV(DMC620_PMU_C, clk_upload_stall)
1043 
1044 #define	PMC_EV_DMC620_PMU_CD2_FIRST	PMC_EV_DMC620_PMU_CD2_clkdiv2_cycle_count
1045 #define	PMC_EV_DMC620_PMU_CD2_LAST	PMC_EV_DMC620_PMU_CD2_clkdiv2_ranks_in_sref
1046 #define	PMC_EV_DMC620_PMU_C_FIRST	PMC_EV_DMC620_PMU_C_clk_cycle_count
1047 #define	PMC_EV_DMC620_PMU_C_LAST	PMC_EV_DMC620_PMU_C_clk_upload_stall
1048 
1049 /*
1050  * Arm CMN-600 Coherent Mesh Network controller counters.
1051  */
1052 
1053 #define	__PMC_EV_CMN600_PMU()					\
1054 	__PMC_EV(CMN600_PMU, dn_rxreq_dvmop)			\
1055 	__PMC_EV(CMN600_PMU, dn_rxreq_dvmsync)			\
1056 	__PMC_EV(CMN600_PMU, dn_rxreq_dvmop_vmid_filtered)	\
1057 	__PMC_EV(CMN600_PMU, dn_rxreq_retried)			\
1058 	__PMC_EV(CMN600_PMU, dn_rxreq_trk_occupancy)		\
1059 	__PMC_EV(CMN600_PMU, dn_rxreq_tlbi_dvmop)		\
1060 	__PMC_EV(CMN600_PMU, dn_rxreq_bpi_dvmop)		\
1061 	__PMC_EV(CMN600_PMU, dn_rxreq_pici_dvmop)		\
1062 	__PMC_EV(CMN600_PMU, dn_rxreq_vivi_dvmop)		\
1063 	__PMC_EV(CMN600_PMU, dn_rxreq_dvmop_other_filtered)	\
1064 	__PMC_EV(CMN600_PMU, dn_rxreq_snp_sent)			\
1065 	__PMC_EV(CMN600_PMU, dn_rxreq_snp_stalled)		\
1066 	__PMC_EV(CMN600_PMU, dn_rxreq_trk_full)			\
1067 	__PMC_EV(CMN600_PMU, hnf_cache_miss)			\
1068 	__PMC_EV(CMN600_PMU, hnf_slc_sf_cache_access)		\
1069 	__PMC_EV(CMN600_PMU, hnf_cache_fill)			\
1070 	__PMC_EV(CMN600_PMU, hnf_pocq_retry)			\
1071 	__PMC_EV(CMN600_PMU, hnf_pocq_reqs_recvd)		\
1072 	__PMC_EV(CMN600_PMU, hnf_sf_hit)			\
1073 	__PMC_EV(CMN600_PMU, hnf_sf_evictions)			\
1074 	__PMC_EV(CMN600_PMU, hnf_dir_snoops_sent)		\
1075 	__PMC_EV(CMN600_PMU, hnf_brd_snoops_sent)		\
1076 	__PMC_EV(CMN600_PMU, hnf_slc_eviction)			\
1077 	__PMC_EV(CMN600_PMU, hnf_slc_fill_invalid_way)		\
1078 	__PMC_EV(CMN600_PMU, hnf_mc_retries)			\
1079 	__PMC_EV(CMN600_PMU, hnf_mc_reqs)			\
1080 	__PMC_EV(CMN600_PMU, hnf_qos_hh_retry)			\
1081 	__PMC_EV(CMN600_PMU, hnf_qos_pocq)			\
1082 	__PMC_EV(CMN600_PMU, hnf_pocq_addrhaz)			\
1083 	__PMC_EV(CMN600_PMU, hnf_pocq_atomic_addrhaz)		\
1084 	__PMC_EV(CMN600_PMU, hnf_ld_st_swp_adq_full)		\
1085 	__PMC_EV(CMN600_PMU, hnf_cmp_adq_full)			\
1086 	__PMC_EV(CMN600_PMU, hnf_txdat_stall)			\
1087 	__PMC_EV(CMN600_PMU, hnf_txrsp_stall)			\
1088 	__PMC_EV(CMN600_PMU, hnf_seq_full)			\
1089 	__PMC_EV(CMN600_PMU, hnf_seq_hit)			\
1090 	__PMC_EV(CMN600_PMU, hnf_snp_sent)			\
1091 	__PMC_EV(CMN600_PMU, hnf_sfbi_dir_snp_sent)		\
1092 	__PMC_EV(CMN600_PMU, hnf_sfbi_brd_snp_sent)		\
1093 	__PMC_EV(CMN600_PMU, hnf_snp_sent_untrk)		\
1094 	__PMC_EV(CMN600_PMU, hnf_intv_dirty)			\
1095 	__PMC_EV(CMN600_PMU, hnf_stash_snp_sent)		\
1096 	__PMC_EV(CMN600_PMU, hnf_stash_data_pull)		\
1097 	__PMC_EV(CMN600_PMU, hnf_snp_fwded)			\
1098 	__PMC_EV(CMN600_PMU, hni_rrt_rd_occ_cnt_ovfl)		\
1099 	__PMC_EV(CMN600_PMU, hni_rrt_wr_occ_cnt_ovfl)		\
1100 	__PMC_EV(CMN600_PMU, hni_rdt_rd_occ_cnt_ovfl)		\
1101 	__PMC_EV(CMN600_PMU, hni_rdt_wr_occ_cnt_ovfl)		\
1102 	__PMC_EV(CMN600_PMU, hni_wdb_occ_cnt_ovfl)		\
1103 	__PMC_EV(CMN600_PMU, hni_rrt_rd_alloc)			\
1104 	__PMC_EV(CMN600_PMU, hni_rrt_wr_alloc)			\
1105 	__PMC_EV(CMN600_PMU, hni_rdt_rd_alloc)			\
1106 	__PMC_EV(CMN600_PMU, hni_rdt_wr_alloc)			\
1107 	__PMC_EV(CMN600_PMU, hni_wdb_alloc)			\
1108 	__PMC_EV(CMN600_PMU, hni_txrsp_retryack)		\
1109 	__PMC_EV(CMN600_PMU, hni_arvalid_no_arready)		\
1110 	__PMC_EV(CMN600_PMU, hni_arready_no_arvalid)		\
1111 	__PMC_EV(CMN600_PMU, hni_awvalid_no_awready)		\
1112 	__PMC_EV(CMN600_PMU, hni_awready_no_awvalid)		\
1113 	__PMC_EV(CMN600_PMU, hni_wvalid_no_wready)		\
1114 	__PMC_EV(CMN600_PMU, hni_txdat_stall)			\
1115 	__PMC_EV(CMN600_PMU, hni_nonpcie_serialization)		\
1116 	__PMC_EV(CMN600_PMU, hni_pcie_serialization)		\
1117 	__PMC_EV(CMN600_PMU, xp_txflit_valid)			\
1118 	__PMC_EV(CMN600_PMU, xp_txflit_stall)			\
1119 	__PMC_EV(CMN600_PMU, xp_partial_dat_flit)		\
1120 	__PMC_EV(CMN600_PMU, sbsx_rd_req)			\
1121 	__PMC_EV(CMN600_PMU, sbsx_wr_req)			\
1122 	__PMC_EV(CMN600_PMU, sbsx_cmo_req)			\
1123 	__PMC_EV(CMN600_PMU, sbsx_txrsp_retryack)		\
1124 	__PMC_EV(CMN600_PMU, sbsx_txdat_flitv)			\
1125 	__PMC_EV(CMN600_PMU, sbsx_txrsp_flitv)			\
1126 	__PMC_EV(CMN600_PMU, sbsx_rd_req_trkr_occ_cnt_ovfl)	\
1127 	__PMC_EV(CMN600_PMU, sbsx_wr_req_trkr_occ_cnt_ovfl)	\
1128 	__PMC_EV(CMN600_PMU, sbsx_cmo_req_trkr_occ_cnt_ovfl)	\
1129 	__PMC_EV(CMN600_PMU, sbsx_wdb_occ_cnt_ovfl)		\
1130 	__PMC_EV(CMN600_PMU, sbsx_rd_axi_trkr_occ_cnt_ovfl)	\
1131 	__PMC_EV(CMN600_PMU, sbsx_cmo_axi_trkr_occ_cnt_ovfl)	\
1132 	__PMC_EV(CMN600_PMU, sbsx_arvalid_no_arready)		\
1133 	__PMC_EV(CMN600_PMU, sbsx_awvalid_no_awready)		\
1134 	__PMC_EV(CMN600_PMU, sbsx_wvalid_no_wready)		\
1135 	__PMC_EV(CMN600_PMU, sbsx_txdat_stall)			\
1136 	__PMC_EV(CMN600_PMU, sbsx_txrsp_stall)			\
1137 	__PMC_EV(CMN600_PMU, rnd_s0_rdata_beats)		\
1138 	__PMC_EV(CMN600_PMU, rnd_s1_rdata_beats)		\
1139 	__PMC_EV(CMN600_PMU, rnd_s2_rdata_beats)		\
1140 	__PMC_EV(CMN600_PMU, rnd_rxdat_flits)			\
1141 	__PMC_EV(CMN600_PMU, rnd_txdat_flits)			\
1142 	__PMC_EV(CMN600_PMU, rnd_txreq_flits_total)		\
1143 	__PMC_EV(CMN600_PMU, rnd_txreq_flits_retried)		\
1144 	__PMC_EV(CMN600_PMU, rnd_rrt_occ_ovfl)			\
1145 	__PMC_EV(CMN600_PMU, rnd_wrt_occ_ovfl)			\
1146 	__PMC_EV(CMN600_PMU, rnd_txreq_flits_replayed)		\
1147 	__PMC_EV(CMN600_PMU, rnd_wrcancel_sent)			\
1148 	__PMC_EV(CMN600_PMU, rnd_s0_wdata_beats)		\
1149 	__PMC_EV(CMN600_PMU, rnd_s1_wdata_beats)		\
1150 	__PMC_EV(CMN600_PMU, rnd_s2_wdata_beats)		\
1151 	__PMC_EV(CMN600_PMU, rnd_rrt_alloc)			\
1152 	__PMC_EV(CMN600_PMU, rnd_wrt_alloc)			\
1153 	__PMC_EV(CMN600_PMU, rnd_rdb_unord)			\
1154 	__PMC_EV(CMN600_PMU, rnd_rdb_replay)			\
1155 	__PMC_EV(CMN600_PMU, rnd_rdb_hybrid)			\
1156 	__PMC_EV(CMN600_PMU, rnd_rdb_ord)			\
1157 	__PMC_EV(CMN600_PMU, rni_s0_rdata_beats)		\
1158 	__PMC_EV(CMN600_PMU, rni_s1_rdata_beats)		\
1159 	__PMC_EV(CMN600_PMU, rni_s2_rdata_beats)		\
1160 	__PMC_EV(CMN600_PMU, rni_rxdat_flits)			\
1161 	__PMC_EV(CMN600_PMU, rni_txdat_flits)			\
1162 	__PMC_EV(CMN600_PMU, rni_txreq_flits_total)		\
1163 	__PMC_EV(CMN600_PMU, rni_txreq_flits_retried)		\
1164 	__PMC_EV(CMN600_PMU, rni_rrt_occ_ovfl)			\
1165 	__PMC_EV(CMN600_PMU, rni_wrt_occ_ovfl)			\
1166 	__PMC_EV(CMN600_PMU, rni_txreq_flits_replayed)		\
1167 	__PMC_EV(CMN600_PMU, rni_wrcancel_sent)			\
1168 	__PMC_EV(CMN600_PMU, rni_s0_wdata_beats)		\
1169 	__PMC_EV(CMN600_PMU, rni_s1_wdata_beats)		\
1170 	__PMC_EV(CMN600_PMU, rni_s2_wdata_beats)		\
1171 	__PMC_EV(CMN600_PMU, rni_rrt_alloc)			\
1172 	__PMC_EV(CMN600_PMU, rni_wrt_alloc)			\
1173 	__PMC_EV(CMN600_PMU, rni_rdb_unord)			\
1174 	__PMC_EV(CMN600_PMU, rni_rdb_replay)			\
1175 	__PMC_EV(CMN600_PMU, rni_rdb_hybrid)			\
1176 	__PMC_EV(CMN600_PMU, rni_rdb_ord)			\
1177 	__PMC_EV(CMN600_PMU, cxha_rddatbyp)			\
1178 	__PMC_EV(CMN600_PMU, cxha_chirsp_up_stall)		\
1179 	__PMC_EV(CMN600_PMU, cxha_chidat_up_stall)		\
1180 	__PMC_EV(CMN600_PMU, cxha_snppcrd_lnk0_stall)		\
1181 	__PMC_EV(CMN600_PMU, cxha_snppcrd_lnk1_stall)		\
1182 	__PMC_EV(CMN600_PMU, cxha_snppcrd_lnk2_stall)		\
1183 	__PMC_EV(CMN600_PMU, cxha_reqtrk_occ)			\
1184 	__PMC_EV(CMN600_PMU, cxha_rdb_occ)			\
1185 	__PMC_EV(CMN600_PMU, cxha_rdbbyp_occ)			\
1186 	__PMC_EV(CMN600_PMU, cxha_wdb_occ)			\
1187 	__PMC_EV(CMN600_PMU, cxha_snptrk_occ)			\
1188 	__PMC_EV(CMN600_PMU, cxha_sdb_occ)			\
1189 	__PMC_EV(CMN600_PMU, cxha_snphaz_occ)			\
1190 	__PMC_EV(CMN600_PMU, cxra_req_trk_occ)			\
1191 	__PMC_EV(CMN600_PMU, cxra_snp_trk_occ)			\
1192 	__PMC_EV(CMN600_PMU, cxra_rd_dat_buf_occ)		\
1193 	__PMC_EV(CMN600_PMU, cxra_wr_dat_buf_occ)		\
1194 	__PMC_EV(CMN600_PMU, cxra_snp_sink_buf_occ)		\
1195 	__PMC_EV(CMN600_PMU, cxra_snp_bcasts)			\
1196 	__PMC_EV(CMN600_PMU, cxra_req_chains)			\
1197 	__PMC_EV(CMN600_PMU, cxra_req_chain_avg_len)		\
1198 	__PMC_EV(CMN600_PMU, cxra_chi_rsp_upload_stalls)	\
1199 	__PMC_EV(CMN600_PMU, cxra_chi_dat_upload_stalls)	\
1200 	__PMC_EV(CMN600_PMU, cxra_dat_pcrd_stalls_lnk0)		\
1201 	__PMC_EV(CMN600_PMU, cxra_dat_pcrd_stalls_lnk1)		\
1202 	__PMC_EV(CMN600_PMU, cxra_dat_pcrd_stalls_lnk2)		\
1203 	__PMC_EV(CMN600_PMU, cxra_req_pcrd_stalls_lnk0)		\
1204 	__PMC_EV(CMN600_PMU, cxra_req_pcrd_stalls_lnk1)		\
1205 	__PMC_EV(CMN600_PMU, cxra_req_pcrd_stalls_lnk2)		\
1206 	__PMC_EV(CMN600_PMU, cxra_ext_rsp_stall)		\
1207 	__PMC_EV(CMN600_PMU, cxra_ext_dat_stall)		\
1208 	__PMC_EV(CMN600_PMU, cxla_rx_tlp_link0)			\
1209 	__PMC_EV(CMN600_PMU, cxla_rx_tlp_link1)			\
1210 	__PMC_EV(CMN600_PMU, cxla_rx_tlp_link2)			\
1211 	__PMC_EV(CMN600_PMU, cxla_tx_tlp_link0)			\
1212 	__PMC_EV(CMN600_PMU, cxla_tx_tlp_link1)			\
1213 	__PMC_EV(CMN600_PMU, cxla_tx_tlp_link2)			\
1214 	__PMC_EV(CMN600_PMU, cxla_rx_cxs_link0)			\
1215 	__PMC_EV(CMN600_PMU, cxla_rx_cxs_link1)			\
1216 	__PMC_EV(CMN600_PMU, cxla_rx_cxs_link2)			\
1217 	__PMC_EV(CMN600_PMU, cxla_tx_cxs_link0)			\
1218 	__PMC_EV(CMN600_PMU, cxla_tx_cxs_link1)			\
1219 	__PMC_EV(CMN600_PMU, cxla_tx_cxs_link2)			\
1220 	__PMC_EV(CMN600_PMU, cxla_avg_rx_tlp_sz_dws)		\
1221 	__PMC_EV(CMN600_PMU, cxla_avg_tx_tlp_sz_dws)		\
1222 	__PMC_EV(CMN600_PMU, cxla_avg_rx_tlp_sz_ccix_msg)	\
1223 	__PMC_EV(CMN600_PMU, cxla_avg_tx_tlp_sz_ccix_msg)	\
1224 	__PMC_EV(CMN600_PMU, cxla_avg_sz_rx_cxs_dw_beat)	\
1225 	__PMC_EV(CMN600_PMU, cxla_avg_sz_tx_cxs_dw_beat)	\
1226 	__PMC_EV(CMN600_PMU, cxla_tx_cxs_link_credit_backpressure) \
1227 	__PMC_EV(CMN600_PMU, cxla_rx_tlp_buffer_full)		\
1228 	__PMC_EV(CMN600_PMU, cxla_tx_tlp_buffer_full)		\
1229 	__PMC_EV(CMN600_PMU, cxla_avg_latency_process_rx_tlp)	\
1230 	__PMC_EV(CMN600_PMU, cxla_avg_latency_form_tx_tlp)
1231 
1232 
1233 #define	PMC_EV_CMN600_PMU_FIRST	PMC_EV_CMN600_PMU_dn_rxreq_dvmop
1234 #define	PMC_EV_CMN600_PMU_LAST	\
1235 		PMC_EV_CMN600_PMU_cxla_avg_latency_form_tx_tlp
1236 
1237 #define __PMC_EV_PPC7450()						\
1238 	__PMC_EV(PPC7450, CYCLE)					\
1239 	__PMC_EV(PPC7450, INSTR_COMPLETED)				\
1240 	__PMC_EV(PPC7450, TLB_BIT_TRANSITIONS)				\
1241 	__PMC_EV(PPC7450, INSTR_DISPATCHED)				\
1242 	__PMC_EV(PPC7450, PMON_EXCEPT)					\
1243 	__PMC_EV(PPC7450, PMON_SIG)					\
1244 	__PMC_EV(PPC7450, VPU_INSTR_COMPLETED)				\
1245 	__PMC_EV(PPC7450, VFPU_INSTR_COMPLETED)				\
1246 	__PMC_EV(PPC7450, VIU1_INSTR_COMPLETED)				\
1247 	__PMC_EV(PPC7450, VIU2_INSTR_COMPLETED)				\
1248 	__PMC_EV(PPC7450, MTVSCR_INSTR_COMPLETED)			\
1249 	__PMC_EV(PPC7450, MTVRSAVE_INSTR_COMPLETED)			\
1250 	__PMC_EV(PPC7450, VPU_INSTR_WAIT_CYCLES)			\
1251 	__PMC_EV(PPC7450, VFPU_INSTR_WAIT_CYCLES)			\
1252 	__PMC_EV(PPC7450, VIU1_INSTR_WAIT_CYCLES)			\
1253 	__PMC_EV(PPC7450, VIU2_INSTR_WAIT_CYCLES)			\
1254 	__PMC_EV(PPC7450, MFVSCR_SYNC_CYCLES)				\
1255 	__PMC_EV(PPC7450, VSCR_SAT_SET)					\
1256 	__PMC_EV(PPC7450, STORE_INSTR_COMPLETED)			\
1257 	__PMC_EV(PPC7450, L1_INSTR_CACHE_MISSES)			\
1258 	__PMC_EV(PPC7450, L1_DATA_SNOOPS)				\
1259 	__PMC_EV(PPC7450, UNRESOLVED_BRANCHES)				\
1260 	__PMC_EV(PPC7450, SPEC_BUFFER_CYCLES)				\
1261 	__PMC_EV(PPC7450, BRANCH_UNIT_STALL_CYCLES)			\
1262 	__PMC_EV(PPC7450, TRUE_BRANCH_TARGET_HITS)			\
1263 	__PMC_EV(PPC7450, BRANCH_LINK_STAC_PREDICTED)			\
1264 	__PMC_EV(PPC7450, GPR_ISSUE_QUEUE_DISPATCHES)			\
1265 	__PMC_EV(PPC7450, CYCLES_THREE_INSTR_DISPATCHED)		\
1266 	__PMC_EV(PPC7450, THRESHOLD_INSTR_QUEUE_ENTRIES_CYCLES)		\
1267 	__PMC_EV(PPC7450, THRESHOLD_VEC_INSTR_QUEUE_ENTRIES_CYCLES)	\
1268 	__PMC_EV(PPC7450, CYCLES_NO_COMPLETED_INSTRS)			\
1269 	__PMC_EV(PPC7450, IU2_INSTR_COMPLETED)				\
1270 	__PMC_EV(PPC7450, BRANCHES_COMPLETED)				\
1271 	__PMC_EV(PPC7450, EIEIO_INSTR_COMPLETED)			\
1272 	__PMC_EV(PPC7450, MTSPR_INSTR_COMPLETED)			\
1273 	__PMC_EV(PPC7450, SC_INSTR_COMPLETED)				\
1274 	__PMC_EV(PPC7450, LS_LM_COMPLETED)				\
1275 	__PMC_EV(PPC7450, ITLB_HW_TABLE_SEARCH_CYCLES)			\
1276 	__PMC_EV(PPC7450, DTLB_HW_SEARCH_CYCLES_OVER_THRESHOLD)		\
1277 	__PMC_EV(PPC7450, L1_INSTR_CACHE_ACCESSES)			\
1278 	__PMC_EV(PPC7450, INSTR_BKPT_MATCHES)				\
1279 	__PMC_EV(PPC7450, L1_DATA_CACHE_LOAD_MISS_CYCLES_OVER_THRESHOLD)\
1280 	__PMC_EV(PPC7450, L1_DATA_SNOOP_HIT_ON_MODIFIED)		\
1281 	__PMC_EV(PPC7450, LOAD_MISS_ALIAS)				\
1282 	__PMC_EV(PPC7450, LOAD_MISS_ALIAS_ON_TOUCH)			\
1283 	__PMC_EV(PPC7450, TOUCH_ALIAS)					\
1284 	__PMC_EV(PPC7450, L1_DATA_SNOOP_HIT_CASTOUT_QUEUE)		\
1285 	__PMC_EV(PPC7450, L1_DATA_SNOOP_HIT_CASTOUT)			\
1286 	__PMC_EV(PPC7450, L1_DATA_SNOOP_HITS)				\
1287 	__PMC_EV(PPC7450, WRITE_THROUGH_STORES)				\
1288 	__PMC_EV(PPC7450, CACHE_INHIBITED_STORES)			\
1289 	__PMC_EV(PPC7450, L1_DATA_LOAD_HIT)				\
1290 	__PMC_EV(PPC7450, L1_DATA_TOUCH_HIT)				\
1291 	__PMC_EV(PPC7450, L1_DATA_STORE_HIT)				\
1292 	__PMC_EV(PPC7450, L1_DATA_TOTAL_HITS)				\
1293 	__PMC_EV(PPC7450, DST_INSTR_DISPATCHED)				\
1294 	__PMC_EV(PPC7450, REFRESHED_DSTS)				\
1295 	__PMC_EV(PPC7450, SUCCESSFUL_DST_TABLE_SEARCHES)		\
1296 	__PMC_EV(PPC7450, DSS_INSTR_COMPLETED)				\
1297 	__PMC_EV(PPC7450, DST_STREAM_0_CACHE_LINE_FETCHES)		\
1298 	__PMC_EV(PPC7450, VTQ_SUSPENDS_DUE_TO_CTX_CHANGE)		\
1299 	__PMC_EV(PPC7450, VTQ_LINE_FETCH_HIT)				\
1300 	__PMC_EV(PPC7450, VEC_LOAD_INSTR_COMPLETED)			\
1301 	__PMC_EV(PPC7450, FP_STORE_INSTR_COMPLETED_IN_LSU)		\
1302 	__PMC_EV(PPC7450, FPU_RENORMALIZATION)				\
1303 	__PMC_EV(PPC7450, FPU_DENORMALIZATION)				\
1304 	__PMC_EV(PPC7450, FP_STORE_CAUSES_STALL_IN_LSU)			\
1305 	__PMC_EV(PPC7450, LD_ST_TRUE_ALIAS_STALL)			\
1306 	__PMC_EV(PPC7450, LSU_INDEXED_ALIAS_STALL)			\
1307 	__PMC_EV(PPC7450, LSU_ALIAS_VS_FSQ_WB0_WB1)			\
1308 	__PMC_EV(PPC7450, LSU_ALIAS_VS_CSQ)				\
1309 	__PMC_EV(PPC7450, LSU_LOAD_HIT_LINE_ALIAS_VS_CSQ0)		\
1310 	__PMC_EV(PPC7450, LSU_LOAD_MISS_LINE_ALIAS_VS_CSQ0)		\
1311 	__PMC_EV(PPC7450, LSU_TOUCH_LINE_ALIAS_VS_FSQ_WB0_WB1)		\
1312 	__PMC_EV(PPC7450, LSU_TOUCH_ALIAS_VS_CSQ)			\
1313 	__PMC_EV(PPC7450, LSU_LMQ_FULL_STALL)				\
1314 	__PMC_EV(PPC7450, FP_LOAD_INSTR_COMPLETED_IN_LSU)		\
1315 	__PMC_EV(PPC7450, FP_LOAD_SINGLE_INSTR_COMPLETED_IN_LSU)	\
1316 	__PMC_EV(PPC7450, FP_LOAD_DOUBLE_COMPLETED_IN_LSU)		\
1317 	__PMC_EV(PPC7450, LSU_RA_LATCH_STALL)				\
1318 	__PMC_EV(PPC7450, LSU_LOAD_VS_STORE_QUEUE_ALIAS_STALL)		\
1319 	__PMC_EV(PPC7450, LSU_LMQ_INDEX_ALIAS)				\
1320 	__PMC_EV(PPC7450, LSU_STORE_QUEUE_INDEX_ALIAS)			\
1321 	__PMC_EV(PPC7450, LSU_CSQ_FORWARDING)				\
1322 	__PMC_EV(PPC7450, LSU_MISALIGNED_LOAD_FINISH)			\
1323 	__PMC_EV(PPC7450, LSU_MISALIGN_STORE_COMPLETED)			\
1324 	__PMC_EV(PPC7450, LSU_MISALIGN_STALL)				\
1325 	__PMC_EV(PPC7450, FP_ONE_QUARTER_FPSCR_RENAMES_BUSY)		\
1326 	__PMC_EV(PPC7450, FP_ONE_HALF_FPSCR_RENAMES_BUSY)		\
1327 	__PMC_EV(PPC7450, FP_THREE_QUARTERS_FPSCR_RENAMES_BUSY)		\
1328 	__PMC_EV(PPC7450, FP_ALL_FPSCR_RENAMES_BUSY)			\
1329 	__PMC_EV(PPC7450, FP_DENORMALIZED_RESULT)			\
1330 	__PMC_EV(PPC7450, L1_DATA_TOTAL_MISSES)				\
1331 	__PMC_EV(PPC7450, DISPATCHES_TO_FPR_ISSUE_QUEUE)		\
1332 	__PMC_EV(PPC7450, LSU_INSTR_COMPLETED)				\
1333 	__PMC_EV(PPC7450, LOAD_INSTR_COMPLETED)				\
1334 	__PMC_EV(PPC7450, SS_SM_INSTR_COMPLETED)			\
1335 	__PMC_EV(PPC7450, TLBIE_INSTR_COMPLETED)			\
1336 	__PMC_EV(PPC7450, LWARX_INSTR_COMPLETED)			\
1337 	__PMC_EV(PPC7450, MFSPR_INSTR_COMPLETED)			\
1338 	__PMC_EV(PPC7450, REFETCH_SERIALIZATION)			\
1339 	__PMC_EV(PPC7450, COMPLETION_QUEUE_ENTRIES_OVER_THRESHOLD)	\
1340 	__PMC_EV(PPC7450, CYCLES_ONE_INSTR_DISPATCHED)			\
1341 	__PMC_EV(PPC7450, CYCLES_TWO_INSTR_COMPLETED)			\
1342 	__PMC_EV(PPC7450, ITLB_NON_SPECULATIVE_MISSES)			\
1343 	__PMC_EV(PPC7450, CYCLES_WAITING_FROM_L1_INSTR_CACHE_MISS)	\
1344 	__PMC_EV(PPC7450, L1_DATA_LOAD_ACCESS_MISS)			\
1345 	__PMC_EV(PPC7450, L1_DATA_TOUCH_MISS)				\
1346 	__PMC_EV(PPC7450, L1_DATA_STORE_MISS)				\
1347 	__PMC_EV(PPC7450, L1_DATA_TOUCH_MISS_CYCLES)			\
1348 	__PMC_EV(PPC7450, L1_DATA_CYCLES_USED)				\
1349 	__PMC_EV(PPC7450, DST_STREAM_1_CACHE_LINE_FETCHES)		\
1350 	__PMC_EV(PPC7450, VTQ_STREAM_CANCELED_PREMATURELY)		\
1351 	__PMC_EV(PPC7450, VTQ_RESUMES_DUE_TO_CTX_CHANGE)		\
1352 	__PMC_EV(PPC7450, VTQ_LINE_FETCH_MISS)				\
1353 	__PMC_EV(PPC7450, VTQ_LINE_FETCH)				\
1354 	__PMC_EV(PPC7450, TLBIE_SNOOPS)					\
1355 	__PMC_EV(PPC7450, L1_INSTR_CACHE_RELOADS)			\
1356 	__PMC_EV(PPC7450, L1_DATA_CACHE_RELOADS)			\
1357 	__PMC_EV(PPC7450, L1_DATA_CACHE_CASTOUTS_TO_L2)			\
1358 	__PMC_EV(PPC7450, STORE_MERGE_GATHER)				\
1359 	__PMC_EV(PPC7450, CACHEABLE_STORE_MERGE_TO_32_BYTES)		\
1360 	__PMC_EV(PPC7450, DATA_BKPT_MATCHES)				\
1361 	__PMC_EV(PPC7450, FALL_THROUGH_BRANCHES_PROCESSED)		\
1362 	__PMC_EV(PPC7450,						\
1363 	    FIRST_SPECULATIVE_BRANCH_BUFFER_RESOLVED_CORRECTLY)		\
1364 	__PMC_EV(PPC7450, SECOND_SPECULATION_BUFFER_ACTIVE)		\
1365 	__PMC_EV(PPC7450, BPU_STALL_ON_LR_DEPENDENCY)			\
1366 	__PMC_EV(PPC7450, BTIC_MISS)					\
1367 	__PMC_EV(PPC7450, BRANCH_LINK_STACK_CORRECTLY_RESOLVED)		\
1368 	__PMC_EV(PPC7450, FPR_ISSUE_STALLED)				\
1369 	__PMC_EV(PPC7450, SWITCHES_BETWEEN_PRIV_USER)			\
1370 	__PMC_EV(PPC7450, LSU_COMPLETES_FP_STORE_SINGLE)		\
1371 	__PMC_EV(PPC7450, VR_ISSUE_QUEUE_DISPATCHES)			\
1372 	__PMC_EV(PPC7450, VR_STALLS)					\
1373 	__PMC_EV(PPC7450, GPR_RENAME_BUFFER_ENTRIES_OVER_THRESHOLD)	\
1374 	__PMC_EV(PPC7450, FPR_ISSUE_QUEUE_ENTRIES)			\
1375 	__PMC_EV(PPC7450, FPU_INSTR_COMPLETED)				\
1376 	__PMC_EV(PPC7450, STWCX_INSTR_COMPLETED)			\
1377 	__PMC_EV(PPC7450, LS_LM_INSTR_PIECES)				\
1378 	__PMC_EV(PPC7450, ITLB_HW_SEARCH_CYCLES_OVER_THRESHOLD)		\
1379 	__PMC_EV(PPC7450, DTLB_MISSES)					\
1380 	__PMC_EV(PPC7450, CANCELLED_L1_INSTR_CACHE_MISSES)		\
1381 	__PMC_EV(PPC7450, L1_DATA_CACHE_OP_HIT)				\
1382 	__PMC_EV(PPC7450, L1_DATA_LOAD_MISS_CYCLES)			\
1383 	__PMC_EV(PPC7450, L1_DATA_PUSHES)				\
1384 	__PMC_EV(PPC7450, L1_DATA_TOTAL_MISS)				\
1385 	__PMC_EV(PPC7450, VT2_FETCHES)					\
1386 	__PMC_EV(PPC7450, TAKEN_BRANCHES_PROCESSED)			\
1387 	__PMC_EV(PPC7450, BRANCH_FLUSHES)				\
1388 	__PMC_EV(PPC7450,						\
1389 	    SECOND_SPECULATIVE_BRANCH_BUFFER_RESOLVED_CORRECTLY)	\
1390 	__PMC_EV(PPC7450, THIRD_SPECULATION_BUFFER_ACTIVE)		\
1391 	__PMC_EV(PPC7450, BRANCH_UNIT_STALL_ON_CTR_DEPENDENCY)		\
1392 	__PMC_EV(PPC7450, FAST_BTIC_HIT)				\
1393 	__PMC_EV(PPC7450, BRANCH_LINK_STACK_MISPREDICTED)		\
1394 	__PMC_EV(PPC7450, CYCLES_THREE_INSTR_COMPLETED)			\
1395 	__PMC_EV(PPC7450, CYCLES_NO_INSTR_DISPATCHED)			\
1396 	__PMC_EV(PPC7450, GPR_ISSUE_QUEUE_ENTRIES_OVER_THRESHOLD)	\
1397 	__PMC_EV(PPC7450, GPR_ISSUE_QUEUE_STALLED)			\
1398 	__PMC_EV(PPC7450, IU1_INSTR_COMPLETED)				\
1399 	__PMC_EV(PPC7450, DSSALL_INSTR_COMPLETED)			\
1400 	__PMC_EV(PPC7450, TLBSYNC_INSTR_COMPLETED)			\
1401 	__PMC_EV(PPC7450, SYNC_INSTR_COMPLETED)				\
1402 	__PMC_EV(PPC7450, SS_SM_INSTR_PIECES)				\
1403 	__PMC_EV(PPC7450, DTLB_HW_SEARCH_CYCLES)			\
1404 	__PMC_EV(PPC7450, SNOOP_RETRIES)				\
1405 	__PMC_EV(PPC7450, SUCCESSFUL_STWCX)				\
1406 	__PMC_EV(PPC7450, DST_STREAM_3_CACHE_LINE_FETCHES)		\
1407 	__PMC_EV(PPC7450,						\
1408 	    THIRD_SPECULATIVE_BRANCH_BUFFER_RESOLVED_CORRECTLY)		\
1409 	__PMC_EV(PPC7450, MISPREDICTED_BRANCHES)			\
1410 	__PMC_EV(PPC7450, FOLDED_BRANCHES)				\
1411 	__PMC_EV(PPC7450, FP_STORE_DOUBLE_COMPLETES_IN_LSU)		\
1412 	__PMC_EV(PPC7450, L2_CACHE_HITS)				\
1413 	__PMC_EV(PPC7450, L3_CACHE_HITS)				\
1414 	__PMC_EV(PPC7450, L2_INSTR_CACHE_MISSES)			\
1415 	__PMC_EV(PPC7450, L3_INSTR_CACHE_MISSES)			\
1416 	__PMC_EV(PPC7450, L2_DATA_CACHE_MISSES)				\
1417 	__PMC_EV(PPC7450, L3_DATA_CACHE_MISSES)				\
1418 	__PMC_EV(PPC7450, L2_LOAD_HITS)					\
1419 	__PMC_EV(PPC7450, L2_STORE_HITS)				\
1420 	__PMC_EV(PPC7450, L3_LOAD_HITS)					\
1421 	__PMC_EV(PPC7450, L3_STORE_HITS)				\
1422 	__PMC_EV(PPC7450, L2_TOUCH_HITS)				\
1423 	__PMC_EV(PPC7450, L3_TOUCH_HITS)				\
1424 	__PMC_EV(PPC7450, SNOOP_MODIFIED)				\
1425 	__PMC_EV(PPC7450, SNOOP_VALID)					\
1426 	__PMC_EV(PPC7450, INTERVENTION)					\
1427 	__PMC_EV(PPC7450, L2_CACHE_MISSES)				\
1428 	__PMC_EV(PPC7450, L3_CACHE_MISSES)				\
1429 	__PMC_EV(PPC7450, L2_CACHE_CASTOUTS)				\
1430 	__PMC_EV(PPC7450, L3_CACHE_CASTOUTS)				\
1431 	__PMC_EV(PPC7450, L2SQ_FULL_CYCLES)				\
1432 	__PMC_EV(PPC7450, L3SQ_FULL_CYCLES)				\
1433 	__PMC_EV(PPC7450, RAQ_FULL_CYCLES)				\
1434 	__PMC_EV(PPC7450, WAQ_FULL_CYCLES)				\
1435 	__PMC_EV(PPC7450, L1_EXTERNAL_INTERVENTIONS)			\
1436 	__PMC_EV(PPC7450, L2_EXTERNAL_INTERVENTIONS)			\
1437 	__PMC_EV(PPC7450, L3_EXTERNAL_INTERVENTIONS)			\
1438 	__PMC_EV(PPC7450, EXTERNAL_INTERVENTIONS)			\
1439 	__PMC_EV(PPC7450, EXTERNAL_PUSHES)				\
1440 	__PMC_EV(PPC7450, EXTERNAL_SNOOP_RETRY)				\
1441 	__PMC_EV(PPC7450, DTQ_FULL_CYCLES)				\
1442 	__PMC_EV(PPC7450, BUS_RETRY)					\
1443 	__PMC_EV(PPC7450, L2_VALID_REQUEST)				\
1444 	__PMC_EV(PPC7450, BORDQ_FULL)					\
1445 	__PMC_EV(PPC7450, BUS_TAS_FOR_READS)				\
1446 	__PMC_EV(PPC7450, BUS_TAS_FOR_WRITES)				\
1447 	__PMC_EV(PPC7450, BUS_READS_NOT_RETRIED)			\
1448 	__PMC_EV(PPC7450, BUS_WRITES_NOT_RETRIED)			\
1449 	__PMC_EV(PPC7450, BUS_READS_WRITES_NOT_RETRIED)			\
1450 	__PMC_EV(PPC7450, BUS_RETRY_DUE_TO_L1_RETRY)			\
1451 	__PMC_EV(PPC7450, BUS_RETRY_DUE_TO_PREVIOUS_ADJACENT)		\
1452 	__PMC_EV(PPC7450, BUS_RETRY_DUE_TO_COLLISION)			\
1453 	__PMC_EV(PPC7450, BUS_RETRY_DUE_TO_INTERVENTION_ORDERING)	\
1454 	__PMC_EV(PPC7450, SNOOP_REQUESTS)				\
1455 	__PMC_EV(PPC7450, PREFETCH_ENGINE_REQUEST)			\
1456 	__PMC_EV(PPC7450, PREFETCH_ENGINE_COLLISION_VS_LOAD)		\
1457 	__PMC_EV(PPC7450, PREFETCH_ENGINE_COLLISION_VS_STORE)		\
1458 	__PMC_EV(PPC7450, PREFETCH_ENGINE_COLLISION_VS_INSTR_FETCH)	\
1459 	__PMC_EV(PPC7450,						\
1460 	    PREFETCH_ENGINE_COLLISION_VS_LOAD_STORE_INSTR_FETCH)	\
1461 	__PMC_EV(PPC7450, PREFETCH_ENGINE_FULL)
1462 
1463 #define PMC_EV_PPC7450_FIRST	PMC_EV_PPC7450_CYCLE
1464 #define PMC_EV_PPC7450_LAST	PMC_EV_PPC7450_PREFETCH_ENGINE_FULL
1465 
1466 #define __PMC_EV_PPC970() \
1467 	__PMC_EV(PPC970, INSTR_COMPLETED) \
1468 	__PMC_EV(PPC970, MARKED_GROUP_DISPATCH) \
1469 	__PMC_EV(PPC970, MARKED_STORE_COMPLETED) \
1470 	__PMC_EV(PPC970, GCT_EMPTY) \
1471 	__PMC_EV(PPC970, RUN_CYCLES) \
1472 	__PMC_EV(PPC970, OVERFLOW) \
1473 	__PMC_EV(PPC970, CYCLES) \
1474 	__PMC_EV(PPC970, THRESHOLD_TIMEOUT) \
1475 	__PMC_EV(PPC970, GROUP_DISPATCH) \
1476 	__PMC_EV(PPC970, BR_MARKED_INSTR_FINISH) \
1477 	__PMC_EV(PPC970, GCT_EMPTY_BY_SRQ_FULL) \
1478 	__PMC_EV(PPC970, STOP_COMPLETION) \
1479 	__PMC_EV(PPC970, LSU_EMPTY) \
1480 	__PMC_EV(PPC970, MARKED_STORE_WITH_INTR) \
1481 	__PMC_EV(PPC970, CYCLES_IN_SUPER) \
1482 	__PMC_EV(PPC970, VPU_MARKED_INSTR_COMPLETED) \
1483 	__PMC_EV(PPC970, FXU0_IDLE_FXU1_BUSY) \
1484 	__PMC_EV(PPC970, SRQ_EMPTY) \
1485 	__PMC_EV(PPC970, MARKED_GROUP_COMPLETED) \
1486 	__PMC_EV(PPC970, CR_MARKED_INSTR_FINISH) \
1487 	__PMC_EV(PPC970, DISPATCH_SUCCESS) \
1488 	__PMC_EV(PPC970, FXU0_IDLE_FXU1_IDLE) \
1489 	__PMC_EV(PPC970, ONE_PLUS_INSTR_COMPLETED) \
1490 	__PMC_EV(PPC970, GROUP_MARKED_IDU) \
1491 	__PMC_EV(PPC970, MARKED_GROUP_COMPLETE_TIMEOUT) \
1492 	__PMC_EV(PPC970, FXU0_BUSY_FXU1_BUSY) \
1493 	__PMC_EV(PPC970, MARKED_STORE_SENT_TO_STS) \
1494 	__PMC_EV(PPC970, FXU_MARKED_INSTR_FINISHED) \
1495 	__PMC_EV(PPC970, MARKED_GROUP_ISSUED) \
1496 	__PMC_EV(PPC970, FXU0_BUSY_FXU1_IDLE) \
1497 	__PMC_EV(PPC970, GROUP_COMPLETED) \
1498 	__PMC_EV(PPC970, FPU_MARKED_INSTR_COMPLETED) \
1499 	__PMC_EV(PPC970, MARKED_INSTR_FINISH_ANY_UNIT) \
1500 	__PMC_EV(PPC970, EXTERNAL_INTERRUPT) \
1501 	__PMC_EV(PPC970, GROUP_DISPATCH_REJECT) \
1502 	__PMC_EV(PPC970, LSU_MARKED_INSTR_FINISH) \
1503 	__PMC_EV(PPC970, TIMEBASE_EVENT) \
1504 	__PMC_EV(PPC970, LSU_COMPLETION_STALL) \
1505 	__PMC_EV(PPC970, FXU_COMPLETION_STALL) \
1506 	__PMC_EV(PPC970, DCACHE_MISS_COMPLETION_STALL) \
1507 	__PMC_EV(PPC970, FPU_COMPLETION_STALL) \
1508 	__PMC_EV(PPC970, FXU_LONG_INSTR_COMPLETION_STALL) \
1509 	__PMC_EV(PPC970, REJECT_COMPLETION_STALL) \
1510 	__PMC_EV(PPC970, FPU_LONG_INSTR_COMPLETION_STALL) \
1511 	__PMC_EV(PPC970, GCT_EMPTY_BY_ICACHE_MISS) \
1512 	__PMC_EV(PPC970, REJECT_COMPLETION_STALL_ERAT_MISS) \
1513 	__PMC_EV(PPC970, GCT_EMPTY_BY_BRANCH_MISS_PREDICT) \
1514 	__PMC_EV(PPC970, BUS_HIGH) \
1515 	__PMC_EV(PPC970, BUS_LOW) \
1516 	__PMC_EV(PPC970, ADDER)
1517 
1518 
1519 #define PMC_EV_PPC970_FIRST		PMC_EV_PPC970_INSTR_COMPLETED
1520 #define PMC_EV_PPC970_LAST		PMC_EV_PPC970_ADDER
1521 
1522 #define __PMC_EV_E500() \
1523 	__PMC_EV(E500, CYCLES) \
1524 	__PMC_EV(E500, INSTR_COMPLETED) \
1525 	__PMC_EV(E500, UOPS_COMPLETED) \
1526 	__PMC_EV(E500, INSTR_FETCHED) \
1527 	__PMC_EV(E500, UOPS_DECODED) \
1528 	__PMC_EV(E500, PM_EVENT_TRANSITIONS) \
1529 	__PMC_EV(E500, PM_EVENT_CYCLES) \
1530 	__PMC_EV(E500, BRANCH_INSTRS_COMPLETED) \
1531 	__PMC_EV(E500, LOAD_UOPS_COMPLETED) \
1532 	__PMC_EV(E500, STORE_UOPS_COMPLETED) \
1533 	__PMC_EV(E500, CQ_REDIRECTS) \
1534 	__PMC_EV(E500, BRANCHES_FINISHED) \
1535 	__PMC_EV(E500, TAKEN_BRANCHES_FINISHED) \
1536 	__PMC_EV(E500, FINISHED_UNCOND_BRANCHES_MISS_BTB) \
1537 	__PMC_EV(E500, BRANCH_MISPRED) \
1538 	__PMC_EV(E500, BTB_BRANCH_MISPRED_FROM_DIRECTION) \
1539 	__PMC_EV(E500, BTB_HITS_PSEUDO_HITS) \
1540 	__PMC_EV(E500, CYCLES_DECODE_STALLED) \
1541 	__PMC_EV(E500, CYCLES_ISSUE_STALLED) \
1542 	__PMC_EV(E500, CYCLES_BRANCH_ISSUE_STALLED) \
1543 	__PMC_EV(E500, CYCLES_SU1_SCHED_STALLED) \
1544 	__PMC_EV(E500, CYCLES_SU2_SCHED_STALLED) \
1545 	__PMC_EV(E500, CYCLES_MU_SCHED_STALLED) \
1546 	__PMC_EV(E500, CYCLES_LRU_SCHED_STALLED) \
1547 	__PMC_EV(E500, CYCLES_BU_SCHED_STALLED) \
1548 	__PMC_EV(E500, TOTAL_TRANSLATED) \
1549 	__PMC_EV(E500, LOADS_TRANSLATED) \
1550 	__PMC_EV(E500, STORES_TRANSLATED) \
1551 	__PMC_EV(E500, TOUCHES_TRANSLATED) \
1552 	__PMC_EV(E500, CACHEOPS_TRANSLATED) \
1553 	__PMC_EV(E500, CACHE_INHIBITED_ACCESS_TRANSLATED) \
1554 	__PMC_EV(E500, GUARDED_LOADS_TRANSLATED) \
1555 	__PMC_EV(E500, WRITE_THROUGH_STORES_TRANSLATED) \
1556 	__PMC_EV(E500, MISALIGNED_LOAD_STORE_ACCESS_TRANSLATED) \
1557 	__PMC_EV(E500, TOTAL_ALLOCATED_TO_DLFB) \
1558 	__PMC_EV(E500, LOADS_TRANSLATED_ALLOCATED_TO_DLFB) \
1559 	__PMC_EV(E500, STORES_COMPLETED_ALLOCATED_TO_DLFB) \
1560 	__PMC_EV(E500, TOUCHES_TRANSLATED_ALLOCATED_TO_DLFB) \
1561 	__PMC_EV(E500, STORES_COMPLETED) \
1562 	__PMC_EV(E500, DATA_L1_CACHE_LOCKS) \
1563 	__PMC_EV(E500, DATA_L1_CACHE_RELOADS) \
1564 	__PMC_EV(E500, DATA_L1_CACHE_CASTOUTS) \
1565 	__PMC_EV(E500, LOAD_MISS_DLFB_FULL) \
1566 	__PMC_EV(E500, LOAD_MISS_LDQ_FULL) \
1567 	__PMC_EV(E500, LOAD_GUARDED_MISS) \
1568 	__PMC_EV(E500, STORE_TRANSLATE_WHEN_QUEUE_FULL) \
1569 	__PMC_EV(E500, ADDRESS_COLLISION) \
1570 	__PMC_EV(E500, DATA_MMU_MISS) \
1571 	__PMC_EV(E500, DATA_MMU_BUSY) \
1572 	__PMC_EV(E500, PART2_MISALIGNED_CACHE_ACCESS) \
1573 	__PMC_EV(E500, LOAD_MISS_DLFB_FULL_CYCLES) \
1574 	__PMC_EV(E500, LOAD_MISS_LDQ_FULL_CYCLES) \
1575 	__PMC_EV(E500, LOAD_GUARDED_MISS_CYCLES) \
1576 	__PMC_EV(E500, STORE_TRANSLATE_WHEN_QUEUE_FULL_CYCLES) \
1577 	__PMC_EV(E500, ADDRESS_COLLISION_CYCLES) \
1578 	__PMC_EV(E500, DATA_MMU_MISS_CYCLES) \
1579 	__PMC_EV(E500, DATA_MMU_BUSY_CYCLES) \
1580 	__PMC_EV(E500, PART2_MISALIGNED_CACHE_ACCESS_CYCLES) \
1581 	__PMC_EV(E500, INSTR_L1_CACHE_LOCKS) \
1582 	__PMC_EV(E500, INSTR_L1_CACHE_RELOADS) \
1583 	__PMC_EV(E500, INSTR_L1_CACHE_FETCHES) \
1584 	__PMC_EV(E500, INSTR_MMU_TLB4K_RELOADS) \
1585 	__PMC_EV(E500, INSTR_MMU_VSP_RELOADS) \
1586 	__PMC_EV(E500, DATA_MMU_TLB4K_RELOADS) \
1587 	__PMC_EV(E500, DATA_MMU_VSP_RELOADS) \
1588 	__PMC_EV(E500, L2MMU_MISSES) \
1589 	__PMC_EV(E500, BIU_MASTER_REQUESTS) \
1590 	__PMC_EV(E500, BIU_MASTER_INSTR_SIDE_REQUESTS) \
1591 	__PMC_EV(E500, BIU_MASTER_DATA_SIDE_REQUESTS) \
1592 	__PMC_EV(E500, BIU_MASTER_DATA_SIDE_CASTOUT_REQUESTS) \
1593 	__PMC_EV(E500, BIU_MASTER_RETRIES) \
1594 	__PMC_EV(E500, SNOOP_REQUESTS) \
1595 	__PMC_EV(E500, SNOOP_HITS) \
1596 	__PMC_EV(E500, SNOOP_PUSHES) \
1597 	__PMC_EV(E500, SNOOP_RETRIES) \
1598 	__PMC_EV(E500, DLFB_LOAD_MISS_CYCLES) \
1599 	__PMC_EV(E500, ILFB_FETCH_MISS_CYCLES) \
1600 	__PMC_EV(E500, EXT_INPU_INTR_LATENCY_CYCLES) \
1601 	__PMC_EV(E500, CRIT_INPUT_INTR_LATENCY_CYCLES) \
1602 	__PMC_EV(E500, EXT_INPUT_INTR_PENDING_LATENCY_CYCLES) \
1603 	__PMC_EV(E500, CRIT_INPUT_INTR_PENDING_LATENCY_CYCLES) \
1604 	__PMC_EV(E500, PMC0_OVERFLOW) \
1605 	__PMC_EV(E500, PMC1_OVERFLOW) \
1606 	__PMC_EV(E500, PMC2_OVERFLOW) \
1607 	__PMC_EV(E500, PMC3_OVERFLOW) \
1608 	__PMC_EV(E500, INTERRUPTS_TAKEN) \
1609 	__PMC_EV(E500, EXT_INPUT_INTR_TAKEN) \
1610 	__PMC_EV(E500, CRIT_INPUT_INTR_TAKEN) \
1611 	__PMC_EV(E500, SYSCALL_TRAP_INTR) \
1612 	__PMC_EV(E500, TLB_BIT_TRANSITIONS) \
1613 	__PMC_EV(E500, L2_LINEFILL_BUFFER) \
1614 	__PMC_EV(E500, LV2_VS) \
1615 	__PMC_EV(E500, CASTOUTS_RELEASED) \
1616 	__PMC_EV(E500, INTV_ALLOCATIONS) \
1617 	__PMC_EV(E500, DLFB_RETRIES_TO_MBAR) \
1618 	__PMC_EV(E500, STORE_RETRIES) \
1619 	__PMC_EV(E500, STASH_L1_HITS) \
1620 	__PMC_EV(E500, STASH_L2_HITS) \
1621 	__PMC_EV(E500, STASH_BUSY_1) \
1622 	__PMC_EV(E500, STASH_BUSY_2) \
1623 	__PMC_EV(E500, STASH_BUSY_3) \
1624 	__PMC_EV(E500, STASH_HITS) \
1625 	__PMC_EV(E500, STASH_HIT_DLFB) \
1626 	__PMC_EV(E500, STASH_REQUESTS) \
1627 	__PMC_EV(E500, STASH_REQUESTS_L1) \
1628 	__PMC_EV(E500, STASH_REQUESTS_L2) \
1629 	__PMC_EV(E500, STALLS_NO_CAQ_OR_COB) \
1630 	__PMC_EV(E500, L2_CACHE_ACCESSES) \
1631 	__PMC_EV(E500, L2_HIT_CACHE_ACCESSES) \
1632 	__PMC_EV(E500, L2_CACHE_DATA_ACCESSES) \
1633 	__PMC_EV(E500, L2_CACHE_DATA_HITS) \
1634 	__PMC_EV(E500, L2_CACHE_INSTR_ACCESSES) \
1635 	__PMC_EV(E500, L2_CACHE_INSTR_HITS) \
1636 	__PMC_EV(E500, L2_CACHE_ALLOCATIONS) \
1637 	__PMC_EV(E500, L2_CACHE_DATA_ALLOCATIONS) \
1638 	__PMC_EV(E500, L2_CACHE_DIRTY_DATA_ALLOCATIONS) \
1639 	__PMC_EV(E500, L2_CACHE_INSTR_ALLOCATIONS) \
1640 	__PMC_EV(E500, L2_CACHE_UPDATES) \
1641 	__PMC_EV(E500, L2_CACHE_CLEAN_UPDATES) \
1642 	__PMC_EV(E500, L2_CACHE_DIRTY_UPDATES) \
1643 	__PMC_EV(E500, L2_CACHE_CLEAN_REDUNDANT_UPDATES) \
1644 	__PMC_EV(E500, L2_CACHE_DIRTY_REDUNDANT_UPDATES) \
1645 	__PMC_EV(E500, L2_CACHE_LOCKS) \
1646 	__PMC_EV(E500, L2_CACHE_CASTOUTS) \
1647 	__PMC_EV(E500, L2_CACHE_DATA_DIRTY_HITS) \
1648 	__PMC_EV(E500, INSTR_LFB_WENT_HIGH_PRIORITY) \
1649 	__PMC_EV(E500, SNOOP_THROTTLING_TURNED_ON) \
1650 	__PMC_EV(E500, L2_CLEAN_LINE_INVALIDATIONS) \
1651 	__PMC_EV(E500, L2_INCOHERENT_LINE_INVALIDATIONS) \
1652 	__PMC_EV(E500, L2_COHERENT_LINE_INVALIDATIONS) \
1653 	__PMC_EV(E500, COHERENT_LOOKUP_MISS_DUE_TO_VALID_BUT_INCOHERENT_MATCHES) \
1654 	__PMC_EV(E500, IAC1S_DETECTED) \
1655 	__PMC_EV(E500, IAC2S_DETECTED) \
1656 	__PMC_EV(E500, DAC1S_DTECTED) \
1657 	__PMC_EV(E500, DAC2S_DTECTED) \
1658 	__PMC_EV(E500, DVT0_DETECTED) \
1659 	__PMC_EV(E500, DVT1_DETECTED) \
1660 	__PMC_EV(E500, DVT2_DETECTED) \
1661 	__PMC_EV(E500, DVT3_DETECTED) \
1662 	__PMC_EV(E500, DVT4_DETECTED) \
1663 	__PMC_EV(E500, DVT5_DETECTED) \
1664 	__PMC_EV(E500, DVT6_DETECTED) \
1665 	__PMC_EV(E500, DVT7_DETECTED) \
1666 	__PMC_EV(E500, CYCLES_COMPLETION_STALLED_NEXUS_FIFO_FULL) \
1667 	__PMC_EV(E500, FPU_DOUBLE_PUMP) \
1668 	__PMC_EV(E500, FPU_FINISH) \
1669 	__PMC_EV(E500, FPU_DIVIDE_CYCLES) \
1670 	__PMC_EV(E500, FPU_DENORM_INPUT_CYCLES) \
1671 	__PMC_EV(E500, FPU_RESULT_STALL_CYCLES) \
1672 	__PMC_EV(E500, FPU_FPSCR_FULL_STALL) \
1673 	__PMC_EV(E500, FPU_PIPE_SYNC_STALLS) \
1674 	__PMC_EV(E500, FPU_INPUT_DATA_STALLS) \
1675 	__PMC_EV(E500, DECORATED_LOADS) \
1676 	__PMC_EV(E500, DECORATED_STORES) \
1677 	__PMC_EV(E500, LOAD_RETRIES) \
1678 	__PMC_EV(E500, STWCX_SUCCESSES) \
1679 	__PMC_EV(E500, STWCX_FAILURES) \
1680 
1681 #define PMC_EV_E500_FIRST		PMC_EV_E500_CYCLES
1682 #define PMC_EV_E500_LAST		PMC_EV_E500_STWCX_FAILURES
1683 /*
1684  * All known PMC events.
1685  *
1686  * PMC event numbers are allocated sparsely to allow new PMC events to
1687  * be added to a PMC class without breaking ABI compatibility.  The
1688  * current allocation scheme is:
1689  *
1690  * START	#EVENTS		DESCRIPTION
1691  * 0		0x1000		Reserved
1692  * 0x1000	0x0001		TSC
1693  * 0x2000	0x0080		AMD K7 events
1694  * 0x2080	0x0100		AMD K8 events
1695  * 0x10000	0x0080		INTEL architectural fixed-function events
1696  * 0x10080	0x0F80		INTEL architectural programmable events
1697  * 0x11000	0x0080		INTEL Pentium 4 events
1698  * 0x11080	0x0080		INTEL Pentium MMX events
1699  * 0x11100	0x0100		INTEL Pentium Pro/P-II/P-III/Pentium-M events
1700  * 0x11200	0x00FF		free (was INTEL XScale events)
1701  * 0x11300	0x00FF		free (was MIPS 24K events)
1702  * 0x11400	0x00FF		free (was Octeon events)
1703  * 0x11500	0x00FF		free (was MIPS 74K events)
1704  * 0x11600	0x00FF		free (was BERI statcounters)
1705  * 0x13000	0x00FF		MPC7450 events
1706  * 0x13100	0x00FF		IBM PPC970 events
1707  * 0x13200	0x00FF		free (was IBM POWER8 events)
1708  * 0x13300	0x00FF		Freescale e500 events
1709  * 0x14000	0x0100		ARMv7 events
1710  * 0x14100	0x0100		ARMv8 events
1711  * 0x14200	0x0020		ARM DMC-620 clkdiv2 events
1712  * 0x14220	0x0080		ARM DMC-620 clk events
1713  * 0x14300	0x0100		ARM CMN-600 events
1714  * 0x20000	0x1000		Software events
1715  */
1716 #define	__PMC_EVENTS()				\
1717 	__PMC_EV_BLOCK(TSC,	0x01000)	\
1718 	__PMC_EV_TSC()				\
1719 	__PMC_EV_BLOCK(IAF,     0x10000)	\
1720 	__PMC_EV_IAF()				\
1721 	__PMC_EV_BLOCK(K7,	0x2000)		\
1722 	__PMC_EV_K7()				\
1723 	__PMC_EV_BLOCK(K8,	0x2080)	        \
1724 	__PMC_EV_K8()				\
1725 	__PMC_EV_BLOCK(UCP,     0x12080)        \
1726 	__PMC_EV_UCP()				\
1727 	__PMC_EV_BLOCK(PPC7450,	0x13000)	\
1728 	__PMC_EV_PPC7450()			\
1729 	__PMC_EV_BLOCK(PPC970,	0x13100)	\
1730 	__PMC_EV_PPC970()			\
1731 	__PMC_EV_BLOCK(E500,	0x13300)	\
1732 	__PMC_EV_E500()				\
1733 	__PMC_EV_BLOCK(ARMV7,	0x14000)	\
1734 	__PMC_EV_ARMV7()			\
1735 	__PMC_EV_BLOCK(ARMV8,	0x14100)	\
1736 	__PMC_EV_ARMV8()			\
1737 	__PMC_EV_BLOCK(DMC620_PMU_CD2, 0x14200)	\
1738 	__PMC_EV_DMC620_PMU_CD2()		\
1739 	__PMC_EV_BLOCK(DMC620_PMU_C, 0x14220)	\
1740 	__PMC_EV_DMC620_PMU_C()			\
1741 	__PMC_EV_BLOCK(CMN600_PMU, 0x14300)	\
1742 	__PMC_EV_CMN600_PMU()
1743 
1744 #define	PMC_EVENT_FIRST	PMC_EV_TSC_TSC
1745 #define	PMC_EVENT_LAST	PMC_EV_SOFT_LAST
1746 
1747 #endif /* _DEV_HWPMC_PMC_EVENTS_H_ */
1748