+ typedef struct {
+ unsigned int model;
+ const msr_entry_t *global_msrs;
+ unsigned int num_global_msrs;
+ const msr_entry_t *per_core_msrs;
+ unsigned int num_per_core_msrs;
+ } cpu_t;
+
+ cpu_t cpulist[] = {
+ { 0x006e0, model6ex_global_msrs, ARRAY_SIZE(model6ex_global_msrs), model6ex_per_core_msrs, ARRAY_SIZE(model6ex_per_core_msrs) },
+ { 0x006f0, model6ex_global_msrs, ARRAY_SIZE(model6ex_global_msrs), model6ex_per_core_msrs, ARRAY_SIZE(model6ex_per_core_msrs) }, // for now
+ };
+
+ cpu_t *cpu = NULL;
+
+ /* Get CPU family and model, not the stepping
+ * (TODO: extended family/model)
+ */
+ id = cpuid(1) & 0xff0;
+ for (i = 0; i < ARRAY_SIZE(cpulist); i++) {
+ if(cpulist[i].model == id) {
+ cpu = &cpulist[i];
+ break;
+ }
+ }
+
+ if (!cpu) {
+ printf("Error: Dumping MSRs on this CPU (0x%06x) is not (yet) supported.\n", id);
+ return -1;
+ }
+