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