libmsr  0.3.0
A friendlier interface to accessing MSRs on Intel platforms
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
master.h
Go to the documentation of this file.
1 // This file was generated automatically by autoconf.c
2 // You should not modify it unless you really know what you're doing.
3 /* Intel Ivy Bridge Master Header File
4  *
5  * Copyright (c) 2011-2016, Lawrence Livermore National Security, LLC.
6  * LLNL-CODE-645430
7  *
8  * Produced at Lawrence Livermore National Laboratory
9  * Written by Barry Rountree, rountree@llnl.gov
10  * Scott Walker, walker91@llnl.gov
11  * Kathleen Shoga, shoga1@llnl.gov
12  *
13  * All rights reserved.
14  *
15  * This file is part of libmsr.
16  *
17  * libmsr is free software: you can redistribute it and/or modify it under the
18  * terms of the GNU Lesser General Public License as published by the Free
19  * Software Foundation, either version 3 of the License, or (at your option)
20  * any later version.
21  *
22  * libmsr is distributed in the hope that it will be useful, but WITHOUT ANY
23  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
24  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
25  * more details.
26  *
27  * You should have received a copy of the GNU Lesser General Public License
28  * along with libmsr. If not, see <http://www.gnu.org/licenses/>.
29  *
30  * This material is based upon work supported by the U.S. Department of
31  * Energy's Lawrence Livermore National Laboratory. Office of Science, under
32  * Award number DE-AC52-07NA27344.
33  *
34  */
35 
36 #define COMPILED_VEND 0x8086 // Intel
37 #define COMPILED_ARCH 0x3E // Ivy Bridge
38 
39 /**********/
40 /* CLOCKS */
41 /**********/
42 #define IA32_MPERF 0xE7
43 #define IA32_APERF 0xE8
44 #define IA32_TIME_STAMP_COUNTER 0x10
45 #define IA32_CLOCK_MODULATION 0x19A
46 #define IA32_PERF_STATUS 0x198
47 #define IA32_PERF_CTL 0x199
48 
49 /************/
50 /* COUNTERS */
51 /************/
52 #define IA32_FIXED_CTR_CTRL 0x38D // Controls for fixed ctr0, 1, and 2
53 #define IA32_PERF_GLOBAL_CTRL 0x38F // Enables for fixed ctr0,1,and2 here
54 #define IA32_PERF_GLOBAL_STATUS 0x38E // Overflow condition can be found here
55 #define IA32_PERF_GLOBAL_OVF_CTRL 0x390 // Can clear the overflow here
56 #define IA32_FIXED_CTR0 0x309 // (R/W) Counts Instr_Retired.Any
57 #define IA32_FIXED_CTR1 0x30A // (R/W) Counts CPU_CLK_Unhalted.Core
58 #define IA32_FIXED_CTR2 0x30B // (R/W) Counts CPU_CLK_Unhalted.Ref
59 
60 #define IA32_PMC0 0xC1
61 #define IA32_PMC1 0xC2
62 #define IA32_PMC2 0xC3
63 #define IA32_PMC3 0xC4
64 #define IA32_PMC4 0xC5
65 #define IA32_PMC5 0xC6
66 #define IA32_PMC6 0xC7
67 #define IA32_PMC7 0xC8
68 
69 #define IA32_PERFEVTSEL0 0x186
70 #define IA32_PERFEVTSEL1 0x187
71 #define IA32_PERFEVTSEL2 0x188
72 #define IA32_PERFEVTSEL3 0x189
73 #define IA32_PERFEVTSEL4 0x18A
74 #define IA32_PERFEVTSEL5 0x18B
75 #define IA32_PERFEVTSEL6 0x18C
76 #define IA32_PERFEVTSEL7 0x18D
77 
78 #define MSR_PCU_PMON_EVNTSEL0 0xC30
79 #define MSR_PCU_PMON_EVNTSEL1 0xC31
80 #define MSR_PCU_PMON_EVNTSEL2 0xC32
81 #define MSR_PCU_PMON_EVNTSEL3 0xC33
82 #define MSR_PCU_PMON_CTR0 0xC36
83 #define MSR_PCU_PMON_CTR1 0xC37
84 #define MSR_PCU_PMON_CTR2 0xC38
85 #define MSR_PCU_PMON_CTR3 0xC39
86 
87 #define MSR_C0_PMON_BOX_CTL 0xD04
88 #define MSR_C0_PMON_EVNTSEL0 0xD10
89 #define MSR_C0_PMON_EVNTSEL1 0xD11
90 #define MSR_C0_PMON_EVNTSEL2 0xD12
91 #define MSR_C0_PMON_EVNTSEL3 0xD13
92 #define MSR_C0_BOX_FILTER 0xD14
93 #define MSR_C0_PMON_CTR0 0xD16
94 #define MSR_C0_PMON_CTR1 0xD17
95 #define MSR_C0_PMON_CTR2 0xD18
96 #define MSR_C0_PMON_CTR3 0xD19
97 #define MSR_C0_BOX_FILTER1 0xD1A
98 
99 #define MSR_C1_PMON_BOX_CTL 0xD24
100 #define MSR_C1_PMON_EVNTSEL0 0xD30
101 #define MSR_C1_PMON_EVNTSEL1 0xD31
102 #define MSR_C1_PMON_EVNTSEL2 0xD32
103 #define MSR_C1_PMON_EVNTSEL3 0xD33
104 #define MSR_C1_BOX_FILTER 0xD34
105 #define MSR_C1_PMON_CTR0 0xD36
106 #define MSR_C1_PMON_CTR1 0xD37
107 #define MSR_C1_PMON_CTR2 0xD38
108 #define MSR_C1_PMON_CTR3 0xD39
109 #define MSR_C1_BOX_FILTER1 0xD3A
110 
111 #define MSR_C2_PMON_BOX_CTL 0xD44
112 #define MSR_C2_PMON_EVNTSEL0 0xD50
113 #define MSR_C2_PMON_EVNTSEL1 0xD51
114 #define MSR_C2_PMON_EVNTSEL2 0xD52
115 #define MSR_C2_PMON_EVNTSEL3 0xD53
116 #define MSR_C2_BOX_FILTER 0xD54
117 #define MSR_C2_PMON_CTR0 0xD56
118 #define MSR_C2_PMON_CTR1 0xD57
119 #define MSR_C2_PMON_CTR2 0xD58
120 #define MSR_C2_PMON_CTR3 0xD59
121 #define MSR_C2_BOX_FILTER1 0xD5A
122 
123 #define MSR_C3_PMON_BOX_CTL 0xD64
124 #define MSR_C3_PMON_EVNTSEL0 0xD70
125 #define MSR_C3_PMON_EVNTSEL1 0xD71
126 #define MSR_C3_PMON_EVNTSEL2 0xD72
127 #define MSR_C3_PMON_EVNTSEL3 0xD73
128 #define MSR_C3_BOX_FILTER 0xD74
129 #define MSR_C3_PMON_CTR0 0xD76
130 #define MSR_C3_PMON_CTR1 0xD77
131 #define MSR_C3_PMON_CTR2 0xD78
132 #define MSR_C3_PMON_CTR3 0xD79
133 #define MSR_C3_BOX_FILTER1 0xD7A
134 
135 #define MSR_C4_PMON_BOX_CTL 0xD84
136 #define MSR_C4_PMON_EVNTSEL0 0xD90
137 #define MSR_C4_PMON_EVNTSEL1 0xD91
138 #define MSR_C4_PMON_EVNTSEL2 0xD92
139 #define MSR_C4_PMON_EVNTSEL3 0xD93
140 #define MSR_C4_BOX_FILTER 0xD94
141 #define MSR_C4_PMON_CTR0 0xD96
142 #define MSR_C4_PMON_CTR1 0xD97
143 #define MSR_C4_PMON_CTR2 0xD98
144 #define MSR_C4_PMON_CTR3 0xD99
145 #define MSR_C4_BOX_FILTER1 0xD9A
146 
147 #define MSR_C5_PMON_BOX_CTL 0xDA4
148 #define MSR_C5_PMON_EVNTSEL0 0xDB0
149 #define MSR_C5_PMON_EVNTSEL1 0xDB1
150 #define MSR_C5_PMON_EVNTSEL2 0xDB2
151 #define MSR_C5_PMON_EVNTSEL3 0xDB3
152 #define MSR_C5_BOX_FILTER 0xDB4
153 #define MSR_C5_PMON_CTR0 0xDB6
154 #define MSR_C5_PMON_CTR1 0xDB7
155 #define MSR_C5_PMON_CTR2 0xDB8
156 #define MSR_C5_PMON_CTR3 0xDB9
157 #define MSR_C5_BOX_FILTER1 0xDBA
158 
159 #define MSR_C6_PMON_BOX_CTL 0xDC4
160 #define MSR_C6_PMON_EVNTSEL0 0xDD0
161 #define MSR_C6_PMON_EVNTSEL1 0xDD1
162 #define MSR_C6_PMON_EVNTSEL2 0xDD2
163 #define MSR_C6_PMON_EVNTSEL3 0xDD3
164 #define MSR_C6_BOX_FILTER 0xDD4
165 #define MSR_C6_PMON_CTR0 0xDD6
166 #define MSR_C6_PMON_CTR1 0xDD7
167 #define MSR_C6_PMON_CTR2 0xDD8
168 #define MSR_C6_PMON_CTR3 0xDD9
169 #define MSR_C6_BOX_FILTER1 0xDDA
170 
171 #define MSR_C7_PMON_BOX_CTL 0xDE4
172 #define MSR_C7_PMON_EVNTSEL0 0xDF0
173 #define MSR_C7_PMON_EVNTSEL1 0xDF1
174 #define MSR_C7_PMON_EVNTSEL2 0xDF2
175 #define MSR_C7_PMON_EVNTSEL3 0xDF3
176 #define MSR_C7_BOX_FILTER 0xDF4
177 #define MSR_C7_PMON_CTR0 0xDF6
178 #define MSR_C7_PMON_CTR1 0xDF7
179 #define MSR_C7_PMON_CTR2 0xDF8
180 #define MSR_C7_PMON_CTR3 0xDF9
181 #define MSR_C7_BOX_FILTER1 0xDFA
182 
183 #define MSR_C8_PMON_BOX_CTL 0xE04
184 #define MSR_C8_PMON_EVNTSEL0 0xE10
185 #define MSR_C8_PMON_EVNTSEL1 0xE11
186 #define MSR_C8_PMON_EVNTSEL2 0xE12
187 #define MSR_C8_PMON_EVNTSEL3 0xE13
188 #define MSR_C8_BOX_FILTER 0xE14
189 #define MSR_C8_PMON_CTR0 0xE16
190 #define MSR_C8_PMON_CTR1 0xE17
191 #define MSR_C8_PMON_CTR2 0xE18
192 #define MSR_C8_PMON_CTR3 0xE19
193 #define MSR_C8_BOX_FILTER1 0xE1A
194 
195 #define MSR_C9_PMON_BOX_CTL 0xE24
196 #define MSR_C9_PMON_EVNTSEL0 0xE30
197 #define MSR_C9_PMON_EVNTSEL1 0xE31
198 #define MSR_C9_PMON_EVNTSEL2 0xE32
199 #define MSR_C9_PMON_EVNTSEL3 0xE33
200 #define MSR_C9_BOX_FILTER 0xE34
201 #define MSR_C9_PMON_CTR0 0xE36
202 #define MSR_C9_PMON_CTR1 0xE37
203 #define MSR_C9_PMON_CTR2 0xE38
204 #define MSR_C9_PMON_CTR3 0xE39
205 #define MSR_C9_BOX_FILTER1 0xE3A
206 
207 #define MSR_C10_PMON_BOX_CTL 0xE44
208 #define MSR_C10_PMON_EVNTSEL0 0xE50
209 #define MSR_C10_PMON_EVNTSEL1 0xE51
210 #define MSR_C10_PMON_EVNTSEL2 0xE52
211 #define MSR_C10_PMON_EVNTSEL3 0xE53
212 #define MSR_C10_BOX_FILTER 0xE54
213 #define MSR_C10_PMON_CTR0 0xE56
214 #define MSR_C10_PMON_CTR1 0xE57
215 #define MSR_C10_PMON_CTR2 0xE58
216 #define MSR_C10_PMON_CTR3 0xE59
217 #define MSR_C10_BOX_FILTER1 0xE5A
218 
219 #define MSR_C11_PMON_BOX_CTL 0xE64
220 #define MSR_C11_PMON_EVNTSEL0 0xE70
221 #define MSR_C11_PMON_EVNTSEL1 0xE71
222 #define MSR_C11_PMON_EVNTSEL2 0xE72
223 #define MSR_C11_PMON_EVNTSEL3 0xE73
224 #define MSR_C11_BOX_FILTER 0xE74
225 #define MSR_C11_PMON_CTR0 0xE76
226 #define MSR_C11_PMON_CTR1 0xE77
227 #define MSR_C11_PMON_CTR2 0xE78
228 #define MSR_C11_PMON_CTR3 0xE79
229 #define MSR_C11_BOX_FILTER1 0xE7A
230 
231 #define MSR_C12_PMON_BOX_CTL 0xE84
232 #define MSR_C12_PMON_EVNTSEL0 0xE90
233 #define MSR_C12_PMON_EVNTSEL1 0xE91
234 #define MSR_C12_PMON_EVNTSEL2 0xE92
235 #define MSR_C12_PMON_EVNTSEL3 0xE93
236 #define MSR_C12_BOX_FILTER 0xE94
237 #define MSR_C12_PMON_CTR0 0xE96
238 #define MSR_C12_PMON_CTR1 0xE97
239 #define MSR_C12_PMON_CTR2 0xE98
240 #define MSR_C12_PMON_CTR3 0xE99
241 #define MSR_C12_BOX_FILTER1 0xE9A
242 
243 #define MSR_C13_PMON_BOX_CTL 0xEA4
244 #define MSR_C13_PMON_EVNTSEL0 0xEB0
245 #define MSR_C13_PMON_EVNTSEL1 0xEB1
246 #define MSR_C13_PMON_EVNTSEL2 0xEB2
247 #define MSR_C13_PMON_EVNTSEL3 0xEB3
248 #define MSR_C13_BOX_FILTER 0xEB4
249 #define MSR_C13_PMON_CTR0 0xEB6
250 #define MSR_C13_PMON_CTR1 0xEB7
251 #define MSR_C13_PMON_CTR2 0xEB8
252 #define MSR_C13_PMON_CTR3 0xEB9
253 #define MSR_C13_BOX_FILTER1 0xEBA
254 
255 #define MSR_C14_PMON_BOX_CTL 0xEC4
256 #define MSR_C14_PMON_EVNTSEL0 0xED0
257 #define MSR_C14_PMON_EVNTSEL1 0xED1
258 #define MSR_C14_PMON_EVNTSEL2 0xED2
259 #define MSR_C14_PMON_EVNTSEL3 0xED3
260 #define MSR_C14_BOX_FILTER 0xED4
261 #define MSR_C14_PMON_CTR0 0xED6
262 #define MSR_C14_PMON_CTR1 0xED7
263 #define MSR_C14_PMON_CTR2 0xED8
264 #define MSR_C14_PMON_CTR3 0xED9
265 #define MSR_C14_BOX_FILTER1 0xEDA
266 
267 /********/
268 /* MISC */
269 /********/
270 #define IA32_MISC_ENABLE 0x1A0
271 #define MSR_PKG_C2_RESIDENCY 0x60D
272 #define MSR_PKG_C3_RESIDENCY 0x3F8
273 #define MSR_PKG_C6_RESIDENCY 0x3F9
274 #define MSR_PKG_C7_RESIDENCY 0x3FA
275 #define MSR_CORE_C3_RESIDENCY 0x3FC
276 #define MSR_CORE_C6_RESIDENCY 0x3FD
277 #define MSR_CORE_C7_RESIDENCY 0x3FE
278 
279 /********/
280 /* RAPL */
281 /********/
282 #define MSR_RAPL_POWER_UNIT 0x606 // ro
283 #define MSR_PKG_POWER_LIMIT 0x610 // rw
284 #define MSR_PKG_ENERGY_STATUS 0x611 // ro sic;
285 #define MSR_PKG_POWER_INFO 0x614 // rw text states ro
286 #define MSR_PP0_POWER_LIMIT 0x638 // rw
287 #define MSR_PP0_ENERGY_STATUS 0x639 // ro
288 #define MSR_PP0_POLICY 0x63A // rw
289 #define MSR_PP0_PERF_STATUS 0x63B // ro
290 
291 #define MSR_PP1_POWER_LIMIT 0x640 // rw
292 #define MSR_PP1_ENERGY_STATUS 0x641 // ro. sic
293 #define MSR_PP1_POLICY 0x642 // rw
294 
295 #define MSR_PKG_PERF_STATUS 0x613 // ro
296 #define MSR_DRAM_POWER_LIMIT 0x618 // rw
297 #define MSR_DRAM_ENERGY_STATUS 0x619 // ro. sic;
298 #define MSR_DRAM_PERF_STATUS 0x61B // ro
299 #define MSR_DRAM_POWER_INFO 0x61C // rw text states ro
300 
301 /***********/
302 /* THERMAL */
303 /***********/
304 #define IA32_THERM_STATUS 0x19C
305 #define MSR_THERM2_CTL 0x19D
306 #define IA32_THERM_INTERRUPT 0x19B
307 #define IA32_PACKAGE_THERM_STATUS 0x1B1
308 #define IA32_PACKAGE_THERM_INTERRUPT 0x1B2
309 #define MSR_TEMPERATURE_TARGET 0x1A2
310 
311 /*********/
312 /* TURBO */
313 /*********/
314 #define IA32_MISC_ENABLE 0x1A0
315 #define IA32_PERF_CTL 0x199
316 #define MSR_TURBO_ACTIVATION_RATIO 0x64C
317 #define MSR_TURBO_RATIO_LIMIT 0x1AD
318 #define MSR_TURBO_RATIO_LIMIT1 0x1AE
319 
320 /***********/
321 /* CSR iMC */
322 /***********/
323 #define IMC0_DEV 16
324 #define IMC1_DEV 30
325 #define IMC_CH0_FUNC 4
326 #define IMC_CH1_FUNC 5
327 #define IMC_CH2_FUNC 0
328 #define IMC_CH3_FUNC 1
329 
330 #define CSR_PMONCTRCFG0 0xD8
331 #define CSR_PMONCTRCFG1 0xDC
332 #define CSR_PMONCTRCFG2 0xE0
333 #define CSR_PMONCTRCFG3 0xE8
334 
335 #define CSR_PMONCTR0 0xA0
336 #define CSR_PMONCTR1 0xA8
337 #define CSR_PMONCTR2 0xB0
338 #define CSR_PMONCTR3 0xB8
339 
340 #define CSR_PMONUNITCTRL 0xF4
341 #define CSR_PMONUNITSTAT 0xF8
342 
343 /******************/
344 /* CSR iMC EVENTS */
345 /******************/
346 #define EVT_DCLOCKTICKS 0x00
347 #define EVT_ACT_COUNT 0x01
348 #define EVT_PRE_COUNT 0x02
349 #define EVT_CAS_COUNT 0x04
350 #define EVT_DRAM_REFRESH 0x05
351 #define EVT_DRAM_PRE_ALL 0x06
352 #define EVT_MAJOR_MODES 0x07
353 #define EVT_PREEMPTION 0x08
354 #define EVT_ECC_CORRECTABLE_ERRORS 0x09
355 #define EVT_RPQ_INSERTS 0x10
356 #define EVT_RPQ_CYCLES_NE 0x11
357 #define EVT_WPQ_INSERTS 0x20
358 #define EVT_WPQ_CYCLES_NE 0x21
359 #define EVT_WPQ_CYCLES_FULL 0x22
360 #define EVT_WPQ_READ_HIT 0x23
361 #define EVT_WPQ_WRITE_HIT 0x24
362 #define EVT_POWER_THROTTLE_CYCLES 0x41
363 #define EVT_POWER_PCU_THROTTLING 0x42
364 #define EVT_POWER_SELF_REFRESH 0x43
365 #define EVT_POWER_CKE_CYCLES 0x83
366 #define EVT_POWER_CHANNEL_DLLOFF 0x84
367 #define EVT_POWER_CHANNEL_PD 0x85
368 #define EVT_POWER_CRITICAL_THROTTLE_CYCLES 0x86
369 #define EVT_VMSE_WR_PUSH 0x90
370 #define EVT_VMSE_MXB_WR_OCCUPANCY 0x91
371 #define EVT_RD_CAS_PRIO 0xA0
372 #define EVT_BYP_CMDS 0xA1
373 #define EVT_RD_CAS_RANK0 0xB0
374 #define EVT_RD_CAS_RANK1 0xB1
375 #define EVT_RD_CAS_RANK2 0xB2
376 #define EVT_RD_CAS_RANK3 0xB3
377 #define EVT_RD_CAS_RANK4 0xB4
378 #define EVT_RD_CAS_RANK5 0xB5
379 #define EVT_RD_CAS_RANK6 0xB6
380 #define EVT_RD_CAS_RANK7 0xB7
381 #define EVT_WR_CAS_RANK0 0xB8
382 #define EVT_WR_CAS_RANK1 0xB9
383 #define EVT_WR_CAS_RANK2 0xBA
384 #define EVT_WR_CAS_RANK3 0xBB
385 #define EVT_WR_CAS_RANK4 0xBC
386 #define EVT_WR_CAS_RANK5 0xBD
387 #define EVT_WR_CAS_RANK6 0xBE
388 #define EVT_WR_CAS_RANK7 0xBF
389 #define EVT_WMM_TO_RMM 0xC0
390 #define EVT_WRONG_MM 0xC1
391 
392 #define UMASK_CAS_RD_REG 0x1
393 #define UMASK_CAS_RD_UNDERFILL 0x2
394 #define UMASK_CAS_RD 0x3
395 #define UMASK_CAS_WR_WMM 0x4
396 #define UMASK_CAS_WR_RMM 0x8
397 #define UMASK_CAS_WR 0xC
398 #define UMASK_CAS_ALL 0xF
399 #define UMASK_CAS_RD_WMM 0x16
400 #define UMASK_CAS_RD_RMM 0x32
401 
402 #define UMASK_ACT_COUNT_RD 0x1
403 #define UMASK_ACT_COUNT_WR 0x2
404 #define UMASK_ACT_COUNT_BYP 0x8
405 
406 #define UMASK_BYP_CMDS_ACT 0x1
407 #define UMASK_BYP_CMDS_CAS 0x2
408 #define UMASK_BYP_CMDS_PRE 0x4
409 // ... there are lots more of these...
410 
411 #define UMASK_PRE_PAGE_MISS 0x1
412 #define UMASK_PRE_PAGE_CLOSE 0x2
413 #define UMASK_PRE_RD 0x4
414 #define UMASK_PRE_WR 0x8
415 #define UMASK_PRE_BYP 0x16