mb/ocp/deltalake: Configure FSP DCI via VPD
[coreboot.git] / util / inteltool / cpu.c
blob284e90b50e587d7c76c2909ac5b1f5317b09de1a
1 /* inteltool - dump all registers on an Intel CPU + chipset based system */
2 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <fcntl.h>
5 #include <unistd.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <errno.h>
11 #include "inteltool.h"
13 #ifdef __x86_64__
14 # define BREG "%%rbx"
15 #else
16 # define BREG "%%ebx"
17 #endif
19 #define IA32_FEATURE_CONTROL 0x3a
20 #define SGX_GLOBAL_ENABLED (1 << 18)
21 #define FEATURE_CONTROL_LOCKED (1)
22 #define MTRR_CAP_MSR 0xfe
23 #define PRMRR_SUPPORTED (1 << 12)
24 #define SGX_SUPPORTED (1 << 2)
26 int fd_msr;
28 unsigned int cpuid(unsigned int op)
30 uint32_t ret;
32 #if defined(__PIC__) || defined(__DARWIN__) && !defined(__LP64__)
33 asm volatile (
34 "push " BREG "\n\t"
35 "cpuid\n\t"
36 "pop " BREG "\n\t"
37 : "=a" (ret) : "a" (op) : "%ecx", "%edx"
39 #else
40 asm ("cpuid" : "=a" (ret) : "a" (op) : "%ebx", "%ecx", "%edx");
41 #endif
43 return ret;
46 inline cpuid_result_t cpuid_ext(int op, unsigned int ecx)
48 cpuid_result_t result;
50 #ifndef __DARWIN__
51 asm volatile (
52 "mov %%ebx, %%edi;"
53 "cpuid;"
54 "mov %%ebx, %%esi;"
55 "mov %%edi, %%ebx;"
56 : "=a" (result.eax),
57 "=S" (result.ebx),
58 "=c" (result.ecx),
59 "=d" (result.edx)
60 : "0" (op), "2" (ecx)
61 : "edi");
62 #endif
63 return result;
66 #ifndef __DARWIN__
67 int msr_readerror = 0;
69 static msr_t rdmsr(int addr)
71 uint32_t buf[2];
72 msr_t msr = { 0xffffffff, 0xffffffff };
74 if (lseek(fd_msr, (off_t) addr, SEEK_SET) == -1) {
75 perror("Could not lseek() to MSR");
76 close(fd_msr);
77 exit(1);
80 if (read(fd_msr, buf, 8) == 8) {
81 msr.lo = buf[0];
82 msr.hi = buf[1];
83 return msr;
86 if (errno == 5) {
87 printf(" (*)"); // Not all bits of the MSR could be read
88 msr_readerror = 1;
89 } else {
90 // A severe error.
91 perror("Could not read() MSR");
92 close(fd_msr);
93 exit(1);
96 return msr;
99 static int open_and_seek(int cpu, unsigned long msr, int mode, int *fd)
101 char dev[32];
102 char temp_string[50];
104 snprintf(dev, sizeof(dev), "/dev/cpu/%d/msr", cpu);
105 *fd = open(dev, mode);
107 if (*fd < 0) {
108 snprintf(temp_string, sizeof(temp_string), "open(\"%s\")", dev);
109 perror(temp_string);
110 return -1;
113 if (lseek(*fd, msr, SEEK_SET) == (off_t)-1) {
114 snprintf(temp_string, sizeof(temp_string), "lseek(%lu)", msr);
115 perror(temp_string);
116 close(*fd);
117 return -1;
120 return 0;
123 static msr_t rdmsr_from_cpu(int cpu, unsigned long addr)
125 int fd;
126 msr_t msr = { 0xffffffff, 0xffffffff };
127 uint32_t buf[2];
128 char temp_string[50];
130 if (open_and_seek(cpu, addr, O_RDONLY, &fd) < 0) {
131 snprintf(temp_string, sizeof(temp_string),
132 "Could not read MSR for CPU#%d", cpu);
133 perror(temp_string);
136 if (read(fd, buf, 8) == 8) {
137 msr.lo = buf[0];
138 msr.hi = buf[1];
141 close(fd);
143 return msr;
146 static int get_number_of_cpus(void)
148 return sysconf(_SC_NPROCESSORS_ONLN);
151 static int get_number_of_cores(void)
153 return sysconf(_SC_NPROCESSORS_CONF);
156 static int is_sgx_supported(int cpunum)
158 cpuid_result_t cpuid_regs;
159 msr_t msr;
161 /* CPUID leaf 0x7 subleaf 0x0 to detect SGX support
162 details are mentioned in Intel SDM Chap.36- section 36.7 */
163 cpuid_regs = cpuid_ext(0x7, 0x0);
164 msr = rdmsr_from_cpu(cpunum, MTRR_CAP_MSR);
165 return ((cpuid_regs.ebx & SGX_SUPPORTED) && (msr.lo & PRMRR_SUPPORTED));
168 static int is_sgx_enabled(int cpunum)
170 msr_t data;
171 data = rdmsr_from_cpu(cpunum, IA32_FEATURE_CONTROL);
172 return (data.lo & SGX_GLOBAL_ENABLED);
175 static int is_sgx_locked(int cpunum)
177 msr_t data;
178 data = rdmsr_from_cpu(cpunum, IA32_FEATURE_CONTROL);
179 return (data.lo & FEATURE_CONTROL_LOCKED);
182 #endif
184 int print_sgx(void)
186 int error = -1;
187 #ifndef __DARWIN__
188 int ncpus = get_number_of_cpus();
189 int i = 0;
191 printf("\n============= Dumping INTEL SGX status =============");
193 if (ncpus < 1) {
194 perror("Failed to get number of CPUs");
195 error = -1;
196 } else {
197 printf("\nNumber of CPUs = %d\n", ncpus);
198 for (i = 0; i < ncpus ; i++) {
200 printf("------------- CPU %d ----------------\n", i);
201 printf("SGX supported : %s\n",
202 is_sgx_supported(i) ? "YES" : "NO");
203 printf("SGX enabled : %s\n",
204 is_sgx_enabled(i) ? "YES" : "NO");
205 printf("Feature Control locked : %s\n",
206 is_sgx_locked(i) ? "YES" : "NO");
208 error = 0;
210 printf("====================================================\n");
211 #endif
212 return error;
215 int print_intel_core_msrs(void)
217 unsigned int i, core, id, core_num = get_number_of_cores();
218 msr_t msr;
220 #define IA32_PLATFORM_ID 0x0017
221 #define EBL_CR_POWERON 0x002a
222 #define FSB_CLK_STS 0x00cd
223 #define IA32_TIME_STAMP_COUNTER 0x0010
224 #define IA32_APIC_BASE 0x001b
226 typedef struct {
227 int number;
228 char *name;
229 } msr_entry_t;
231 /* Pentium III */
232 static const msr_entry_t model67x_global_msrs[] = {
233 { 0x0000, "IA32_P5_MC_ADDR" },
234 { 0x0001, "IA32_P5_MC_TYPE" },
235 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
236 { 0x0017, "IA32_PLATFORM_ID" },
237 { 0x001b, "IA32_APIC_BASE" },
238 { 0x002a, "EBL_CR_POWERON" },
239 { 0x0033, "TEST_CTL" },
240 //{ 0x0079, "IA32_BIOS_UPDT_TRIG" }, // Seems to be RO
241 { 0x0088, "BBL_CR_D0" },
242 { 0x0089, "BBL_CR_D1" },
243 { 0x008a, "BBL_CR_D2" },
244 { 0x008b, "IA32_BIOS_SIGN_ID" },
245 { 0x00c1, "PERFCTR0" },
246 { 0x00c2, "PERFCTR1" },
247 { 0x00fe, "IA32_MTRRCAP" },
248 { 0x0116, "BBL_CR_ADDR" },
249 { 0x0118, "BBL_CR_DECC" },
250 { 0x0119, "BBL_CR_CTL" },
251 //{ 0x011a, "BBL_CR_TRIG" },
252 { 0x011b, "BBL_CR_BUSY" },
253 { 0x011e, "BBL_CR_CTL3" },
254 { 0x0174, "IA32_SYSENTER_CS" },
255 { 0x0175, "IA32_SYSENTER_ESP" },
256 { 0x0176, "IA32_SYSENTER_EIP" },
257 { 0x0179, "IA32_MCG_CAP" },
258 { 0x017a, "IA32_MCG_STATUS" },
259 { 0x017b, "IA32_MCG_CTL" },
260 { 0x0186, "IA32_PERF_EVNTSEL0" },
261 { 0x0187, "IA32_PERF_EVNTSEL1" },
262 { 0x01d9, "IA32_DEBUGCTL" },
263 { 0x01db, "MSR_LASTBRANCHFROMIP" },
264 { 0x01dc, "MSR_LASTBRANCHTOIP" },
265 { 0x01dd, "MSR_LASTINTFROMIP" },
266 { 0x01de, "MSR_LASTINTTOIP" },
267 { 0x01e0, "MSR_ROB_CR_BKUPTMPDR6" },
268 { 0x0200, "IA32_MTRR_PHYSBASE0" },
269 { 0x0201, "IA32_MTRR_PHYSMASK0" },
270 { 0x0202, "IA32_MTRR_PHYSBASE1" },
271 { 0x0203, "IA32_MTRR_PHYSMASK1" },
272 { 0x0204, "IA32_MTRR_PHYSBASE2" },
273 { 0x0205, "IA32_MTRR_PHYSMASK2" },
274 { 0x0206, "IA32_MTRR_PHYSBASE3" },
275 { 0x0207, "IA32_MTRR_PHYSMASK3" },
276 { 0x0208, "IA32_MTRR_PHYSBASE4" },
277 { 0x0209, "IA32_MTRR_PHYSMASK4" },
278 { 0x020a, "IA32_MTRR_PHYSBASE5" },
279 { 0x020b, "IA32_MTRR_PHYSMASK5" },
280 { 0x020c, "IA32_MTRR_PHYSBASE6" },
281 { 0x020d, "IA32_MTRR_PHYSMASK6" },
282 { 0x020e, "IA32_MTRR_PHYSBASE7" },
283 { 0x020f, "IA32_MTRR_PHYSMASK7" },
284 { 0x0250, "IA32_MTRR_FIX64K_00000" },
285 { 0x0258, "IA32_MTRR_FIX16K_80000" },
286 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
287 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
288 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
289 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
290 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
291 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
292 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
293 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
294 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
295 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
296 { 0x0400, "IA32_MC0_CTL" },
297 { 0x0401, "IA32_MC0_STATUS" },
298 { 0x0402, "IA32_MC0_ADDR" },
299 //{ 0x0403, "IA32_MC0_MISC" }, // Seems to be RO
300 { 0x0404, "IA32_MC1_CTL" },
301 { 0x0405, "IA32_MC1_STATUS" },
302 { 0x0406, "IA32_MC1_ADDR" },
303 //{ 0x0407, "IA32_MC1_MISC" }, // Seems to be RO
304 { 0x0408, "IA32_MC2_CTL" },
305 { 0x0409, "IA32_MC2_STATUS" },
306 { 0x040a, "IA32_MC2_ADDR" },
307 //{ 0x040b, "IA32_MC2_MISC" }, // Seems to be RO
308 { 0x040c, "IA32_MC4_CTL" },
309 { 0x040d, "IA32_MC4_STATUS" },
310 { 0x040e, "IA32_MC4_ADDR" },
311 //{ 0x040f, "IA32_MC4_MISC" } // Seems to be RO
312 { 0x0410, "IA32_MC3_CTL" },
313 { 0x0411, "IA32_MC3_STATUS" },
314 { 0x0412, "IA32_MC3_ADDR" },
315 //{ 0x0413, "IA32_MC3_MISC" }, // Seems to be RO
318 static const msr_entry_t model6bx_global_msrs[] = {
319 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
320 { 0x0017, "IA32_PLATFORM_ID" },
321 { 0x001b, "IA32_APIC_BASE" },
322 { 0x002a, "EBL_CR_POWERON" },
323 { 0x0033, "TEST_CTL" },
324 { 0x003f, "THERM_DIODE_OFFSET" },
325 //{ 0x0079, "IA32_BIOS_UPDT_TRIG" }, // Seems to be RO
326 { 0x008b, "IA32_BIOS_SIGN_ID" },
327 { 0x00c1, "PERFCTR0" },
328 { 0x00c2, "PERFCTR1" },
329 { 0x011e, "BBL_CR_CTL3" },
330 { 0x0179, "IA32_MCG_CAP" },
331 { 0x017a, "IA32_MCG_STATUS" },
332 { 0x0198, "IA32_PERF_STATUS" },
333 { 0x0199, "IA32_PERF_CONTROL" },
334 { 0x019a, "IA32_CLOCK_MODULATION" },
335 { 0x01a0, "IA32_MISC_ENABLES" },
336 { 0x01d9, "IA32_DEBUGCTL" },
337 { 0x0200, "IA32_MTRR_PHYSBASE0" },
338 { 0x0201, "IA32_MTRR_PHYSMASK0" },
339 { 0x0202, "IA32_MTRR_PHYSBASE1" },
340 { 0x0203, "IA32_MTRR_PHYSMASK1" },
341 { 0x0204, "IA32_MTRR_PHYSBASE2" },
342 { 0x0205, "IA32_MTRR_PHYSMASK2" },
343 { 0x0206, "IA32_MTRR_PHYSBASE3" },
344 { 0x0207, "IA32_MTRR_PHYSMASK3" },
345 { 0x0208, "IA32_MTRR_PHYSBASE4" },
346 { 0x0209, "IA32_MTRR_PHYSMASK4" },
347 { 0x020a, "IA32_MTRR_PHYSBASE5" },
348 { 0x020b, "IA32_MTRR_PHYSMASK5" },
349 { 0x020c, "IA32_MTRR_PHYSBASE6" },
350 { 0x020d, "IA32_MTRR_PHYSMASK6" },
351 { 0x020e, "IA32_MTRR_PHYSBASE7" },
352 { 0x020f, "IA32_MTRR_PHYSMASK7" },
353 { 0x0250, "IA32_MTRR_FIX64K_00000" },
354 { 0x0258, "IA32_MTRR_FIX16K_80000" },
355 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
356 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
357 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
358 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
359 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
360 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
361 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
362 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
363 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
364 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
365 { 0x0400, "IA32_MC0_CTL" },
366 { 0x0401, "IA32_MC0_STATUS" },
367 { 0x0402, "IA32_MC0_ADDR" },
368 //{ 0x0403, "IA32_MC0_MISC" }, // Seems to be RO
369 { 0x040c, "IA32_MC4_CTL" },
370 { 0x040d, "IA32_MC4_STATUS" },
371 { 0x040e, "IA32_MC4_ADDR" },
372 //{ 0x040f, "IA32_MC4_MISC" } // Seems to be RO
375 static const msr_entry_t model6ex_global_msrs[] = {
376 { 0x0017, "IA32_PLATFORM_ID" },
377 { 0x002a, "EBL_CR_POWERON" },
378 { 0x00cd, "FSB_CLOCK_STS" },
379 { 0x00ce, "FSB_CLOCK_VCC" },
380 { 0x00e2, "CLOCK_CST_CONFIG_CONTROL" },
381 { 0x00e3, "PMG_IO_BASE_ADDR" },
382 { 0x00e4, "PMG_IO_CAPTURE_ADDR" },
383 { 0x00ee, "EXT_CONFIG" },
384 { 0x011e, "BBL_CR_CTL3" },
385 { 0x0194, "CLOCK_FLEX_MAX" },
386 { 0x0198, "IA32_PERF_STATUS" },
387 { 0x01a0, "IA32_MISC_ENABLES" },
388 { 0x01aa, "PIC_SENS_CFG" },
389 { 0x0400, "IA32_MC0_CTL" },
390 { 0x0401, "IA32_MC0_STATUS" },
391 { 0x0402, "IA32_MC0_ADDR" },
392 //{ 0x0403, "IA32_MC0_MISC" }, // Seems to be RO
393 { 0x040c, "IA32_MC4_CTL" },
394 { 0x040d, "IA32_MC4_STATUS" },
395 { 0x040e, "IA32_MC4_ADDR" },
396 //{ 0x040f, "IA32_MC4_MISC" } // Seems to be RO
399 static const msr_entry_t model6ex_per_core_msrs[] = {
400 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
401 { 0x001b, "IA32_APIC_BASE" },
402 { 0x003a, "IA32_FEATURE_CONTROL" },
403 { 0x003f, "IA32_TEMPERATURE_OFFSET" },
404 //{ 0x0079, "IA32_BIOS_UPDT_TRIG" }, // Seems to be RO
405 { 0x008b, "IA32_BIOS_SIGN_ID" },
406 { 0x00e7, "IA32_MPERF" },
407 { 0x00e8, "IA32_APERF" },
408 { 0x00fe, "IA32_MTRRCAP" },
409 { 0x015f, "DTS_CAL_CTRL" },
410 { 0x0179, "IA32_MCG_CAP" },
411 { 0x017a, "IA32_MCG_STATUS" },
412 { 0x0199, "IA32_PERF_CONTROL" },
413 { 0x019a, "IA32_CLOCK_MODULATION" },
414 { 0x019b, "IA32_THERM_INTERRUPT" },
415 { 0x019c, "IA32_THERM_STATUS" },
416 { 0x019d, "GV_THERM" },
417 { 0x01d9, "IA32_DEBUGCTL" },
418 { 0x0200, "IA32_MTRR_PHYSBASE0" },
419 { 0x0201, "IA32_MTRR_PHYSMASK0" },
420 { 0x0202, "IA32_MTRR_PHYSBASE1" },
421 { 0x0203, "IA32_MTRR_PHYSMASK1" },
422 { 0x0204, "IA32_MTRR_PHYSBASE2" },
423 { 0x0205, "IA32_MTRR_PHYSMASK2" },
424 { 0x0206, "IA32_MTRR_PHYSBASE3" },
425 { 0x0207, "IA32_MTRR_PHYSMASK3" },
426 { 0x0208, "IA32_MTRR_PHYSBASE4" },
427 { 0x0209, "IA32_MTRR_PHYSMASK4" },
428 { 0x020a, "IA32_MTRR_PHYSBASE5" },
429 { 0x020b, "IA32_MTRR_PHYSMASK5" },
430 { 0x020c, "IA32_MTRR_PHYSBASE6" },
431 { 0x020d, "IA32_MTRR_PHYSMASK6" },
432 { 0x020e, "IA32_MTRR_PHYSBASE7" },
433 { 0x020f, "IA32_MTRR_PHYSMASK7" },
434 { 0x0250, "IA32_MTRR_FIX64K_00000" },
435 { 0x0258, "IA32_MTRR_FIX16K_80000" },
436 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
437 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
438 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
439 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
440 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
441 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
442 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
443 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
444 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
445 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
446 //{ 0x00c000080, "IA32_CR_EFER" }, // Seems to be RO
449 static const msr_entry_t model6fx_global_msrs[] = {
450 { 0x0017, "IA32_PLATFORM_ID" },
451 { 0x002a, "EBL_CR_POWERON" },
452 { 0x003f, "IA32_TEMPERATURE_OFFSET" },
453 { 0x00a8, "EMTTM_CR_TABLE0" },
454 { 0x00a9, "EMTTM_CR_TABLE1" },
455 { 0x00aa, "EMTTM_CR_TABLE2" },
456 { 0x00ab, "EMTTM_CR_TABLE3" },
457 { 0x00ac, "EMTTM_CR_TABLE4" },
458 { 0x00ad, "EMTTM_CR_TABLE5" },
459 { 0x00cd, "FSB_CLOCK_STS" },
460 { 0x00e2, "PMG_CST_CONFIG_CONTROL" },
461 { 0x00e3, "PMG_IO_BASE_ADDR" },
462 { 0x00e4, "PMG_IO_CAPTURE_ADDR" },
463 { 0x00ee, "EXT_CONFIG" },
464 { 0x011e, "BBL_CR_CTL3" },
465 { 0x0194, "CLOCK_FLEX_MAX" },
466 { 0x0198, "IA32_PERF_STATUS" },
467 { 0x01a0, "IA32_MISC_ENABLES" },
468 { 0x01aa, "PIC_SENS_CFG" },
469 { 0x0400, "IA32_MC0_CTL" },
470 { 0x0401, "IA32_MC0_STATUS" },
471 { 0x0402, "IA32_MC0_ADDR" },
472 //{ 0x0403, "IA32_MC0_MISC" }, // Seems to be RO
473 { 0x040c, "IA32_MC4_CTL" },
474 { 0x040d, "IA32_MC4_STATUS" },
475 { 0x040e, "IA32_MC4_ADDR" },
476 //{ 0x040f, "IA32_MC4_MISC" } // Seems to be RO
479 static const msr_entry_t model6fx_per_core_msrs[] = {
480 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
481 { 0x001b, "IA32_APIC_BASE" },
482 { 0x003a, "IA32_FEATURE_CONTROL" },
483 //{ 0x0079, "IA32_BIOS_UPDT_TRIG" }, // Seems to be RO
484 { 0x008b, "IA32_BIOS_SIGN_ID" },
485 { 0x00e1, "SMM_CST_MISC_INFO" },
486 { 0x00e7, "IA32_MPERF" },
487 { 0x00e8, "IA32_APERF" },
488 { 0x00fe, "IA32_MTRRCAP" },
489 { 0x0179, "IA32_MCG_CAP" },
490 { 0x017a, "IA32_MCG_STATUS" },
491 { 0x0199, "IA32_PERF_CONTROL" },
492 { 0x019a, "IA32_THERM_CTL" },
493 { 0x019b, "IA32_THERM_INTERRUPT" },
494 { 0x019c, "IA32_THERM_STATUS" },
495 { 0x019d, "MSR_THERM2_CTL" },
496 { 0x01d9, "IA32_DEBUGCTL" },
497 { 0x0200, "IA32_MTRR_PHYSBASE0" },
498 { 0x0201, "IA32_MTRR_PHYSMASK0" },
499 { 0x0202, "IA32_MTRR_PHYSBASE1" },
500 { 0x0203, "IA32_MTRR_PHYSMASK1" },
501 { 0x0204, "IA32_MTRR_PHYSBASE2" },
502 { 0x0205, "IA32_MTRR_PHYSMASK2" },
503 { 0x0206, "IA32_MTRR_PHYSBASE3" },
504 { 0x0207, "IA32_MTRR_PHYSMASK3" },
505 { 0x0208, "IA32_MTRR_PHYSBASE4" },
506 { 0x0209, "IA32_MTRR_PHYSMASK4" },
507 { 0x020a, "IA32_MTRR_PHYSBASE5" },
508 { 0x020b, "IA32_MTRR_PHYSMASK5" },
509 { 0x020c, "IA32_MTRR_PHYSBASE6" },
510 { 0x020d, "IA32_MTRR_PHYSMASK6" },
511 { 0x020e, "IA32_MTRR_PHYSBASE7" },
512 { 0x020f, "IA32_MTRR_PHYSMASK7" },
513 { 0x0250, "IA32_MTRR_FIX64K_00000" },
514 { 0x0258, "IA32_MTRR_FIX16K_80000" },
515 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
516 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
517 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
518 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
519 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
520 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
521 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
522 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
523 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
524 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
525 //{ 0x00c000080, "IA32_CR_EFER" }, // Seems to be RO
528 /* Pentium 4 and XEON */
530 * All MSRs per
532 * Intel 64 and IA-32 Architectures Software Developer's Manual
533 * Volume 3B: System Programming Guide, Part 2
535 * Table B-5, B-7
537 static const msr_entry_t modelf2x_global_msrs[] = {
538 { 0x0000, "IA32_P5_MC_ADDR" },
539 { 0x0001, "IA32_P5_MC_TYPE" },
540 /* 0x6: Not available in model 2. */
541 { 0x0017, "IA32_PLATFORM_ID" },
542 { 0x002a, "MSR_EBC_HARD_POWERON" },
543 { 0x002b, "MSR_EBC_SOFT_POWERON" },
544 /* 0x2c: Not available in model 2. */
545 // WRITE ONLY { 0x0079, "IA32_BIOS_UPDT_TRIG" },
546 { 0x019c, "IA32_THERM_STATUS" },
547 /* 0x19d: Not available in model 2. */
548 { 0x01a0, "IA32_MISC_ENABLE" },
549 /* 0x1a1: Not available in model 2. */
550 { 0x0200, "IA32_MTRR_PHYSBASE0" },
551 { 0x0201, "IA32_MTRR_PHYSMASK0" },
552 { 0x0202, "IA32_MTRR_PHYSBASE1" },
553 { 0x0203, "IA32_MTRR_PHYSMASK1" },
554 { 0x0204, "IA32_MTRR_PHYSBASE2" },
555 { 0x0205, "IA32_MTRR_PHYSMASK2" },
556 { 0x0206, "IA32_MTRR_PHYSBASE3" },
557 { 0x0207, "IA32_MTRR_PHYSMASK3" },
558 { 0x0208, "IA32_MTRR_PHYSBASE4" },
559 { 0x0209, "IA32_MTRR_PHYSMASK4" },
560 { 0x020a, "IA32_MTRR_PHYSBASE5" },
561 { 0x020b, "IA32_MTRR_PHYSMASK5" },
562 { 0x020c, "IA32_MTRR_PHYSBASE6" },
563 { 0x020d, "IA32_MTRR_PHYSMASK6" },
564 { 0x020e, "IA32_MTRR_PHYSBASE7" },
565 { 0x020f, "IA32_MTRR_PHYSMASK7" },
566 { 0x0250, "IA32_MTRR_FIX64K_00000" },
567 { 0x0258, "IA32_MTRR_FIX16K_80000" },
568 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
569 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
570 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
571 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
572 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
573 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
574 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
575 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
576 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
577 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
578 { 0x0300, "MSR_BPU_COUNTER0" },
579 { 0x0301, "MSR_BPU_COUNTER1" },
580 { 0x0302, "MSR_BPU_COUNTER2" },
581 { 0x0303, "MSR_BPU_COUNTER3" },
582 { 0x0304, "MSR_MS_COUNTER0" },
583 { 0x0305, "MSR_MS_COUNTER1" },
584 { 0x0306, "MSR_MS_COUNTER2" },
585 { 0x0307, "MSR_MS_COUNTER3" },
586 { 0x0308, "MSR_FLAME_COUNTER0" },
587 { 0x0309, "MSR_FLAME_COUNTER1" },
588 { 0x030a, "MSR_FLAME_COUNTER2" },
589 { 0x030b, "MSR_FLAME_COUNTER3" },
590 { 0x030c, "MSR_IQ_COUNTER0" },
591 { 0x030d, "MSR_IQ_COUNTER1" },
592 { 0x030e, "MSR_IQ_COUNTER2" },
593 { 0x030f, "MSR_IQ_COUNTER3" },
594 { 0x0310, "MSR_IQ_COUNTER4" },
595 { 0x0311, "MSR_IQ_COUNTER5" },
596 { 0x0360, "MSR_BPU_CCCR0" },
597 { 0x0361, "MSR_BPU_CCCR1" },
598 { 0x0362, "MSR_BPU_CCCR2" },
599 { 0x0363, "MSR_BPU_CCCR3" },
600 { 0x0364, "MSR_MS_CCCR0" },
601 { 0x0365, "MSR_MS_CCCR1" },
602 { 0x0366, "MSR_MS_CCCR2" },
603 { 0x0367, "MSR_MS_CCCR3" },
604 { 0x0368, "MSR_FLAME_CCCR0" },
605 { 0x0369, "MSR_FLAME_CCCR1" },
606 { 0x036a, "MSR_FLAME_CCCR2" },
607 { 0x036b, "MSR_FLAME_CCCR3" },
608 { 0x036c, "MSR_IQ_CCCR0" },
609 { 0x036d, "MSR_IQ_CCCR1" },
610 { 0x036e, "MSR_IQ_CCCR2" },
611 { 0x036f, "MSR_IQ_CCCR3" },
612 { 0x0370, "MSR_IQ_CCCR4" },
613 { 0x0371, "MSR_IQ_CCCR5" },
614 { 0x03a0, "MSR_BSU_ESCR0" },
615 { 0x03a1, "MSR_BSU_ESCR1" },
616 { 0x03a2, "MSR_FSB_ESCR0" },
617 { 0x03a3, "MSR_FSB_ESCR1" },
618 { 0x03a4, "MSR_FIRM_ESCR0" },
619 { 0x03a5, "MSR_FIRM_ESCR1" },
620 { 0x03a6, "MSR_FLAME_ESCR0" },
621 { 0x03a7, "MSR_FLAME_ESCR1" },
622 { 0x03a8, "MSR_DAC_ESCR0" },
623 { 0x03a9, "MSR_DAC_ESCR1" },
624 { 0x03aa, "MSR_MOB_ESCR0" },
625 { 0x03ab, "MSR_MOB_ESCR1" },
626 { 0x03ac, "MSR_PMH_ESCR0" },
627 { 0x03ad, "MSR_PMH_ESCR1" },
628 { 0x03ae, "MSR_SAAT_ESCR0" },
629 { 0x03af, "MSR_SAAT_ESCR1" },
630 { 0x03b0, "MSR_U2L_ESCR0" },
631 { 0x03b1, "MSR_U2L_ESCR1" },
632 { 0x03b2, "MSR_BPU_ESCR0" },
633 { 0x03b3, "MSR_BPU_ESCR1" },
634 { 0x03b4, "MSR_IS_ESCR0" },
635 { 0x03b5, "MSR_BPU_ESCR1" },
636 { 0x03b6, "MSR_ITLB_ESCR0" },
637 { 0x03b7, "MSR_ITLB_ESCR1" },
638 { 0x03b8, "MSR_CRU_ESCR0" },
639 { 0x03b9, "MSR_CRU_ESCR1" },
640 { 0x03ba, "MSR_IQ_ESCR0" },
641 { 0x03bb, "MSR_IQ_ESCR1" },
642 { 0x03bc, "MSR_RAT_ESCR0" },
643 { 0x03bd, "MSR_RAT_ESCR1" },
644 { 0x03be, "MSR_SSU_ESCR0" },
645 { 0x03c0, "MSR_MS_ESCR0" },
646 { 0x03c1, "MSR_MS_ESCR1" },
647 { 0x03c2, "MSR_TBPU_ESCR0" },
648 { 0x03c3, "MSR_TBPU_ESCR1" },
649 { 0x03c4, "MSR_TC_ESCR0" },
650 { 0x03c5, "MSR_TC_ESCR1" },
651 { 0x03c8, "MSR_IX_ESCR0" },
652 { 0x03c9, "MSR_IX_ESCR1" },
653 { 0x03ca, "MSR_ALF_ESCR0" },
654 { 0x03cb, "MSR_ALF_ESCR1" },
655 { 0x03cc, "MSR_CRU_ESCR2" },
656 { 0x03cd, "MSR_CRU_ESCR3" },
657 { 0x03e0, "MSR_CRU_ESCR4" },
658 { 0x03e1, "MSR_CRU_ESCR5" },
659 { 0x03f0, "MSR_TC_PRECISE_EVENT" },
660 { 0x03f1, "MSR_PEBS_ENABLE" },
661 { 0x03f2, "MSR_PEBS_MATRIX_VERT" },
664 * All MCX_ADDR and MCX_MISC MSRs depend on a bit being
665 * set in MCX_STATUS.
667 { 0x400, "IA32_MC0_CTL" },
668 { 0x401, "IA32_MC0_STATUS" },
669 { 0x402, "IA32_MC0_ADDR" },
670 { 0x403, "IA32_MC0_MISC" },
671 { 0x404, "IA32_MC1_CTL" },
672 { 0x405, "IA32_MC1_STATUS" },
673 { 0x406, "IA32_MC1_ADDR" },
674 { 0x407, "IA32_MC1_MISC" },
675 { 0x408, "IA32_MC2_CTL" },
676 { 0x409, "IA32_MC2_STATUS" },
677 { 0x40a, "IA32_MC2_ADDR" },
678 { 0x40b, "IA32_MC2_MISC" },
679 { 0x40c, "IA32_MC3_CTL" },
680 { 0x40d, "IA32_MC3_STATUS" },
681 { 0x40e, "IA32_MC3_ADDR" },
682 { 0x40f, "IA32_MC3_MISC" },
683 { 0x410, "IA32_MC4_CTL" },
684 { 0x411, "IA32_MC4_STATUS" },
685 { 0x412, "IA32_MC4_ADDR" },
686 { 0x413, "IA32_MC4_MISC" },
689 static const msr_entry_t modelf2x_per_core_msrs[] = {
690 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
691 { 0x001b, "IA32_APIC_BASE" },
692 /* 0x3a: Not available in model 2. */
693 { 0x008b, "IA32_BIOS_SIGN_ID" },
694 /* 0x9b: Not available in model 2. */
695 { 0x00fe, "IA32_MTRRCAP" },
696 { 0x0174, "IA32_SYSENTER_CS" },
697 { 0x0175, "IA32_SYSENTER_ESP" },
698 { 0x0176, "IA32_SYSENTER_EIP" },
699 { 0x0179, "IA32_MCG_CAP" },
700 { 0x017a, "IA32_MCG_STATUS" },
701 { 0x017b, "IA32_MCG_CTL" },
702 { 0x0180, "MSR_MCG_RAX" },
703 { 0x0181, "MSR_MCG_RBX" },
704 { 0x0182, "MSR_MCG_RCX" },
705 { 0x0183, "MSR_MCG_RDX" },
706 { 0x0184, "MSR_MCG_RSI" },
707 { 0x0185, "MSR_MCG_RDI" },
708 { 0x0186, "MSR_MCG_RBP" },
709 { 0x0187, "MSR_MCG_RSP" },
710 { 0x0188, "MSR_MCG_RFLAGS" },
711 { 0x0189, "MSR_MCG_RIP" },
712 { 0x018a, "MSR_MCG_MISC" },
713 /* 0x18b-0x18f: Reserved */
714 { 0x0190, "MSR_MCG_R8" },
715 { 0x0191, "MSR_MCG_R9" },
716 { 0x0192, "MSR_MCG_R10" },
717 { 0x0193, "MSR_MCG_R11" },
718 { 0x0194, "MSR_MCG_R12" },
719 { 0x0195, "MSR_MCG_R13" },
720 { 0x0196, "MSR_MCG_R14" },
721 { 0x0197, "MSR_MCG_R15" },
722 /* 0x198: Not available in model 2. */
723 /* 0x199: Not available in model 2. */
724 { 0x019a, "IA32_CLOCK_MODULATION" },
725 { 0x019b, "IA32_THERM_INTERRUPT" },
726 { 0x01a0, "IA32_MISC_ENABLE" },
727 { 0x01d7, "MSR_LER_FROM_LIP" },
728 { 0x01d8, "MSR_LER_TO_LIP" },
729 { 0x01d9, "MSR_DEBUGCTLA" },
730 { 0x01da, "MSR_LASTBRANCH_TOS" },
731 { 0x01db, "MSR_LASTBRANCH_0" },
732 { 0x01dd, "MSR_LASTBRANCH_2" },
733 { 0x01de, "MSR_LASTBRANCH_3" },
734 { 0x0277, "IA32_PAT" },
735 /* 0x480-0x48b : Not available in model 2. */
736 { 0x0600, "IA32_DS_AREA" },
737 /* 0x0680 - 0x06cf Branch Records Skipped */
740 static const msr_entry_t modelf4x_global_msrs[] = {
741 { 0x0000, "IA32_P5_MC_ADDR" },
742 { 0x0001, "IA32_P5_MC_TYPE" },
743 { 0x0006, "IA32_MONITOR_FILTER_LINE_SIZE" },
744 { 0x0017, "IA32_PLATFORM_ID" },
745 { 0x002a, "MSR_EBC_HARD_POWERON" },
746 { 0x002b, "MSR_EBC_SOFT_POWERON" },
747 { 0x002c, "MSR_EBC_FREQUENCY_ID" },
748 // WRITE ONLY { 0x0079, "IA32_BIOS_UPDT_TRIG" },
749 { 0x019c, "IA32_THERM_STATUS" },
750 { 0x019d, "MSR_THERM2_CTL" },
751 { 0x01a0, "IA32_MISC_ENABLE" },
752 { 0x01a1, "MSR_PLATFORM_BRV" },
753 { 0x0200, "IA32_MTRR_PHYSBASE0" },
754 { 0x0201, "IA32_MTRR_PHYSMASK0" },
755 { 0x0202, "IA32_MTRR_PHYSBASE1" },
756 { 0x0203, "IA32_MTRR_PHYSMASK1" },
757 { 0x0204, "IA32_MTRR_PHYSBASE2" },
758 { 0x0205, "IA32_MTRR_PHYSMASK2" },
759 { 0x0206, "IA32_MTRR_PHYSBASE3" },
760 { 0x0207, "IA32_MTRR_PHYSMASK3" },
761 { 0x0208, "IA32_MTRR_PHYSBASE4" },
762 { 0x0209, "IA32_MTRR_PHYSMASK4" },
763 { 0x020a, "IA32_MTRR_PHYSBASE5" },
764 { 0x020b, "IA32_MTRR_PHYSMASK5" },
765 { 0x020c, "IA32_MTRR_PHYSBASE6" },
766 { 0x020d, "IA32_MTRR_PHYSMASK6" },
767 { 0x020e, "IA32_MTRR_PHYSBASE7" },
768 { 0x020f, "IA32_MTRR_PHYSMASK7" },
769 { 0x0250, "IA32_MTRR_FIX64K_00000" },
770 { 0x0258, "IA32_MTRR_FIX16K_80000" },
771 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
772 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
773 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
774 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
775 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
776 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
777 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
778 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
779 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
780 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
781 { 0x0300, "MSR_BPU_COUNTER0" },
782 { 0x0301, "MSR_BPU_COUNTER1" },
783 { 0x0302, "MSR_BPU_COUNTER2" },
784 { 0x0303, "MSR_BPU_COUNTER3" },
785 /* Skipped through 0x3ff for now*/
787 /* All MCX_ADDR AND MCX_MISC MSRs depend on a bit being
788 * set in MCX_STATUS */
789 { 0x400, "IA32_MC0_CTL" },
790 { 0x401, "IA32_MC0_STATUS" },
791 { 0x402, "IA32_MC0_ADDR" },
792 { 0x403, "IA32_MC0_MISC" },
793 { 0x404, "IA32_MC1_CTL" },
794 { 0x405, "IA32_MC1_STATUS" },
795 { 0x406, "IA32_MC1_ADDR" },
796 { 0x407, "IA32_MC1_MISC" },
797 { 0x408, "IA32_MC2_CTL" },
798 { 0x409, "IA32_MC2_STATUS" },
799 { 0x40a, "IA32_MC2_ADDR" },
800 { 0x40b, "IA32_MC2_MISC" },
801 { 0x40c, "IA32_MC3_CTL" },
802 { 0x40d, "IA32_MC3_STATUS" },
803 { 0x40e, "IA32_MC3_ADDR" },
804 { 0x40f, "IA32_MC3_MISC" },
805 { 0x410, "IA32_MC4_CTL" },
806 { 0x411, "IA32_MC4_STATUS" },
807 { 0x412, "IA32_MC4_ADDR" },
808 { 0x413, "IA32_MC4_MISC" },
811 static const msr_entry_t modelf4x_per_core_msrs[] = {
812 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
813 { 0x001b, "IA32_APIC_BASE" },
814 { 0x003a, "IA32_FEATURE_CONTROL" },
815 { 0x008b, "IA32_BIOS_SIGN_ID" },
816 { 0x009b, "IA32_SMM_MONITOR_CTL" },
817 { 0x00fe, "IA32_MTRRCAP" },
818 { 0x0174, "IA32_SYSENTER_CS" },
819 { 0x0175, "IA32_SYSENTER_ESP" },
820 { 0x0176, "IA32_SYSENTER_EIP" },
821 { 0x0179, "IA32_MCG_CAP" },
822 { 0x017a, "IA32_MCG_STATUS" },
823 { 0x0180, "MSR_MCG_RAX" },
824 { 0x0181, "MSR_MCG_RBX" },
825 { 0x0182, "MSR_MCG_RCX" },
826 { 0x0183, "MSR_MCG_RDX" },
827 { 0x0184, "MSR_MCG_RSI" },
828 { 0x0185, "MSR_MCG_RDI" },
829 { 0x0186, "MSR_MCG_RBP" },
830 { 0x0187, "MSR_MCG_RSP" },
831 { 0x0188, "MSR_MCG_RFLAGS" },
832 { 0x0189, "MSR_MCG_RIP" },
833 { 0x018a, "MSR_MCG_MISC" },
834 // 0x18b-f Reserved
835 { 0x0190, "MSR_MCG_R8" },
836 { 0x0191, "MSR_MCG_R9" },
837 { 0x0192, "MSR_MCG_R10" },
838 { 0x0193, "MSR_MCG_R11" },
839 { 0x0194, "MSR_MCG_R12" },
840 { 0x0195, "MSR_MCG_R13" },
841 { 0x0196, "MSR_MCG_R14" },
842 { 0x0197, "MSR_MCG_R15" },
843 { 0x0198, "IA32_PERF_STATUS" },
844 { 0x0199, "IA32_PERF_CTL" },
845 { 0x019a, "IA32_CLOCK_MODULATION" },
846 { 0x019b, "IA32_THERM_INTERRUPT" },
847 { 0x01a0, "IA32_MISC_ENABLE" }, // Bit 34 is Core Specific
848 { 0x01d7, "MSR_LER_FROM_LIP" },
849 { 0x01d8, "MSR_LER_TO_LIP" },
850 { 0x01d9, "MSR_DEBUGCTLA" },
851 { 0x01da, "MSR_LASTBRANCH_TOS" },
852 { 0x0277, "IA32_PAT" },
853 /** Virtualization
854 { 0x480, "IA32_VMX_BASIC" },
855 through
856 { 0x48b, "IA32_VMX_PROCBASED_CTLS2" },
857 Not implemented in my CPU
859 { 0x0600, "IA32_DS_AREA" },
860 /* 0x0680 - 0x06cf Branch Records Skipped */
865 * 64-ia-32-architectures-software-developer-vol-3c-part-3-manual
866 * September 2016
868 static const msr_entry_t modelf6x_global_msrs[] = {
869 { 0x0000, "IA32_P5_MC_ADDR" },
870 { 0x0001, "IA32_P5_MC_TYPE" },
871 { 0x0006, "IA32_MONITOR_FILTER_LINE_SIZE" },
872 { 0x0017, "IA32_PLATFORM_ID" },
873 { 0x002a, "MSR_EBC_HARD_POWERON" },
874 { 0x002b, "MSR_EBC_SOFT_POWERON" },
875 { 0x002c, "MSR_EBC_FREQUENCY_ID" },
876 // WRITE ONLY { 0x0079, "IA32_BIOS_UPDT_TRIG" },
877 { 0x019c, "IA32_THERM_STATUS" },
878 { 0x019d, "MSR_THERM2_CTL" },
879 { 0x01a0, "IA32_MISC_ENABLE" },
880 { 0x01a1, "MSR_PLATFORM_BRV" },
881 { 0x0200, "IA32_MTRR_PHYSBASE0" },
882 { 0x0201, "IA32_MTRR_PHYSMASK0" },
883 { 0x0202, "IA32_MTRR_PHYSBASE1" },
884 { 0x0203, "IA32_MTRR_PHYSMASK1" },
885 { 0x0204, "IA32_MTRR_PHYSBASE2" },
886 { 0x0205, "IA32_MTRR_PHYSMASK2" },
887 { 0x0206, "IA32_MTRR_PHYSBASE3" },
888 { 0x0207, "IA32_MTRR_PHYSMASK3" },
889 { 0x0208, "IA32_MTRR_PHYSBASE4" },
890 { 0x0209, "IA32_MTRR_PHYSMASK4" },
891 { 0x020a, "IA32_MTRR_PHYSBASE5" },
892 { 0x020b, "IA32_MTRR_PHYSMASK5" },
893 { 0x020c, "IA32_MTRR_PHYSBASE6" },
894 { 0x020d, "IA32_MTRR_PHYSMASK6" },
895 { 0x020e, "IA32_MTRR_PHYSBASE7" },
896 { 0x020f, "IA32_MTRR_PHYSMASK7" },
897 { 0x0250, "IA32_MTRR_FIX64K_00000" },
898 { 0x0258, "IA32_MTRR_FIX16K_80000" },
899 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
900 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
901 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
902 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
903 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
904 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
905 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
906 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
907 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
908 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
909 { 0x0300, "MSR_BPU_COUNTER0" },
910 { 0x0301, "MSR_BPU_COUNTER1" },
911 { 0x0302, "MSR_BPU_COUNTER2" },
912 { 0x0303, "MSR_BPU_COUNTER3" },
913 { 0x0304, "MSR_MS_COUNTER0" },
914 { 0x0305, "MSR_MS_COUNTER1" },
915 { 0x0306, "MSR_MS_COUNTER2" },
916 { 0x0307, "MSR_MS_COUNTER3" },
917 { 0x0308, "MSR_FLAME_COUNTER0" },
918 { 0x0309, "MSR_FLAME_COUNTER1" },
919 { 0x030a, "MSR_FLAME_COUNTER2" },
920 { 0x030b, "MSR_FLAME_COUNTER3" },
921 { 0x030c, "MSR_IQ_COUNTER0" },
922 { 0x030d, "MSR_IQ_COUNTER1" },
923 { 0x030e, "MSR_IQ_COUNTER2" },
924 { 0x030f, "MSR_IQ_COUNTER3" },
925 { 0x0310, "MSR_IQ_COUNTER4" },
926 { 0x0311, "MSR_IQ_COUNTER5" },
927 { 0x0360, "MSR_BPU_CCCR0" },
928 { 0x0361, "MSR_BPU_CCCR1" },
929 { 0x0362, "MSR_BPU_CCCR2" },
930 { 0x0363, "MSR_BPU_CCCR3" },
931 { 0x0364, "MSR_MS_CCCR0" },
932 { 0x0365, "MSR_MS_CCCR1" },
933 { 0x0366, "MSR_MS_CCCR2" },
934 { 0x0367, "MSR_MS_CCCR3" },
935 { 0x0368, "MSR_FLAME_CCCR0" },
936 { 0x0369, "MSR_FLAME_CCCR1" },
937 { 0x036A, "MSR_FLAME_CCCR2" },
938 { 0x036B, "MSR_FLAME_CCCR3" },
939 { 0x036C, "MSR_IQ_CCCR0" },
940 { 0x036D, "MSR_IQ_CCCR1" },
941 { 0x036E, "MSR_IQ_CCCR2" },
942 { 0x036F, "MSR_IQ_CCCR3" },
943 { 0x0370, "MSR_IQ_CCCR4" },
944 { 0x0371, "MSR_IQ_CCCR5" },
945 { 0x03A0, "MSR_BSU_ESCR0" },
946 { 0x03A1, "MSR_BSU_ESCR1" },
947 { 0x03A2, "MSR_FSB_ESCR0" },
948 { 0x03A3, "MSR_FSB_ESCR1" },
949 { 0x03A4, "MSR_FIRM_ESCR0" },
950 { 0x03A5, "MSR_FIRM_ESCR1" },
951 { 0x03A6, "MSR_FLAME_ESCR0" },
952 { 0x03A7, "MSR_FLAME_ESCR1" },
953 { 0x03A8, "MSR_DAC_ESCR0" },
954 { 0x03A9, "MSR_DAC_ESCR1" },
955 { 0x03AA, "MSR_MOB_ESCR0" },
956 { 0x03AB, "MSR_MOB_ESCR1" },
957 { 0x03AC, "MSR_PMH_ESCR0" },
958 { 0x03AD, "MSR_PMH_ESCR1" },
959 { 0x03AE, "MSR_SAAT_ESCR0" },
960 { 0x03AF, "MSR_SAAT_ESCR1" },
961 { 0x03B0, "MSR_U2L_ESCR0" },
962 { 0x03B1, "MSR_U2L_ESCR1" },
963 { 0x03B2, "MSR_BPU_ESCR0" },
964 { 0x03B3, "MSR_BPU_ESCR1" },
965 { 0x03B4, "MSR_IS_ESCR0" },
966 { 0x03B5, "MSR_IS_ESCR1" },
967 { 0x03B6, "MSR_ITLB_ESCR0" },
968 { 0x03B7, "MSR_ITLB_ESCR1" },
969 { 0x03B8, "MSR_CRU_ESCR0" },
970 { 0x03B9, "MSR_CRU_ESCR1" },
971 { 0x03BA, "MSR_IQ_ESCR0" },
972 { 0x03BB, "MSR_IQ_ESCR1" },
973 { 0x03BC, "MSR_RAT_ESCR0" },
974 { 0x03BD, "MSR_RAT_ESCR1" },
975 { 0x03BE, "MSR_SSU_ESCR0" },
976 { 0x03C0, "MSR_MS_ESCR0" },
977 { 0x03C1, "MSR_MS_ESCR1" },
978 { 0x03C2, "MSR_TBPU_ESCR0" },
979 { 0x03C3, "MSR_TBPU_ESCR1" },
980 { 0x03C4, "MSR_TC_ESCR0" },
981 { 0x03C5, "MSR_TC_ESCR1" },
982 { 0x03C8, "MSR_IX_ESCR0" },
983 { 0x03C9, "MSR_IX_ESCR1" },
984 { 0x03CA, "MSR_ALF_ESCR0" },
985 { 0x03CB, "MSR_ALF_ESCR1" },
986 { 0x03CC, "MSR_CRU_ESCR2" },
987 { 0x03CD, "MSR_CRU_ESCR3" },
988 { 0x03E0, "MSR_CRU_ESCR4" },
989 { 0x03E1, "MSR_CRU_ESCR5" },
990 { 0x03F0, "MSR_TC_PRECISE_EVENT" },
991 { 0x03F1, "MSR_PEBS_ENABLE" },
992 { 0x03F2, "MSR_PEBS_MATRIX_VERT" },
993 { 0x0400, "IA32_MC0_CTL" },
994 { 0x0401, "IA32_MC0_STATUS" },
995 { 0x0402, "IA32_MC0_ADDR" },
996 { 0x0403, "IA32_MC0_MISC" },
997 { 0x0404, "IA32_MC1_CTL" },
998 { 0x0405, "IA32_MC1_STATUS" },
999 { 0x0406, "IA32_MC1_ADDR" },
1000 { 0x0408, "IA32_MC2_CTL" },
1001 { 0x0409, "IA32_MC2_STATUS" },
1002 { 0x040b, "IA32_MC2_MISC" },
1003 { 0x040c, "IA32_MC3_CTL" },
1004 { 0x040d, "IA32_MC3_STATUS" },
1005 { 0x040e, "IA32_MC3_ADDR" },
1006 { 0x040f, "IA32_MC3_MISC" },
1009 static const msr_entry_t modelf6x_per_core_msrs[] = {
1010 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
1011 { 0x001b, "IA32_APIC_BASE" },
1012 { 0x008b, "IA32_BIOS_SIGN_ID" },
1013 { 0x00fe, "IA32_MTRRCAP" },
1014 { 0x0174, "IA32_SYSENTER_CS" },
1015 { 0x0175, "IA32_SYSENTER_ESP" },
1016 { 0x0176, "IA32_SYSENTER_EIP" },
1017 { 0x0179, "IA32_MCG_CAP" },
1018 { 0x017a, "IA32_MCG_STATUS" },
1019 { 0x0180, "MSR_MCG_RAX" },
1020 { 0x0181, "MSR_MCG_RBX" },
1021 { 0x0182, "MSR_MCG_RCX" },
1022 { 0x0183, "MSR_MCG_RDX" },
1023 { 0x0184, "MSR_MCG_RSI" },
1024 { 0x0185, "MSR_MCG_RDI" },
1025 { 0x0186, "MSR_MCG_RBP" },
1026 { 0x0187, "MSR_MCG_RSP" },
1027 { 0x0188, "MSR_MCG_RFLAGS" },
1028 { 0x0189, "MSR_MCG_RIP" },
1029 { 0x018a, "MSR_MCG_MISC" },
1030 { 0x0190, "MSR_MCG_R8" },
1031 { 0x0191, "MSR_MCG_R9" },
1032 { 0x0192, "MSR_MCG_R10" },
1033 { 0x0193, "MSR_MCG_R11" },
1034 { 0x0194, "MSR_MCG_R12" },
1035 { 0x0195, "MSR_MCG_R13" },
1036 { 0x0196, "MSR_MCG_R14" },
1037 { 0x0197, "MSR_MCG_R15" },
1038 { 0x0198, "IA32_PERF_STATUS" },
1039 { 0x0199, "IA32_PERF_CTL" },
1040 { 0x019a, "IA32_CLOCK_MODULATION" },
1041 { 0x019b, "IA32_THERM_INTERRUPT" },
1042 { 0x01A2, "MSR_TEMPERATURE_TARGET" },
1043 { 0x01d7, "MSR_LER_FROM_LIP" },
1044 { 0x01d8, "MSR_LER_TO_LIP" },
1045 { 0x01d9, "MSR_DEBUGCTLA" },
1046 { 0x01da, "MSR_LASTBRANCH_TOS" },
1047 { 0x0277, "IA32_PAT" },
1048 { 0x0600, "IA32_DS_AREA" },
1049 { 0x0680, "MSR_LASTBRANCH_0_FROM_IP" },
1050 { 0x0681, "MSR_LASTBRANCH_1_FROM_IP" },
1051 { 0x0682, "MSR_LASTBRANCH_2_FROM_IP" },
1052 { 0x0683, "MSR_LASTBRANCH_3_FROM_IP" },
1053 { 0x0684, "MSR_LASTBRANCH_4_FROM_IP" },
1054 { 0x0685, "MSR_LASTBRANCH_5_FROM_IP" },
1055 { 0x0686, "MSR_LASTBRANCH_6_FROM_IP" },
1056 { 0x0687, "MSR_LASTBRANCH_7_FROM_IP" },
1057 { 0x0688, "MSR_LASTBRANCH_8_FROM_IP" },
1058 { 0x0689, "MSR_LASTBRANCH_9_FROM_IP" },
1059 { 0x068a, "MSR_LASTBRANCH_10_FROM_IP" },
1060 { 0x068b, "MSR_LASTBRANCH_11_FROM_IP" },
1061 { 0x068c, "MSR_LASTBRANCH_12_FROM_IP" },
1062 { 0x068d, "MSR_LASTBRANCH_13_FROM_IP" },
1063 { 0x068e, "MSR_LASTBRANCH_14_FROM_IP" },
1064 { 0x068f, "MSR_LASTBRANCH_15_FROM_IP" },
1065 { 0x06c0, "MSR_LASTBRANCH_0_TO_IP" },
1066 { 0x06c1, "MSR_LASTBRANCH_1_TO_IP" },
1067 { 0x06c2, "MSR_LASTBRANCH_2_TO_IP" },
1068 { 0x06c3, "MSR_LASTBRANCH_3_TO_IP" },
1069 { 0x06c4, "MSR_LASTBRANCH_4_TO_IP" },
1070 { 0x06c5, "MSR_LASTBRANCH_5_TO_IP" },
1071 { 0x06c6, "MSR_LASTBRANCH_6_TO_IP" },
1072 { 0x06c7, "MSR_LASTBRANCH_7_TO_IP" },
1073 { 0x06c8, "MSR_LASTBRANCH_8_TO_IP" },
1074 { 0x06c9, "MSR_LASTBRANCH_9_TO_IP" },
1075 { 0x06ca, "MSR_LASTBRANCH_10_TO_IP" },
1076 { 0x06cb, "MSR_LASTBRANCH_11_TO_IP" },
1077 { 0x06cc, "MSR_LASTBRANCH_12_TO_IP" },
1078 { 0x06cd, "MSR_LASTBRANCH_13_TO_IP" },
1079 { 0x06ce, "MSR_LASTBRANCH_14_TO_IP" },
1080 { 0x06cf, "MSR_LASTBRANCH_15_TO_IP" },
1081 /* Intel Xeon processor 7100 with L3 */
1082 // { 0x107CC, "MSR_EMON_L3_CTR_CTL0" },
1083 // { 0x107CD, "MSR_EMON_L3_CTR_CTL1" },
1084 // { 0x107CE, "MSR_EMON_L3_CTR_CTL2" },
1085 // { 0x107CF, "MSR_EMON_L3_CTR_CTL3" },
1086 // { 0x107D0, "MSR_EMON_L3_CTR_CTL4" },
1087 // { 0x107D1, "MSR_EMON_L3_CTR_CTL5" },
1088 // { 0x107D2, "MSR_EMON_L3_CTR_CTL6" },
1089 // { 0x107D3, "MSR_EMON_L3_CTR_CTL7" },
1092 /* Atom N455
1094 * This should apply to the following processors:
1095 * 06_1CH
1096 * 06_26H
1097 * 06_27H
1098 * 06_35
1099 * 06_36
1102 * All MSRs per
1104 * Intel 64 and IA-32 Architectures Software Developer's Manual
1105 * Volume 3C: System Programming Guide, Part 3
1106 * Order Number 326019
1107 * January 2013
1109 * Table 35-4, 35-5
1111 * For now it has only been tested with 06_1CH.
1113 static const msr_entry_t model6_atom_global_msrs[] = {
1114 { 0x0000, "IA32_P5_MC_ADDR" },
1115 { 0x0001, "IA32_P5_MC_TYPE" },
1116 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
1117 { 0x0017, "IA32_PLATFORM_ID" },
1118 { 0x002a, "MSR_EBC_HARD_POWERON" },
1119 { 0x00cd, "MSR_FSB_FREQ" },
1120 { 0x00fe, "IA32_MTRRCAP" },
1121 { 0x011e, "MSR_BBL_CR_CTL3" },
1122 { 0x0198, "IA32_PERF_STATUS" },
1123 { 0x019d, "MSR_THERM2_CTL" },
1124 { 0x0200, "IA32_MTRR_PHYSBASE0" },
1125 { 0x0201, "IA32_MTRR_PHYSMASK0" },
1126 { 0x0202, "IA32_MTRR_PHYSBASE1" },
1127 { 0x0203, "IA32_MTRR_PHYSMASK1" },
1128 { 0x0204, "IA32_MTRR_PHYSBASE2" },
1129 { 0x0205, "IA32_MTRR_PHYSMASK2" },
1130 { 0x0206, "IA32_MTRR_PHYSBASE3" },
1131 { 0x0207, "IA32_MTRR_PHYSMASK3" },
1132 { 0x0208, "IA32_MTRR_PHYSBASE4" },
1133 { 0x0209, "IA32_MTRR_PHYSMASK4" },
1134 { 0x020a, "IA32_MTRR_PHYSBASE5" },
1135 { 0x020b, "IA32_MTRR_PHYSMASK5" },
1136 { 0x020c, "IA32_MTRR_PHYSBASE6" },
1137 { 0x020d, "IA32_MTRR_PHYSMASK6" },
1138 { 0x020e, "IA32_MTRR_PHYSBASE7" },
1139 { 0x020f, "IA32_MTRR_PHYSMASK7" },
1140 { 0x0250, "IA32_MTRR_FIX64K_00000" },
1141 { 0x0258, "IA32_MTRR_FIX16K_80000" },
1142 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
1143 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
1144 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
1145 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
1146 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
1147 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
1148 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
1149 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
1150 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
1151 { 0x0345, "IA32_PERF_CAPABILITIES" },
1152 { 0x400, "IA32_MC0_CTL" },
1153 { 0x401, "IA32_MC0_STATUS" },
1154 { 0x402, "IA32_MC0_ADDR" },
1155 { 0x404, "IA32_MC1_CTL" },
1156 { 0x405, "IA32_MC1_STATUS" },
1157 { 0x408, "IA32_MC2_CTL" },
1158 { 0x409, "IA32_MC2_STATUS" },
1159 { 0x40a, "IA32_MC2_ADDR" },
1160 { 0x40c, "IA32_MC3_CTL" },
1161 { 0x40d, "IA32_MC3_STATUS" },
1162 { 0x40e, "IA32_MC3_ADDR" },
1163 { 0x410, "IA32_MC4_CTL" },
1164 { 0x411, "IA32_MC4_STATUS" },
1165 { 0x412, "IA32_MC4_ADDR" },
1167 * Only 06_27C has the following MSRs
1170 { 0x03f8, "MSR_PKG_C2_RESIDENCY" },
1171 { 0x03f9, "MSR_PKG_C4_RESIDENCY" },
1172 { 0x03fa, "MSR_PKG_C6_RESIDENCY" },
1176 static const msr_entry_t model6_atom_per_core_msrs[] = {
1177 { 0x0006, "IA32_MONITOR_FILTER_SIZE" },
1178 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
1179 { 0x001b, "IA32_APIC_BASE" },
1180 { 0x003a, "IA32_FEATURE_CONTROL" },
1181 { 0x0040, "MSR_LASTBRANCH_0_FROM_IP" },
1182 { 0x0041, "MSR_LASTBRANCH_1_FROM_IP" },
1183 { 0x0042, "MSR_LASTBRANCH_2_FROM_IP" },
1184 { 0x0043, "MSR_LASTBRANCH_3_FROM_IP" },
1185 { 0x0044, "MSR_LASTBRANCH_4_FROM_IP" },
1186 { 0x0045, "MSR_LASTBRANCH_5_FROM_IP" },
1187 { 0x0046, "MSR_LASTBRANCH_6_FROM_IP" },
1188 { 0x0047, "MSR_LASTBRANCH_7_FROM_IP" },
1189 { 0x0060, "MSR_LASTBRANCH_0_TO_IP" },
1190 { 0x0061, "MSR_LASTBRANCH_1_TO_IP" },
1191 { 0x0062, "MSR_LASTBRANCH_2_TO_IP" },
1192 { 0x0063, "MSR_LASTBRANCH_3_TO_IP" },
1193 { 0x0064, "MSR_LASTBRANCH_4_TO_IP" },
1194 { 0x0065, "MSR_LASTBRANCH_5_TO_IP" },
1195 { 0x0066, "MSR_LASTBRANCH_6_TO_IP" },
1196 { 0x0067, "MSR_LASTBRANCH_7_TO_IP" },
1197 /* Write register */
1199 { 0x0079, "IA32_BIOS_UPDT_TRIG" },
1201 { 0x008b, "IA32_BIOS_SIGN_ID" },
1202 { 0x00c1, "IA32_PMC0" },
1203 { 0x00c2, "IA32_PMC1" },
1204 { 0x00e7, "IA32_MPERF" },
1205 { 0x00e8, "IA32_APERF" },
1206 { 0x0174, "IA32_SYSENTER_CS" },
1207 { 0x0175, "IA32_SYSENTER_ESP" },
1208 { 0x0176, "IA32_SYSENTER_EIP" },
1209 { 0x017a, "IA32_MCG_STATUS" },
1210 { 0x0186, "IA32_PERF_EVNTSEL0" },
1211 { 0x0187, "IA32_PERF_EVNTSEL1" },
1212 { 0x0199, "IA32_PERF_CONTROL" },
1213 { 0x019a, "IA32_CLOCK_MODULATION" },
1214 { 0x019b, "IA32_THERM_INTERRUPT" },
1215 { 0x019c, "IA32_THERM_STATUS" },
1216 { 0x01a0, "IA32_MISC_ENABLES" },
1217 { 0x01c9, "MSR_LASTBRANCH_TOS" },
1218 { 0x01d9, "IA32_DEBUGCTL" },
1219 { 0x01dd, "MSR_LER_FROM_LIP" },
1220 { 0x01de, "MSR_LER_TO_LIP" },
1221 { 0x0277, "IA32_PAT" },
1222 { 0x0309, "IA32_FIXED_CTR0" },
1223 { 0x030a, "IA32_FIXED_CTR1" },
1224 { 0x030b, "IA32_FIXED_CTR2" },
1225 { 0x038d, "IA32_FIXED_CTR_CTRL" },
1226 { 0x038e, "IA32_PERF_GLOBAL_STATUS" },
1227 { 0x038f, "IA32_PERF_GLOBAL_CTRL" },
1228 { 0x0390, "IA32_PERF_GLOBAL_OVF_CTRL" },
1229 { 0x03f1, "MSR_PEBS_ENABLE" },
1230 { 0x0480, "IA32_VMX_BASIC" },
1231 { 0x0481, "IA32_VMX_PINBASED_CTLS" },
1232 { 0x0482, "IA32_VMX_PROCBASED_CTLS" },
1233 { 0x0483, "IA32_VMX_EXIT_CTLS" },
1234 { 0x0484, "IA32_VMX_ENTRY_CTLS" },
1235 { 0x0485, "IA32_VMX_MISC" },
1236 { 0x0486, "IA32_VMX_CR0_FIXED0" },
1237 { 0x0487, "IA32_VMX_CR0_FIXED1" },
1238 { 0x0488, "IA32_VMX_CR4_FIXED0" },
1239 { 0x0489, "IA32_VMX_CR4_FIXED1" },
1240 { 0x048a, "IA32_VMX_VMCS_ENUM" },
1241 { 0x048b, "IA32_VMX_PROCBASED_CTLS2" },
1242 { 0x0600, "IA32_DS_AREA" },
1245 static const msr_entry_t model20650_global_msrs[] = {
1246 { 0x0000, "IA32_P5_MC_ADDR" },
1247 { 0x0001, "IA32_P5_MC_TYPE" },
1248 { 0x0006, "IA32_MONITOR_FILTER_LINE_SIZE" },
1249 { 0x0017, "IA32_PLATFORM_ID" },
1250 { 0x002a, "MSR_EBC_HARD_POWERON" },
1251 // WRITE ONLY { 0x0079, "IA32_BIOS_UPDT_TRIG" },
1252 { 0x00ce, "IA32_MSR_PLATFORM_INFO" },
1253 { 0x00e2, "IA32_MSR_PMG_CST_CONFIG" },
1254 { 0x019c, "IA32_THERM_STATUS" },
1255 { 0x019d, "MSR_THERM2_CTL" },
1256 { 0x01a0, "IA32_MISC_ENABLE" },
1257 { 0x0200, "IA32_MTRR_PHYSBASE0" },
1258 { 0x0201, "IA32_MTRR_PHYSMASK0" },
1259 { 0x0202, "IA32_MTRR_PHYSBASE1" },
1260 { 0x0203, "IA32_MTRR_PHYSMASK1" },
1261 { 0x0204, "IA32_MTRR_PHYSBASE2" },
1262 { 0x0205, "IA32_MTRR_PHYSMASK2" },
1263 { 0x0206, "IA32_MTRR_PHYSBASE3" },
1264 { 0x0207, "IA32_MTRR_PHYSMASK3" },
1265 { 0x0208, "IA32_MTRR_PHYSBASE4" },
1266 { 0x0209, "IA32_MTRR_PHYSMASK4" },
1267 { 0x020a, "IA32_MTRR_PHYSBASE5" },
1268 { 0x020b, "IA32_MTRR_PHYSMASK5" },
1269 { 0x020c, "IA32_MTRR_PHYSBASE6" },
1270 { 0x020d, "IA32_MTRR_PHYSMASK6" },
1271 { 0x020e, "IA32_MTRR_PHYSBASE7" },
1272 { 0x020f, "IA32_MTRR_PHYSMASK7" },
1273 { 0x0250, "IA32_MTRR_FIX64K_00000" },
1274 { 0x0258, "IA32_MTRR_FIX16K_80000" },
1275 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
1276 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
1277 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
1278 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
1279 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
1280 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
1281 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
1282 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
1283 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
1284 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
1285 { 0x0300, "MSR_BPU_COUNTER0" },
1286 { 0x0301, "MSR_BPU_COUNTER1" },
1287 /* Skipped through 0x3ff for now*/
1289 /* All MCX_ADDR AND MCX_MISC MSRs depend on a bit being
1290 * set in MCX_STATUS */
1291 { 0x400, "IA32_MC0_CTL" },
1292 { 0x401, "IA32_MC0_STATUS" },
1293 { 0x402, "IA32_MC0_ADDR" },
1294 { 0x403, "IA32_MC0_MISC" },
1295 { 0x404, "IA32_MC1_CTL" },
1296 { 0x405, "IA32_MC1_STATUS" },
1297 { 0x406, "IA32_MC1_ADDR" },
1298 { 0x407, "IA32_MC1_MISC" },
1299 { 0x408, "IA32_MC2_CTL" },
1300 { 0x409, "IA32_MC2_STATUS" },
1301 { 0x40a, "IA32_MC2_ADDR" },
1302 { 0x40c, "IA32_MC3_CTL" },
1303 { 0x40d, "IA32_MC3_STATUS" },
1304 { 0x40e, "IA32_MC3_ADDR" },
1305 { 0x410, "IA32_MC4_CTL" },
1306 { 0x411, "IA32_MC4_STATUS" },
1309 static const msr_entry_t model20650_per_core_msrs[] = {
1310 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
1311 { 0x001b, "IA32_APIC_BASE" },
1312 { 0x003a, "IA32_FEATURE_CONTROL" },
1313 { 0x008b, "IA32_BIOS_SIGN_ID" },
1314 { 0x009b, "IA32_SMM_MONITOR_CTL" },
1315 { 0x00e4, "IA32_PMG_IO_CAPTURE_BASE" },
1316 { 0x00fe, "IA32_MTRRCAP" },
1317 { 0x0174, "IA32_SYSENTER_CS" },
1318 { 0x0175, "IA32_SYSENTER_ESP" },
1319 { 0x0176, "IA32_SYSENTER_EIP" },
1320 { 0x0179, "IA32_MCG_CAP" },
1321 { 0x017a, "IA32_MCG_STATUS" },
1322 { 0x0186, "MSR_MCG_RBP" },
1323 { 0x0187, "MSR_MCG_RSP" },
1324 { 0x0188, "MSR_MCG_RFLAGS" },
1325 { 0x0189, "MSR_MCG_RIP" },
1326 { 0x0194, "MSR_MCG_R12" },
1327 { 0x0198, "IA32_PERF_STATUS" },
1328 { 0x0199, "IA32_PERF_CTL" },
1329 { 0x019a, "IA32_CLOCK_MODULATION" },
1330 { 0x019b, "IA32_THERM_INTERRUPT" },
1331 { 0x01a0, "IA32_MISC_ENABLE" }, // Bit 34 is Core Specific
1332 { 0x01aa, "IA32_MISC_PWR_MGMT" },
1333 { 0x01d9, "MSR_DEBUGCTLA" },
1334 { 0x01fc, "MSR_POWER_CTL" },
1335 { 0x0277, "IA32_PAT" },
1336 /** Virtualization
1337 { 0x480, "IA32_VMX_BASIC" },
1338 through
1339 { 0x48b, "IA32_VMX_PROCBASED_CTLS2" },
1340 Not implemented in my CPU
1342 { 0x0600, "IA32_DS_AREA" },
1343 /* 0x0680 - 0x06cf Branch Records Skipped */
1345 { 0x3a, "IA32_FEATURE_CONTROL" },
1346 { 0x13c, "MSR_FEATURE_CONFIG" },
1347 { 0x194, "MSR_FLEX_RATIO" },
1348 { 0x1a0, "IA32_MISC_ENABLE" },
1349 { 0x1a2, "MSR_TEMPERATURE_TARGET" },
1350 { 0x199, "IA32_PERF_CTL" },
1351 { 0x19b, "IA32_THERM_INTERRUPT" },
1352 { 0x401, "IA32_MC0_STATUS" },
1353 { 0x2e, "MSR_PIC_MSG_CONTROL" },
1354 { 0xce, "MSR_PLATFORM_INFO" },
1355 { 0xe2, "MSR_PMG_CST_CONFIG_CONTROL" },
1356 { 0xe4, "MSR_PMG_IO_CAPTURE_BASE" },
1357 { 0x1aa, "MSR_MISC_PWR_MGMT" },
1358 { 0x1ad, "MSR_TURBO_RATIO_LIMIT" },
1359 { 0x1fc, "MSR_POWER_CTL" },
1363 * The following two tables are the Silvermont registers listed in Table 35-6
1364 * Intel® 64 and IA-32 Architectures Software Developer's Manual
1365 * September 2014
1366 * Vol. 3C 35-59
1368 static const msr_entry_t silvermont_per_core_msrs[] = {
1370 * Per core MSRs in Intel Processors Based on the Silvermont Microarchitecture
1371 * These are MSRs marked as "core"
1374 { 0x0006, "IA32_MONITOR_FILTER_LINE_SIZE" },
1375 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
1376 { 0x001b, "IA32_APIC_BASE" },
1377 { 0x0034, "MSR_SMI_COUNT" },
1378 { 0x003a, "IA32_FEATURE_CONTROL" },
1379 { 0x0040, "MSR_LASTBRANCH_0_FROM_IP" },
1380 { 0x0041, "MSR_LASTBRANCH_1_FROM_IP" },
1381 { 0x0042, "MSR_LASTBRANCH_2_FROM_IP" },
1382 { 0x0043, "MSR_LASTBRANCH_3_FROM_IP" },
1383 { 0x0044, "MSR_LASTBRANCH_4_FROM_IP" },
1384 { 0x0045, "MSR_LASTBRANCH_5_FROM_IP" },
1385 { 0x0046, "MSR_LASTBRANCH_6_FROM_IP" },
1386 { 0x0047, "MSR_LASTBRANCH_7_FROM_IP" },
1387 { 0x0060, "MSR_LASTBRANCH_0_TO_IP" },
1388 { 0x0061, "MSR_LASTBRANCH_1_TO_IP" },
1389 { 0x0062, "MSR_LASTBRANCH_2_TO_IP" },
1390 { 0x0063, "MSR_LASTBRANCH_3_TO_IP" },
1391 { 0x0064, "MSR_LASTBRANCH_4_TO_IP" },
1392 { 0x0065, "MSR_LASTBRANCH_5_TO_IP" },
1393 { 0x0066, "MSR_LASTBRANCH_6_TO_IP" },
1394 { 0x0067, "MSR_LASTBRANCH_7_TO_IP" },
1395 /* Write register
1396 { 0x0079, "IA32_BIOS_UPDT_TRIG" },
1398 { 0x008b, "IA32_BIOS_SIGN_ID" },
1399 { 0x00c1, "IA32_PMC0" },
1400 { 0x00c2, "IA32_PMC1" },
1401 { 0x00e7, "IA32_MPERF" },
1402 { 0x00e8, "IA32_APERF" },
1403 { 0x00fe, "IA32_MTRRCAP" },
1404 { 0x0174, "IA32_SYSENTER_CS" },
1405 { 0x0175, "IA32_SYSENTER_ESP" },
1406 { 0x0176, "IA32_SYSENTER_EIP" },
1407 { 0x0179, "IA32_MCG_CAP" },
1408 { 0x017a, "IA32_MCG_STATUS" },
1409 { 0x0186, "IA32_PERF_EVNTSEL0" },
1410 { 0x0187, "IA32_PERF_EVNTSEL1" },
1411 { 0x0199, "IA32_PERF_CONTROL" },
1412 { 0x019a, "IA32_CLOCK_MODULATION" },
1413 { 0x019b, "IA32_THERM_INTERRUPT" },
1414 { 0x019c, "IA32_THERM_STATUS" },
1415 { 0x01a0, "IA32_MISC_ENABLES" },
1416 { 0x01b0, "IA32_ENERGY_PERF_BIAS" },
1417 { 0x01c9, "MSR_LASTBRANCH_TOS" },
1418 { 0x01d9, "IA32_DEBUGCTL" },
1419 { 0x01dd, "MSR_LER_FROM_LIP" },
1420 { 0x01de, "MSR_LER_TO_LIP" },
1421 { 0x01f2, "IA32_SMRR_PHYSBASE" },
1422 { 0x01f3, "IA32_SMRR_PHYSMASK" },
1423 { 0x0200, "IA32_MTRR_PHYSBASE0" },
1424 { 0x0201, "IA32_MTRR_PHYSMASK0" },
1425 { 0x0202, "IA32_MTRR_PHYSBASE1" },
1426 { 0x0203, "IA32_MTRR_PHYSMASK1" },
1427 { 0x0204, "IA32_MTRR_PHYSBASE2" },
1428 { 0x0205, "IA32_MTRR_PHYSMASK2" },
1429 { 0x0206, "IA32_MTRR_PHYSBASE3" },
1430 { 0x0207, "IA32_MTRR_PHYSMASK3" },
1431 { 0x0208, "IA32_MTRR_PHYSBASE4" },
1432 { 0x0209, "IA32_MTRR_PHYSMASK4" },
1433 { 0x020a, "IA32_MTRR_PHYSBASE5" },
1434 { 0x020b, "IA32_MTRR_PHYSMASK5" },
1435 { 0x020c, "IA32_MTRR_PHYSBASE6" },
1436 { 0x020d, "IA32_MTRR_PHYSMASK6" },
1437 { 0x020e, "IA32_MTRR_PHYSBASE7" },
1438 { 0x020f, "IA32_MTRR_PHYSMASK7" },
1439 { 0x0250, "IA32_MTRR_FIX64K_00000" },
1440 { 0x0258, "IA32_MTRR_FIX16K_80000" },
1441 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
1442 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
1443 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
1444 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
1445 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
1446 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
1447 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
1448 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
1449 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
1450 { 0x0277, "IA32_PAT" },
1451 { 0x02FF, "IA32_MTRR_DEF_TYPE" },
1452 { 0x0309, "IA32_FIXED_CTR0" },
1453 { 0x030a, "IA32_FIXED_CTR1" },
1454 { 0x030b, "IA32_FIXED_CTR2" },
1455 { 0x0345, "IA32_PERF_CAPABILITIES" },
1456 { 0x038d, "IA32_FIXED_CTR_CTRL" },
1457 { 0x038e, "IA32_PERF_GLOBAL_STATUS" },
1458 { 0x038f, "IA32_PERF_GLOBAL_CTRL" },
1459 { 0x0390, "IA32_PERF_GLOBAL_OVF_CTRL" },
1460 { 0x03f1, "MSR_PEBS_ENABLE" },
1461 { 0x03fd, "MSR_CORE_C6_RESIDENCY" },
1462 { 0x40c, "IA32_MC3_CTL" },
1463 { 0x40d, "IA32_MC3_STATUS" },
1464 { 0x40e, "IA32_MC3_ADDR" },
1465 { 0x410, "IA32_MC4_CTL" },
1466 { 0x411, "IA32_MC4_STATUS" },
1467 { 0x412, "IA32_MC4_ADDR" },
1468 { 0x0480, "IA32_VMX_BASIC" },
1469 { 0x0481, "IA32_VMX_PINBASED_CTLS" },
1470 { 0x0482, "IA32_VMX_PROCBASED_CTLS" },
1471 { 0x0483, "IA32_VMX_EXIT_CTLS" },
1472 { 0x0484, "IA32_VMX_ENTRY_CTLS" },
1473 { 0x0485, "IA32_VMX_MISC" },
1474 { 0x0486, "IA32_VMX_CR0_FIXED0" },
1475 { 0x0487, "IA32_VMX_CR0_FIXED1" },
1476 { 0x0488, "IA32_VMX_CR4_FIXED0" },
1477 { 0x0489, "IA32_VMX_CR4_FIXED1" },
1478 { 0x048a, "IA32_VMX_VMCS_ENUM" },
1479 { 0x048b, "IA32_VMX_PROCBASED_CTLS2" },
1480 { 0x048c, "IA32_VMX_EPT_VPID_ENUM" },
1481 { 0x048d, "IA32_VMX_TRUE_PINBASED_CTLS" },
1482 { 0x048e, "IA32_VMX_TRUE_PROCBASED_CTLS" },
1483 { 0x048f, "IA32_VMX_TRUE_EXIT_CTLS" },
1484 { 0x0490, "IA32_VMX_TRUE_ENTRY_CTLS" },
1485 { 0x0491, "IA32_VMX_FMFUNC" },
1486 { 0x04c1, "IA32_A_PMC0" },
1487 { 0x04c2, "IA32_A_PMC1" },
1488 { 0x0600, "IA32_DS_AREA" },
1489 { 0x0660, "MSR_CORE_C1_RESIDENCY" },
1490 { 0x06e0, "IA32_TSC_DEADLINE" },
1493 static const msr_entry_t silvermont_global_msrs[] = {
1495 * Common MSRs in Intel Processors Based on the Silvermont Microarchitecture
1496 * These are MSRs marked as "shared" or "package"
1498 { 0x0000, "IA32_P5_MC_ADDR" },
1499 { 0x0001, "IA32_P5_MC_TYPE" },
1500 { 0x0017, "IA32_PLATFORM_ID" },
1501 { 0x002a, "MSR_EBC_HARD_POWERON" },
1502 { 0x00cd, "MSR_FSB_FREQ" },
1503 { 0x00e2, "MSR_PKG_CST_CONFIG_CONTROL" },
1504 { 0x00e4, "MSR_PMG_IO_CAPTURE_BASE" },
1505 { 0x011e, "BBL_CR_CTL3" },
1506 { 0x0198, "IA32_PERF_STATUS" },
1507 { 0x01A2, "MSR_TEMPERATURE_TARGET" },
1508 { 0x01A6, "MSR_OFFCORE_RSP_0" },
1509 { 0x01A7, "MSR_OFFCORE_RSP_1" },
1510 { 0x01AD, "MSR_TURBO_RATIO_LIMIT" },
1511 { 0x03fa, "MSR_PKG_C6_RESIDENCY" },
1512 { 0x400, "IA32_MC0_CTL" },
1513 { 0x401, "IA32_MC0_STATUS" },
1514 { 0x402, "IA32_MC0_ADDR" },
1515 { 0x404, "IA32_MC1_CTL" },
1516 { 0x405, "IA32_MC1_STATUS" },
1517 { 0x408, "IA32_MC2_CTL" },
1518 { 0x409, "IA32_MC2_STATUS" },
1519 { 0x40a, "IA32_MC2_ADDR" },
1520 { 0x414, "MSR_MC5_CTL" },
1521 { 0x415, "MSR_MC5_STATUS" },
1522 { 0x416, "MSR_MC5_ADDR" },
1526 * Intel 64 and IA-32 Architectures Software Developers Manual Conbined Volumes
1527 * Page 4668
1529 * The following two tables are for the Kaby Lake processors
1530 * 06_9EH.
1534 static const msr_entry_t model96ex_global_msrs[] = {
1535 { 0x0017, "IA32_PLATFORM_ID"},
1536 { 0x0080, "MSR_TRACE_HUB_STH_ACPIBAR_BASE"},
1537 { 0x00CE, "MSR_PLATFORM_INFO"},
1538 { 0x0198, "IA32_PERF_STATUS"},
1539 { 0x01A2, "MSR_TEMPERATURE_TARGET"},
1540 { 0x01AD, "MSR_TURBO_RATIO_LIMIT"},
1541 { 0x0284, "IA32_MC4_CTL2"},
1542 { 0x02F4, "MSR_UNCORE_PRMRR_PHYS_BASE"},
1543 { 0x02F5, "MSR_UNCORE_PRMRR_PHYS_MASK"},
1544 { 0x0394, "MSR_UNC_PERF_FIXED_CTRL"},
1545 { 0x0395, "MSR_UNC_PERF_FIXED_CTR"},
1546 { 0x060A, "MSR_PKGC3_IRTL"},
1547 { 0x060B, "MSR_PKGC6_IRTL"},
1548 { 0x060D, "MSR_PKG_C2_RESIDENCY"},
1549 { 0x0610, "MSR_PKG_POWER_LIMIT"},
1550 { 0x0614, "MSR_PKG_POWER_INFO"},
1551 { 0x0620, "MSR_RING_RATIO_LIMIT"},
1552 { 0x0638, "MSR_PP0_POWER_LIMIT"},
1553 { 0x064F, "MSR_CORE_PERF_LIMIT_REASONS"},
1554 { 0x0652, "MSR_PKG_HDC_CONFIG"},
1555 { 0x065C, "MSR_PLATFORM_POWER_LIMIT"},
1556 { 0x06B0, "MSR_GRAPHICS_PERF_LIMIT_REASONS"},
1557 { 0x06B1, "MSR_RING_PERF_LIMIT_REASONS"},
1558 { 0x0770, "IA32_PM_ENABLE"},
1559 { 0x0DB0, "IA32_PKG_HDC_CTL"},
1560 { 0x03B0, "MSR_UNC_ARB_PERFCTR0"},
1561 { 0x03B1, "MSR_UNC_ARB_PERFCTR1"},
1562 { 0x03B2, "MSR_UNC_ARB_PERFEVTSEL0"},
1563 { 0x03B3, "MSR_UNC_ARB_PERFEVTSEL1"},
1564 { 0x0700, "MSR_UNC_CBO_0_PERFCTR0"},
1565 { 0x0701, "MSR_UNC_CBO_0_PERFCTR1"},
1566 { 0x0706, "MSR_UNC_CBO_0_PERFEVTSEL0"},
1567 { 0x0707, "MSR_UNC_CBO_0_PERFEVTSEL1"},
1568 { 0x0710, "MSR_UNC_CBO_1_PERFCTR0"},
1569 { 0x0711, "MSR_UNC_CBO_1_PERFCTR1"},
1570 { 0x0716, "MSR_UNC_CBO_1_PERFEVTSEL0"},
1571 { 0x0717, "MSR_UNC_CBO_1_PERFEVTSEL1"},
1572 { 0x0720, "MSR_UNC_CBO_2_PERFCTR0"},
1573 { 0x0721, "MSR_UNC_CBO_2_PERFCTR1"},
1574 { 0x0726, "MSR_UNC_CBO_2_PERFEVTSEL0"},
1575 { 0x0727, "MSR_UNC_CBO_2_PERFEVTSEL1"},
1576 { 0x0730, "MSR_UNC_CBO_3_PERFCTR0"},
1577 { 0x0731, "MSR_UNC_CBO_3_PERFCTR1"},
1578 { 0x0736, "MSR_UNC_CBO_3_PERFEVTSEL0"},
1579 { 0x0737, "MSR_UNC_CBO_3_PERFEVTSEL1"},
1580 { 0x0E01, "MSR_UNC_PERF_GLOBAL_CTRL"},
1581 { 0x0E02, "MSR_UNC_PERF_GLOBAL_STATUS"},
1584 static const msr_entry_t model96ex_per_core_msrs[] = {
1585 /* Per core MSRs for Sandy Bridge and above */
1586 { 0x0000, "IA32_P5_MC_ADDR"},
1587 { 0x0001, "IA32_P5_MC_TYPE"},
1588 { 0x0006, "IA32_MONITOR_FILTER_SIZE"},
1589 { 0x0010, "IA32_TIME_STAMP_COUNTER"},
1590 { 0x001B, "IA32_APIC_BASE"},
1591 { 0x0034, "MSR_SMI_COUNT"},
1592 { 0x003A, "IA32_FEATURE_CONTROL"},
1593 { 0x008B, "IA32_BIOS_SIGN_ID"},
1594 { 0x00C1, "IA32_PMC0" },
1595 { 0x00C2, "IA32_PMC1" },
1596 { 0x00C3, "IA32_PMC2" },
1597 { 0x00C4, "IA32_PMC3" },
1598 { 0x00E2, "MSR_PKG_CST_CONFIG_CONTROL" },
1599 { 0x00E4, "MSR_PMG_IO_CAPTURE_BASE"},
1600 { 0x00E7, "IA32_MPERF"},
1601 { 0x00E8, "IA32_APERF"},
1602 { 0x00FE, "IA32_MTRRCAP"},
1603 { 0x013C, "MSR_FEATURE_CONFIG"},
1604 { 0x0174, "IA32_SYSENTER_CS"},
1605 { 0x0175, "IA32_SYSENTER_ESP"},
1606 { 0x0176, "IA32_SYSENTER_EIP"},
1607 { 0x0179, "IA32_MCG_CAP"},
1608 { 0x017A, "IA32_MCG_STATUS"},
1609 { 0x0186, "IA32_PERFEVTSEL0"},
1610 { 0x0187, "IA32_PERFEVTSEL1"},
1611 { 0x0188, "IA32_PERFEVTSEL2"},
1612 { 0x0189, "IA32_PERFEVTSEL3"},
1613 { 0x0199, "IA32_PERF_CTL"},
1614 { 0x019A, "IA32_CLOCK_MODULATION"},
1615 { 0x019B, "IA32_THERM_INTERRUPT"},
1616 { 0x019C, "IA32_THERM_STATUS"},
1617 { 0x01A0, "IA32_MISC_ENABLE"},
1618 { 0x01A4, "IA32_MISC_FEATURE_CONTROL"},
1619 { 0x01A6, "MSR_OFFCORE_RSP_0"},
1620 { 0x01A7, "MSR_OFFCORE_RSP_1"},
1621 { 0x01C8, "MSR_LBR_SELECT"},
1622 { 0x01C9, "MSR_LASTBRANCH_TOS"},
1623 { 0x01D9, "IA32_DEBUGCTL"},
1624 { 0x01DD, "MSR_LER_FROM_LIP"},
1625 { 0x01DE, "MSR_LER_TO_LIP"},
1626 { 0x01F2, "IA32_SMRR_PHYSBASE"},
1627 { 0x01F3, "IA32_SMRR_PHYSMASK"},
1628 { 0x01F4, "MSR_PRMRR_PHYS_BASE"},
1629 { 0x01F5, "MSR_PRMRR_PHYS_MASK"},
1630 { 0x01FB, "MSR_PRMRR_VALID_CONFIG"},
1631 { 0x01FC, "MSR_POWER_CTL"},
1632 { 0x0200, "IA32_MTRR_PHYSBASE0"},
1633 { 0x0201, "IA32_MTRR_PHYSBASE0"},
1634 { 0x0202, "IA32_MTRR_PHYSBASE1"},
1635 { 0x0203, "IA32_MTRR_PHYSBASE1"},
1636 { 0x0204, "IA32_MTRR_PHYSBASE2"},
1637 { 0x0205, "IA32_MTRR_PHYSBASE2"},
1638 { 0x0206, "IA32_MTRR_PHYSBASE3"},
1639 { 0x0207, "IA32_MTRR_PHYSBASE3"},
1640 { 0x0208, "IA32_MTRR_PHYSBASE4"},
1641 { 0x0209, "IA32_MTRR_PHYSBASE4"},
1642 { 0x020A, "IA32_MTRR_PHYSBASE5"},
1643 { 0x020B, "IA32_MTRR_PHYSBASE5"},
1644 { 0x020C, "IA32_MTRR_PHYSBASE6"},
1645 { 0x020D, "IA32_MTRR_PHYSBASE6"},
1646 { 0x020E, "IA32_MTRR_PHYSBASE7"},
1647 { 0x020F, "IA32_MTRR_PHYSBASE7"},
1648 { 0x0210, "IA32_MTRR_PHYSBASE8"},
1649 { 0x0211, "IA32_MTRR_PHYSBASE8"},
1650 { 0x0212, "IA32_MTRR_PHYSBASE9"},
1651 { 0x0213, "IA32_MTRR_PHYSBASE9"},
1652 { 0x0250, "IA32_MTRR_FIX64K_00000"},
1653 { 0x0258, "IA32_MTRR_FIX16K_80000"},
1654 { 0x0259, "IA32_MTRR_FIX16K_A0000"},
1655 { 0x0268, "IA32_MTRR_FIX4K_C0000"},
1656 { 0x0269, "IA32_MTRR_FIX4K_C8000"},
1657 { 0x026A, "IA32_MTRR_FIX4K_D0000"},
1658 { 0x026B, "IA32_MTRR_FIX4K_D8000"},
1659 { 0x026C, "IA32_MTRR_FIX4K_E0000"},
1660 { 0x026D, "IA32_MTRR_FIX4K_E8000"},
1661 { 0x026E, "IA32_MTRR_FIX4K_F0000"},
1662 { 0x026F, "IA32_MTRR_FIX4K_F8000"},
1663 { 0x0277, "IA32_PAT"},
1664 { 0x0280, "IA32_MC0_CTL2"},
1665 { 0x0281, "IA32_MC1_CTL2"},
1666 { 0x0282, "IA32_MC2_CTL2"},
1667 { 0x0283, "IA32_MC3_CTL2"},
1668 { 0x02FF, "IA32_MTRR_DEF_TYPE"},
1669 { 0x0309, "IA32_FIXED_CTR0"},
1670 { 0x030A, "IA32_FIXED_CTR1"},
1671 { 0x030B, "IA32_FIXED_CTR2"},
1672 { 0x0345, "IA32_PERF_CAPABILITIES"},
1673 { 0x038D, "IA32_FIXED_CTR_CTRL"},
1674 { 0x038E, "IA32_PERF_GLOBAL_STATUS"},
1675 { 0x038F, "IA32_PERF_GLOBAL_CTRL"},
1676 { 0x0390, "IA32_PERF_GLOBAL_STATUS_RESET"},
1677 { 0x0391, "IA32_PERF_GLOBAL_STATUS_SET"},
1678 { 0x03F1, "MSR_PEBS_ENABLE"},
1679 { 0x03F6, "MSR_PEBS_LD_LAT"},
1680 { 0x03F7, "MSR_PEBS_FRONTEND"},
1681 { 0x03FC, "MSR_CORE_C3_RESIDENCY"},
1682 { 0x03FD, "MSR_CORE_C6_RESIDENCY"},
1683 { 0x03FE, "MSR_CORE_C7_RESIDENCY"},
1684 { 0x0400, "IA32_MC0_CTL" },
1685 { 0x0401, "IA32_MC0_STATUS" },
1686 { 0x0402, "IA32_MC0_ADDR" },
1687 { 0x0403, "IA32_MC0_MISC" },
1688 { 0x0404, "IA32_MC1_CTL" },
1689 { 0x0405, "IA32_MC1_STATUS" },
1690 { 0x0406, "IA32_MC1_ADDR" },
1691 { 0x0407, "IA32_MC1_MISC" },
1692 { 0x0408, "IA32_MC2_CTL" },
1693 { 0x0409, "IA32_MC2_STATUS" },
1694 { 0x040a, "IA32_MC2_ADDR" },
1695 { 0x040c, "IA32_MC3_CTL" },
1696 { 0x040d, "IA32_MC3_STATUS" },
1697 { 0x040e, "IA32_MC3_ADDR" },
1698 { 0x0410, "IA32_MC4_CTL" },
1699 { 0x0411, "IA32_MC4_STATUS" },
1700 { 0x0480, "IA32_VMX_BASIC" },
1701 { 0x0481, "IA32_VMX_PINBASED_CTLS" },
1702 { 0x0482, "IA32_VMX_PROCBASED_CTLS" },
1703 { 0x0483, "IA32_VMX_EXIT_CTLS" },
1704 { 0x0484, "IA32_VMX_ENTRY_CTLS" },
1705 { 0x0485, "IA32_VMX_MISC" },
1706 { 0x0486, "IA32_VMX_CR0_FIXED0" },
1707 { 0x0487, "IA32_VMX_CR0_FIXED1" },
1708 { 0x0488, "IA32_VMX_CR4_FIXED0" },
1709 { 0x0489, "IA32_VMX_CR4_FIXED1" },
1710 { 0x048a, "IA32_VMX_VMCS_ENUM" },
1711 { 0x048b, "IA32_VMX_PROCBASED_CTLS2" },
1712 { 0x048c, "IA32_VMX_EPT_VPID_ENUM" },
1713 { 0x048d, "IA32_VMX_TRUE_PINBASED_CTLS" },
1714 { 0x048e, "IA32_VMX_TRUE_PROCBASED_CTLS" },
1715 { 0x048f, "IA32_VMX_TRUE_EXIT_CTLS" },
1716 { 0x0490, "IA32_VMX_TRUE_ENTRY_CTLS" },
1717 { 0x04C1, "IA32_A_PMC0"},
1718 { 0x04C2, "IA32_A_PMC1"},
1719 { 0x04C3, "IA32_A_PMC2"},
1720 { 0x04C4, "IA32_A_PMC3"},
1721 { 0x0500, "IA32_SGX_SVN_STATUS"},
1722 { 0x0560, "IA32_RTIT_OUTPUT_BASE"},
1723 { 0x0561, "IA32_RTIT_OUTPUT_MASK_PTRS"},
1724 { 0x0570, "IA32_RTIT_CTL"},
1725 { 0x0571, "IA32_RTIT_STATUS"},
1726 { 0x0572, "IA32_RTIT_CR3_MATCH"},
1727 { 0x0580, "IA32_RTIT_ADDR0_A"},
1728 { 0x0581, "IA32_RTIT_ADDR0_B"},
1729 { 0x0582, "IA32_RTIT_ADDR1_A"},
1730 { 0x0583, "IA32_RTIT_ADDR1_B"},
1731 { 0x0600, "IA32_DS_AREA" },
1732 { 0x064E, "MSR_PPERF"},
1733 { 0x0653, "MSR_CORE_HDC_RESIDENCY"},
1734 { 0x0690, "MSR_LASTBRANCH_16_FROM_IP" },
1735 { 0x0691, "MSR_LASTBRANCH_17_FROM_IP" },
1736 { 0x0692, "MSR_LASTBRANCH_18_FROM_IP" },
1737 { 0x0693, "MSR_LASTBRANCH_19_FROM_IP" },
1738 { 0x0694, "MSR_LASTBRANCH_20_FROM_IP" },
1739 { 0x0695, "MSR_LASTBRANCH_21_FROM_IP" },
1740 { 0x0696, "MSR_LASTBRANCH_22_FROM_IP" },
1741 { 0x0697, "MSR_LASTBRANCH_23_FROM_IP" },
1742 { 0x0698, "MSR_LASTBRANCH_24_FROM_IP" },
1743 { 0x0699, "MSR_LASTBRANCH_25_FROM_IP" },
1744 { 0x069A, "MSR_LASTBRANCH_26_FROM_IP" },
1745 { 0x069B, "MSR_LASTBRANCH_27_FROM_IP" },
1746 { 0x069C, "MSR_LASTBRANCH_28_FROM_IP" },
1747 { 0x069D, "MSR_LASTBRANCH_29_FROM_IP" },
1748 { 0x069E, "MSR_LASTBRANCH_30_FROM_IP" },
1749 { 0x069F, "MSR_LASTBRANCH_31_FROM_IP" },
1750 { 0x06d0, "MSR_LASTBRANCH_16_TO_IP" },
1751 { 0x06d1, "MSR_LASTBRANCH_17_TO_IP" },
1752 { 0x06d2, "MSR_LASTBRANCH_18_TO_IP" },
1753 { 0x06d3, "MSR_LASTBRANCH_19_TO_IP" },
1754 { 0x06d4, "MSR_LASTBRANCH_20_TO_IP" },
1755 { 0x06d5, "MSR_LASTBRANCH_21_TO_IP" },
1756 { 0x06d6, "MSR_LASTBRANCH_22_TO_IP" },
1757 { 0x06d7, "MSR_LASTBRANCH_23_TO_IP" },
1758 { 0x06d8, "MSR_LASTBRANCH_24_TO_IP" },
1759 { 0x06d9, "MSR_LASTBRANCH_25_TO_IP" },
1760 { 0x06da, "MSR_LASTBRANCH_26_TO_IP" },
1761 { 0x06db, "MSR_LASTBRANCH_27_TO_IP" },
1762 { 0x06dc, "MSR_LASTBRANCH_28_TO_IP" },
1763 { 0x06dd, "MSR_LASTBRANCH_29_TO_IP" },
1764 { 0x06de, "MSR_LASTBRANCH_30_TO_IP" },
1765 { 0x06df, "MSR_LASTBRANCH_31_TO_IP" },
1766 { 0x06E0, "IA32_TSC_DEADLINE"},
1767 { 0x0771, "IA32_HWP_CAPABILITIES"},
1768 { 0x0773, "IA32_HWP_INTERRUPT"},
1769 { 0x0774, "IA32_HWP_REQUEST"},
1770 { 0x0777, "IA32_HWP_STATUS"},
1771 { 0x0D90, "IA32_BNDCFGS"},
1772 { 0x0DA0, "IA32_XSS"},
1773 { 0x0DB1, "IA32_PM_CTL1"},
1774 { 0x0DB2, "IA32_THREAD_STALL"},
1775 { 0x0DC0, "IA32_LBR_INFO_0"},
1776 { 0x0DC1, "IA32_LBR_INFO_1"},
1777 { 0x0DC2, "IA32_LBR_INFO_2"},
1778 { 0x0DC3, "IA32_LBR_INFO_3"},
1779 { 0x0DC4, "IA32_LBR_INFO_4"},
1780 { 0x0DC5, "IA32_LBR_INFO_5"},
1781 { 0x0DC6, "IA32_LBR_INFO_6"},
1782 { 0x0DC7, "IA32_LBR_INFO_7"},
1783 { 0x0DC8, "IA32_LBR_INFO_8"},
1784 { 0x0DC9, "IA32_LBR_INFO_9"},
1785 { 0x0DCA, "IA32_LBR_INFO_10"},
1786 { 0x0DCB, "IA32_LBR_INFO_11"},
1787 { 0x0DCC, "IA32_LBR_INFO_12"},
1788 { 0x0DCD, "IA32_LBR_INFO_13"},
1789 { 0x0DCE, "IA32_LBR_INFO_14"},
1790 { 0x0DCF, "IA32_LBR_INFO_15"},
1791 { 0x0DD0, "IA32_LBR_INFO_16"},
1792 { 0x0DD1, "IA32_LBR_INFO_17"},
1793 { 0x0DD2, "IA32_LBR_INFO_18"},
1794 { 0x0DD3, "IA32_LBR_INFO_19"},
1795 { 0x0DD4, "IA32_LBR_INFO_20"},
1796 { 0x0DD5, "IA32_LBR_INFO_21"},
1797 { 0x0DD6, "IA32_LBR_INFO_22"},
1798 { 0x0DD7, "IA32_LBR_INFO_23"},
1799 { 0x0DD8, "IA32_LBR_INFO_24"},
1800 { 0x0DD9, "IA32_LBR_INFO_25"},
1801 { 0x0DDA, "IA32_LBR_INFO_26"},
1802 { 0x0DDB, "IA32_LBR_INFO_27"},
1803 { 0x0DDC, "IA32_LBR_INFO_28"},
1804 { 0x0DDD, "IA32_LBR_INFO_29"},
1805 { 0x0DDE, "IA32_LBR_INFO_30"},
1806 { 0x0DDF, "IA32_LBR_INFO_31"},
1810 * Intel® 64 and IA-32 Architecture Software Developer’s Manual
1811 * Volume 4: Model-Specific Registers
1812 * Order Number: 335592-070US
1813 * page 2-265 ... 2-286
1814 * page 2-297 ... 2-308
1816 * The following two tables are for the Intel(R) Xeon(R) Processor Scalable
1817 * Family based on Skylake microarchitecture, 2nd generation Intel(R) Xeon(R)
1818 * Processor Scalable Family based on Cascade Lake product, and future Cooper
1819 * Lake product
1820 * family 6 model 85 (06_55h)
1822 static const msr_entry_t model565x_global_msrs[] = {
1823 { 0x004e, "MSR_PPIN_CTL" },
1824 { 0x004f, "MSR_PPIN" },
1825 { 0x00ce, "MSR_PLATFORM_INFO" },
1826 { 0x0198, "IA32_PERF_STATUS" },
1827 { 0x019c, "IA32_THERM_STATUS" },
1828 { 0x01a2, "MSR_TEMPERATURE_TARGET" },
1829 { 0x01ad, "MSR_TURBO_RATIO_LIMIT" },
1830 { 0x01ae, "MSR_TURBO_RATIO_LIMIT_CORES" },
1831 { 0x0284, "IA32_MC4_CTL2" },
1832 { 0x0285, "IA32_MC5_CTL2" },
1833 { 0x0286, "IA32_MC6_CTL2" },
1834 { 0x0287, "IA32_MC7_CTL2" },
1835 { 0x0288, "IA32_MC8_CTL2" },
1836 { 0x0289, "IA32_MC9_CTL2" },
1837 { 0x028a, "IA32_MC10_CTL2" },
1838 { 0x028b, "IA32_MC11_CTL2" },
1839 { 0x028c, "IA32_MC12_CTL2" },
1840 { 0x028d, "IA32_MC13_CTL2" },
1841 { 0x028e, "IA32_MC14_CTL2" },
1842 { 0x028f, "IA32_MC15_CTL2" },
1843 { 0x0290, "IA32_MC16_CTL2" },
1844 { 0x0291, "IA32_MC17_CTL2" },
1845 { 0x0292, "IA32_MC18_CTL2" },
1846 { 0x0293, "IA32_MC19_CTL2" },
1847 { 0x0300, "MSR_SGXOWNEREPOCH0" },
1848 { 0x0301, "MSR_SGXOWNEREPOCH1" },
1849 { 0x0410, "IA32_MC4_CTL" },
1850 { 0x0411, "IA32_MC4_STATUS" },
1851 { 0x0412, "IA32_MC4_ADDR" },
1852 { 0x0413, "IA32_MC4_MISC" },
1853 { 0x0414, "IA32_MC5_CTL" },
1854 { 0x0415, "IA32_MC5_STATUS" },
1855 { 0x0416, "IA32_MC5_ADDR" },
1856 { 0x0417, "IA32_MC5_MISC" },
1857 { 0x0418, "IA32_MC6_CTL" },
1858 { 0x0419, "IA32_MC6_STATUS" },
1859 { 0x041a, "IA32_MC6_ADDR" },
1860 { 0x041b, "IA32_MC6_MISC" },
1861 { 0x041c, "IA32_MC7_CTL" },
1862 { 0x041d, "IA32_MC7_STATUS" },
1863 { 0x041e, "IA32_MC7_ADDR" },
1864 { 0x041f, "IA32_MC7_MISC" },
1865 { 0x0420, "IA32_MC8_CTL" },
1866 { 0x0421, "IA32_MC8_STATUS" },
1867 { 0x0422, "IA32_MC8_ADDR" },
1868 { 0x0423, "IA32_MC8_MISC" },
1869 { 0x0424, "IA32_MC9_CTL" },
1870 { 0x0425, "IA32_MC9_STATUS" },
1871 { 0x0426, "IA32_MC9_ADDR" },
1872 { 0x0427, "IA32_MC9_MISC" },
1873 { 0x0428, "IA32_MC10_CTL" },
1874 { 0x0429, "IA32_MC10_STATUS" },
1875 { 0x042a, "IA32_MC10_ADDR" },
1876 { 0x042b, "IA32_MC10_MISC" },
1877 { 0x042c, "IA32_MC11_CTL" },
1878 { 0x042d, "IA32_MC11_STATUS" },
1879 { 0x042e, "IA32_MC11_ADDR" },
1880 { 0x042f, "IA32_MC11_MISC" },
1881 { 0x0430, "IA32_MC12_CTL" },
1882 { 0x0431, "IA32_MC12_STATUS" },
1883 { 0x0432, "IA32_MC12_ADDR" },
1884 { 0x0433, "IA32_MC12_MISC" },
1885 { 0x0434, "IA32_MC13_CTL" },
1886 { 0x0435, "IA32_MC13_STATUS" },
1887 { 0x0436, "IA32_MC13_ADDR" },
1888 { 0x0437, "IA32_MC13_MISC" },
1889 { 0x0438, "IA32_MC14_CTL" },
1890 { 0x0439, "IA32_MC14_STATUS" },
1891 { 0x043a, "IA32_MC14_ADDR" },
1892 { 0x043b, "IA32_MC14_MISC" },
1893 { 0x043c, "IA32_MC15_CTL" },
1894 { 0x043d, "IA32_MC15_STATUS" },
1895 { 0x043e, "IA32_MC15_ADDR" },
1896 { 0x043f, "IA32_MC15_MISC" },
1897 { 0x0440, "IA32_MC16_CTL" },
1898 { 0x0441, "IA32_MC16_STATUS" },
1899 { 0x0442, "IA32_MC16_ADDR" },
1900 { 0x0443, "IA32_MC16_MISC" },
1901 { 0x0444, "IA32_MC17_CTL" },
1902 { 0x0445, "IA32_MC17_STATUS" },
1903 { 0x0446, "IA32_MC17_ADDR" },
1904 { 0x0447, "IA32_MC17_MISC" },
1905 { 0x0448, "IA32_MC18_CTL" },
1906 { 0x0449, "IA32_MC18_STATUS" },
1907 { 0x044a, "IA32_MC18_ADDR" },
1908 { 0x044b, "IA32_MC18_MISC" },
1909 { 0x044c, "IA32_MC19_CTL" },
1910 { 0x044b, "IA32_MC19_STATUS" },
1911 { 0x044e, "IA32_MC19_ADDR" },
1912 { 0x044f, "IA32_MC19_MISC" },
1913 { 0x0606, "MSR_RAPL_POWER_UNIT" },
1914 { 0x0618, "MSR_DRAM_POWER_LIMIT" },
1915 { 0x0619, "MSR_DRAM_ENERGY_STATUS" },
1916 { 0x061b, "MSR_DRAM_PERF_STATUS" },
1917 { 0x061c, "MSR_DRAM_POWER_INFO" },
1918 { 0x0620, "MSR_UNCORE_RATIO_LIMIT" },
1919 { 0x0639, "MSR_PP0_ENERGY_STATUS" },
1920 { 0x0638, "MSR_PP0_POWER_LIMIT" },
1921 { 0x064d, "MSR_PLATFORM_ENERGY_COUNTER" },
1922 { 0x064f, "MSR_CORE_PERF_LIMIT_REASONS" },
1923 { 0x0652, "MSR_PKG_HDC_CONFIG" },
1924 { 0x0655, "MSR_PKG_HDC_SHALLOW_RESIDENCY" },
1925 { 0x0656, "MSR_PKG_HDC_DEEP_RESIDENCY" },
1926 { 0x0658, "MSR_WEIGHTED_CORE_C0" },
1927 { 0x0659, "MSR_ANY_CORE_C0" },
1928 { 0x065a, "MSR_ANY_GFXE_C0" },
1929 { 0x065b, "MSR_CORE_GFXE_OVERLAP_C0" },
1930 { 0x065c, "MSR_PLATFORM_POWER_LIMIT" },
1931 { 0x06b0, "MSR_GRAPHICS_PERF_LIMIT_REASONS" },
1932 { 0x06b1, "MSR_RING_PERF_LIMIT_REASONS" },
1933 { 0x0770, "IA32_PM_ENABLE" },
1934 { 0x0db0, "IA32_PKG_HDC_CTL" },
1935 { 0x0c90, "IA32_L3_QOS_MASK_0" },
1936 { 0x0c91, "IA32_L3_QOS_MASK_1" },
1937 { 0x0c92, "IA32_L3_QOS_MASK_2" },
1938 { 0x0c93, "IA32_L3_QOS_MASK_3" },
1939 { 0x0c94, "IA32_L3_QOS_MASK_4" },
1940 { 0x0c95, "IA32_L3_QOS_MASK_5" },
1941 { 0x0c96, "IA32_L3_QOS_MASK_6" },
1942 { 0x0c97, "IA32_L3_QOS_MASK_7" },
1943 { 0x0c98, "IA32_L3_QOS_MASK_8" },
1944 { 0x0c99, "IA32_L3_QOS_MASK_9" },
1945 { 0x0c9a, "IA32_L3_QOS_MASK_10" },
1946 { 0x0c9b, "IA32_L3_QOS_MASK_11" },
1947 { 0x0c9c, "IA32_L3_QOS_MASK_12" },
1948 { 0x0c9d, "IA32_L3_QOS_MASK_13" },
1949 { 0x0c9e, "IA32_L3_QOS_MASK_14" },
1950 { 0x0c9f, "IA32_L3_QOS_MASK_15" },
1953 static const msr_entry_t model565x_per_core_msrs[] = {
1954 { 0x0000, "IA32_P5_MC_ADDR" },
1955 { 0x0001, "IA32_P5_MC_TYPE" },
1956 { 0x0006, "IA32_MONITOR_FILTER_SIZE" },
1957 { 0x0010, "IA32_TIME_STAMP_COUNTER" },
1958 { 0x0017, "IA32_PLATFORM_ID" },
1959 { 0x001b, "IA32_APIC_BASE" },
1960 { 0x0034, "MSR_SMI_COUNT" },
1961 { 0x003a, "IA32_FEATURE_CONTROL" },
1962 { 0x008b, "IA32_BIOS_SIGN_ID" },
1963 { 0x00c1, "IA32_PMC0" },
1964 { 0x00c2, "IA32_PMC1" },
1965 { 0x00c3, "IA32_PMC2" },
1966 { 0x00c4, "IA32_PMC3" },
1967 { 0x00e2, "MSR_PKG_CST_CONFIG_CONTROL" },
1968 { 0x00e4, "MSR_PMG_IO_CAPTURE_BASE" },
1969 { 0x00e7, "IA32_MPERF" },
1970 { 0x00e8, "IA32_APERF" },
1971 { 0x00fe, "IA32_MTRRCAP" },
1972 { 0x013c, "MSR_FEATURE_CONFIG" },
1973 { 0x0174, "IA32_SYSENTER_CS" },
1974 { 0x0175, "IA32_SYSENTER_ESP" },
1975 { 0x0176, "IA32_SYSENTER_EIP" },
1976 { 0x0179, "IA32_MCG_CAP" },
1977 { 0x017a, "IA32_MCG_STATUS" },
1978 { 0x017d, "MSR_SMM_MCA_CAP" },
1979 { 0x0186, "IA32_PERFEVTSEL0" },
1980 { 0x0187, "IA32_PERFEVTSEL1" },
1981 { 0x0188, "IA32_PERFEVTSEL2" },
1982 { 0x0189, "IA32_PERFEVTSEL3" },
1983 { 0x019b, "IA32_THERM_INTERRUPT" },
1984 { 0x0199, "IA32_PERF_CTL" },
1985 { 0x019a, "IA32_CLOCK_MODULATION" },
1986 { 0x01a0, "IA32_MISC_ENABLE" },
1987 { 0x01a4, "IA32_MISC_FEATURE_CONTROL" },
1988 { 0x01a6, "MSR_OFFCORE_RSP_0" },
1989 { 0x01a7, "MSR_OFFCORE_RSP_1" },
1990 { 0x01c8, "MSR_LBR_SELECT" },
1991 { 0x01c9, "MSR_LASTBRANCH_TOS" },
1992 { 0x01d9, "IA32_DEBUGCTL" },
1993 { 0x01dd, "MSR_LER_FROM_LIP" },
1994 { 0x01de, "MSR_LER_TO_LIP" },
1995 { 0x01f2, "IA32_SMRR_PHYSBASE" },
1996 { 0x01f3, "IA32_SMRR_PHYSMASK" },
1997 { 0x01fc, "MSR_POWER_CTL" },
1998 { 0x0200, "IA32_MTRR_PHYSBASE0" },
1999 { 0x0201, "IA32_MTRR_PHYSBASE0" },
2000 { 0x0202, "IA32_MTRR_PHYSBASE1" },
2001 { 0x0203, "IA32_MTRR_PHYSBASE1" },
2002 { 0x0204, "IA32_MTRR_PHYSBASE2" },
2003 { 0x0205, "IA32_MTRR_PHYSBASE2" },
2004 { 0x0206, "IA32_MTRR_PHYSBASE3" },
2005 { 0x0207, "IA32_MTRR_PHYSBASE3" },
2006 { 0x0208, "IA32_MTRR_PHYSBASE4" },
2007 { 0x0209, "IA32_MTRR_PHYSBASE4" },
2008 { 0x020a, "IA32_MTRR_PHYSBASE5" },
2009 { 0x020b, "IA32_MTRR_PHYSBASE5" },
2010 { 0x020c, "IA32_MTRR_PHYSBASE6" },
2011 { 0x020d, "IA32_MTRR_PHYSBASE6" },
2012 { 0x020e, "IA32_MTRR_PHYSBASE7" },
2013 { 0x020f, "IA32_MTRR_PHYSBASE7" },
2014 { 0x0210, "IA32_MTRR_PHYSBASE8" },
2015 { 0x0211, "IA32_MTRR_PHYSBASE8" },
2016 { 0x0212, "IA32_MTRR_PHYSBASE9" },
2017 { 0x0213, "IA32_MTRR_PHYSBASE9" },
2018 { 0x0250, "IA32_MTRR_FIX64K_00000" },
2019 { 0x0258, "IA32_MTRR_FIX16K_80000" },
2020 { 0x0259, "IA32_MTRR_FIX16K_A0000" },
2021 { 0x0268, "IA32_MTRR_FIX4K_C0000" },
2022 { 0x0269, "IA32_MTRR_FIX4K_C8000" },
2023 { 0x026a, "IA32_MTRR_FIX4K_D0000" },
2024 { 0x026b, "IA32_MTRR_FIX4K_D8000" },
2025 { 0x026c, "IA32_MTRR_FIX4K_E0000" },
2026 { 0x026d, "IA32_MTRR_FIX4K_E8000" },
2027 { 0x026e, "IA32_MTRR_FIX4K_F0000" },
2028 { 0x026f, "IA32_MTRR_FIX4K_F8000" },
2029 { 0x0277, "IA32_PAT" },
2030 { 0x0280, "IA32_MC0_CTL2" },
2031 { 0x0281, "IA32_MC1_CTL2" },
2032 { 0x0282, "IA32_MC2_CTL2" },
2033 { 0x0283, "IA32_MC3_CTL2" },
2034 { 0x02ff, "IA32_MTRR_DEF_TYPE" },
2035 { 0x0309, "IA32_FIXED_CTR0" },
2036 { 0x030a, "IA32_FIXED_CTR1" },
2037 { 0x030b, "IA32_FIXED_CTR2" },
2038 { 0x0345, "IA32_PERF_CAPABILITIES" },
2039 { 0x038d, "IA32_FIXED_CTR_CTRL" },
2040 { 0x038e, "IA32_PERF_GLOBAL_STATUS" },
2041 { 0x038f, "IA32_PERF_GLOBAL_CTRL" },
2042 { 0x0390, "IA32_PERF_GLOBAL_STATUS_RESET" },
2043 { 0x0391, "IA32_PERF_GLOBAL_STATUS_SET" },
2044 { 0x0392, "IA32_PERF_GLOBAL_INUSE" },
2045 { 0x03f1, "MSR_PEBS_ENABLE" },
2046 { 0x03f6, "MSR_PEBS_LD_LAT" },
2047 { 0x03f7, "MSR_PEBS_FRONTEND" },
2048 { 0x03fc, "MSR_CORE_C3_RESIDENCY" },
2049 { 0x03fd, "MSR_CORE_C6_RESIDENCY" },
2050 { 0x03fe, "MSR_CORE_C7_RESIDENCY" },
2051 { 0x0400, "IA32_MC0_CTL" },
2052 { 0x0401, "IA32_MC0_STATUS" },
2053 { 0x0402, "IA32_MC0_ADDR" },
2054 { 0x0403, "IA32_MC0_MISC" },
2055 { 0x0404, "IA32_MC1_CTL" },
2056 { 0x0405, "IA32_MC1_STATUS" },
2057 { 0x0406, "IA32_MC1_ADDR" },
2058 { 0x0407, "IA32_MC1_MISC" },
2059 { 0x0408, "IA32_MC2_CTL" },
2060 { 0x0409, "IA32_MC2_STATUS" },
2061 { 0x040a, "IA32_MC2_ADDR" },
2062 { 0x040b, "IA32_MC2_MISC" },
2063 { 0x040c, "IA32_MC3_CTL" },
2064 { 0x040d, "IA32_MC3_STATUS" },
2065 { 0x040e, "IA32_MC3_ADDR" },
2066 { 0x040f, "IA32_MC3_MISC" },
2067 { 0x0480, "IA32_VMX_BASIC" },
2068 { 0x0481, "IA32_VMX_PINBASED_CTLS" },
2069 { 0x0482, "IA32_VMX_PROCBASED_CTLS" },
2070 { 0x0483, "IA32_VMX_EXIT_CTLS" },
2071 { 0x0484, "IA32_VMX_ENTRY_CTLS" },
2072 { 0x0485, "IA32_VMX_MISC" },
2073 { 0x0486, "IA32_VMX_CR0_FIXED0" },
2074 { 0x0487, "IA32_VMX_CR0_FIXED1" },
2075 { 0x0488, "IA32_VMX_CR4_FIXED0" },
2076 { 0x0489, "IA32_VMX_CR4_FIXED1" },
2077 { 0x048a, "IA32_VMX_VMCS_ENUM" },
2078 { 0x048b, "IA32_VMX_PROCBASED_CTLS2" },
2079 { 0x048c, "IA32_VMX_EPT_VPID_ENUM" },
2080 { 0x048d, "IA32_VMX_TRUE_PINBASED_CTLS" },
2081 { 0x048e, "IA32_VMX_TRUE_PROCBASED_CTLS" },
2082 { 0x048f, "IA32_VMX_TRUE_EXIT_CTLS" },
2083 { 0x0490, "IA32_VMX_TRUE_ENTRY_CTLS" },
2084 { 0x04c1, "IA32_A_PMC0" },
2085 { 0x04c2, "IA32_A_PMC1" },
2086 { 0x04c3, "IA32_A_PMC2" },
2087 { 0x04c4, "IA32_A_PMC3" },
2088 { 0x04c5, "IA32_A_PMC4" },
2089 { 0x04c6, "IA32_A_PMC5" },
2090 { 0x04c7, "IA32_A_PMC6" },
2091 { 0x04c8, "IA32_A_PMC7" },
2092 { 0x0500, "IA32_SGX_SVN_STATUS" },
2093 { 0x0560, "IA32_RTIT_OUTPUT_BASE" },
2094 { 0x0561, "IA32_RTIT_OUTPUT_MASK_PTRS" },
2095 { 0x0570, "IA32_RTIT_CTL" },
2096 { 0x0571, "IA32_RTIT_STATUS" },
2097 { 0x0572, "IA32_RTIT_CR3_MATCH" },
2098 { 0x0580, "IA32_RTIT_ADDR0_A" },
2099 { 0x0581, "IA32_RTIT_ADDR0_B" },
2100 { 0x0582, "IA32_RTIT_ADDR1_A" },
2101 { 0x0583, "IA32_RTIT_ADDR1_B" },
2102 { 0x0600, "IA32_DS_AREA" },
2103 { 0x064e, "MSR_PPERF" },
2104 { 0x0653, "MSR_CORE_HDC_RESIDENCY" },
2105 { 0x0690, "MSR_LASTBRANCH_16_FROM_IP" },
2106 { 0x0691, "MSR_LASTBRANCH_17_FROM_IP" },
2107 { 0x0692, "MSR_LASTBRANCH_18_FROM_IP" },
2108 { 0x0693, "MSR_LASTBRANCH_19_FROM_IP" },
2109 { 0x0694, "MSR_LASTBRANCH_20_FROM_IP" },
2110 { 0x0695, "MSR_LASTBRANCH_21_FROM_IP" },
2111 { 0x0696, "MSR_LASTBRANCH_22_FROM_IP" },
2112 { 0x0697, "MSR_LASTBRANCH_23_FROM_IP" },
2113 { 0x0698, "MSR_LASTBRANCH_24_FROM_IP" },
2114 { 0x0699, "MSR_LASTBRANCH_25_FROM_IP" },
2115 { 0x069a, "MSR_LASTBRANCH_26_FROM_IP" },
2116 { 0x069b, "MSR_LASTBRANCH_27_FROM_IP" },
2117 { 0x069c, "MSR_LASTBRANCH_28_FROM_IP" },
2118 { 0x069d, "MSR_LASTBRANCH_29_FROM_IP" },
2119 { 0x069e, "MSR_LASTBRANCH_30_FROM_IP" },
2120 { 0x069f, "MSR_LASTBRANCH_31_FROM_IP" },
2121 { 0x06d0, "MSR_LASTBRANCH_16_TO_IP" },
2122 { 0x06d1, "MSR_LASTBRANCH_17_TO_IP" },
2123 { 0x06d2, "MSR_LASTBRANCH_18_TO_IP" },
2124 { 0x06d3, "MSR_LASTBRANCH_19_TO_IP" },
2125 { 0x06d4, "MSR_LASTBRANCH_20_TO_IP" },
2126 { 0x06d5, "MSR_LASTBRANCH_21_TO_IP" },
2127 { 0x06d6, "MSR_LASTBRANCH_22_TO_IP" },
2128 { 0x06d7, "MSR_LASTBRANCH_23_TO_IP" },
2129 { 0x06d8, "MSR_LASTBRANCH_24_TO_IP" },
2130 { 0x06d9, "MSR_LASTBRANCH_25_TO_IP" },
2131 { 0x06da, "MSR_LASTBRANCH_26_TO_IP" },
2132 { 0x06db, "MSR_LASTBRANCH_27_TO_IP" },
2133 { 0x06dc, "MSR_LASTBRANCH_28_TO_IP" },
2134 { 0x06dd, "MSR_LASTBRANCH_29_TO_IP" },
2135 { 0x06de, "MSR_LASTBRANCH_30_TO_IP" },
2136 { 0x06df, "MSR_LASTBRANCH_31_TO_IP" },
2137 { 0x06e0, "IA32_TSC_DEADLINE" },
2138 { 0x0771, "IA32_HWP_CAPABILITIES" },
2139 { 0x0773, "IA32_HWP_INTERRUPT" },
2140 { 0x0774, "IA32_HWP_REQUEST" },
2141 { 0x0777, "IA32_HWP_STATUS" },
2142 { 0x0c8d, "IA32_QM_EVTSEL" },
2143 { 0x0c8f, "IA32_PQR_ASSOC" },
2144 { 0x0d90, "IA32_BNDCFGS" },
2145 { 0x0da0, "IA32_XSS" },
2146 { 0x0db1, "IA32_PM_CTL1" },
2147 { 0x0db2, "IA32_THREAD_STALL" },
2148 { 0x0dc0, "MSR_LBR_INFO_0" },
2149 { 0x0dc1, "MSR_LBR_INFO_1" },
2150 { 0x0dc2, "MSR_LBR_INFO_2" },
2151 { 0x0dc3, "MSR_LBR_INFO_3" },
2152 { 0x0dc4, "MSR_LBR_INFO_4" },
2153 { 0x0dc5, "MSR_LBR_INFO_5" },
2154 { 0x0dc6, "MSR_LBR_INFO_6" },
2155 { 0x0dc7, "MSR_LBR_INFO_7" },
2156 { 0x0dc8, "MSR_LBR_INFO_8" },
2157 { 0x0dc9, "MSR_LBR_INFO_9" },
2158 { 0x0dca, "MSR_LBR_INFO_10" },
2159 { 0x0dcb, "MSR_LBR_INFO_11" },
2160 { 0x0dcc, "MSR_LBR_INFO_12" },
2161 { 0x0dcd, "MSR_LBR_INFO_13" },
2162 { 0x0dce, "MSR_LBR_INFO_14" },
2163 { 0x0dcf, "MSR_LBR_INFO_15" },
2164 { 0x0dd0, "MSR_LBR_INFO_16" },
2165 { 0x0dd1, "MSR_LBR_INFO_17" },
2166 { 0x0dd2, "MSR_LBR_INFO_18" },
2167 { 0x0dd3, "MSR_LBR_INFO_19" },
2168 { 0x0dd4, "MSR_LBR_INFO_20" },
2169 { 0x0dd5, "MSR_LBR_INFO_21" },
2170 { 0x0dd6, "MSR_LBR_INFO_22" },
2171 { 0x0dd7, "MSR_LBR_INFO_23" },
2172 { 0x0dd8, "MSR_LBR_INFO_24" },
2173 { 0x0dd9, "MSR_LBR_INFO_25" },
2174 { 0x0ddA, "MSR_LBR_INFO_26" },
2175 { 0x0ddB, "MSR_LBR_INFO_27" },
2176 { 0x0ddc, "MSR_LBR_INFO_28" },
2177 { 0x0ddd, "MSR_LBR_INFO_29" },
2178 { 0x0dde, "MSR_LBR_INFO_30" },
2179 { 0x0ddf, "MSR_LBR_INFO_31" },
2182 typedef struct {
2183 unsigned int model;
2184 const msr_entry_t *global_msrs;
2185 unsigned int num_global_msrs;
2186 const msr_entry_t *per_core_msrs;
2187 unsigned int num_per_core_msrs;
2188 } cpu_t;
2190 cpu_t cpulist[] = {
2191 { 0x00670, model67x_global_msrs, ARRAY_SIZE(model67x_global_msrs), NULL, 0 },
2192 { 0x006b0, model6bx_global_msrs, ARRAY_SIZE(model6bx_global_msrs), NULL, 0 },
2193 { 0x006e0, model6ex_global_msrs, ARRAY_SIZE(model6ex_global_msrs), model6ex_per_core_msrs, ARRAY_SIZE(model6ex_per_core_msrs) },
2194 { 0x006f0, model6fx_global_msrs, ARRAY_SIZE(model6fx_global_msrs), model6fx_per_core_msrs, ARRAY_SIZE(model6fx_per_core_msrs) },
2195 { 0x00f20, modelf2x_global_msrs, ARRAY_SIZE(modelf2x_global_msrs), modelf2x_per_core_msrs, ARRAY_SIZE(modelf2x_per_core_msrs) },
2196 { 0x00f40, modelf4x_global_msrs, ARRAY_SIZE(modelf4x_global_msrs), modelf4x_per_core_msrs, ARRAY_SIZE(modelf4x_per_core_msrs) },
2197 { 0x00f60, modelf6x_global_msrs, ARRAY_SIZE(modelf6x_global_msrs), modelf6x_per_core_msrs, ARRAY_SIZE(modelf6x_per_core_msrs) },
2198 { 0x106c0, model6_atom_global_msrs, ARRAY_SIZE(model6_atom_global_msrs), model6_atom_per_core_msrs, ARRAY_SIZE(model6_atom_per_core_msrs) },
2199 { 0x20650, model20650_global_msrs, ARRAY_SIZE(model20650_global_msrs), model20650_per_core_msrs, ARRAY_SIZE(model20650_per_core_msrs) },
2200 { 0x906e0, model96ex_global_msrs, ARRAY_SIZE(model96ex_global_msrs), model96ex_per_core_msrs, ARRAY_SIZE(model96ex_per_core_msrs) },
2201 { 0x50650, model565x_global_msrs, ARRAY_SIZE(model565x_global_msrs), model565x_per_core_msrs, ARRAY_SIZE(model565x_per_core_msrs) },
2203 { CPUID_BAYTRAIL, silvermont_global_msrs, ARRAY_SIZE(silvermont_global_msrs), silvermont_per_core_msrs, ARRAY_SIZE(silvermont_per_core_msrs) }, /* Baytrail */
2207 cpu_t *cpu = NULL;
2209 /* Get CPU family and model, not the stepping
2210 * (TODO: extended family/model)
2212 id = cpuid(1) & 0xfffff0;
2213 for (i = 0; i < ARRAY_SIZE(cpulist); i++) {
2214 if(cpulist[i].model == id) {
2215 cpu = &cpulist[i];
2216 break;
2220 if (!cpu) {
2221 printf("Error: Dumping MSRs on this CPU (0x%06x) is not (yet) supported.\n", id);
2222 return -1;
2225 #ifndef __DARWIN__
2226 fd_msr = open("/dev/cpu/0/msr", O_RDWR);
2227 if (fd_msr < 0) {
2228 perror("Error while opening /dev/cpu/0/msr");
2229 printf("Did you run 'modprobe msr'?\n");
2230 return -1;
2232 #endif
2234 printf("\n===================== SHARED MSRs (All Cores) =====================\n");
2236 for (i = 0; i < cpu->num_global_msrs; i++) {
2237 msr = rdmsr(cpu->global_msrs[i].number);
2238 printf(" MSR 0x%08X = 0x%08X:0x%08X (%s)\n",
2239 cpu->global_msrs[i].number, msr.hi, msr.lo,
2240 cpu->global_msrs[i].name);
2243 close(fd_msr);
2245 for (core = 0; core < core_num; core++) {
2246 #ifndef __DARWIN__
2247 char msrfilename[64];
2248 memset(msrfilename, 0, 64);
2249 sprintf(msrfilename, "/dev/cpu/%u/msr", core);
2251 fd_msr = open(msrfilename, O_RDWR);
2253 /* If the file is not there, we're probably through. No error,
2254 * since we successfully opened /dev/cpu/0/msr before.
2256 if (fd_msr < 0)
2257 break;
2258 #endif
2259 if (cpu->num_per_core_msrs)
2260 printf("\n====================== UNIQUE MSRs (core %u) ======================\n", core);
2262 for (i = 0; i < cpu->num_per_core_msrs; i++) {
2263 msr = rdmsr(cpu->per_core_msrs[i].number);
2264 printf(" MSR 0x%08X = 0x%08X:0x%08X (%s)\n",
2265 cpu->per_core_msrs[i].number, msr.hi, msr.lo,
2266 cpu->per_core_msrs[i].name);
2268 #ifndef __DARWIN__
2269 close(fd_msr);
2270 #endif
2273 #ifndef __DARWIN__
2274 if (msr_readerror)
2275 printf("\n(*) Some MSRs could not be read. The marked values are unreliable.\n");
2276 #endif
2277 return 0;