+#define MSR_PERF_FIXED_CTR(n) (0x309 + (n))
+#define MSR_PERF_INST_RETIRED MSR_PERF_FIXED_CTR(0)
+#define MSR_PERF_CPU_CLK_UNHALTED_CORE MSR_PERF_FIXED_CTR(1)
+#define MSR_PERF_CPU_CLK_UNHALTED_REF MSR_PERF_FIXED_CTR(2)
+
+#define MSR_PERF_FIXED_CTR_CTRL (0x38d)
+typedef union {
+ struct {
+ uint64_t FIXED_CTR0_enable :2;
+ uint64_t reserved0 :1;
+ uint64_t FIXED_CTR0_pmi :1;
+ uint64_t FIXED_CTR1_enable :2;
+ uint64_t reserved1 :1;
+ uint64_t FIXED_CTR1_pmi :1;
+ uint64_t FIXED_CTR2_enable :2;
+ uint64_t reserved2 :1;
+ uint64_t FIXED_CTR2_pmi :1;
+ } fld;
+ uint64_t u64;
+} pmc_fixed_ctr_ctrl_t;
+
+#define MSR_PERF_GLOBAL_STATUS (0x38e)
+typedef union {
+ struct {
+ uint64_t PMC0_overflow : 1;
+ uint64_t PMC1_overflow : 1;
+ uint64_t reserved1 : 30;
+ uint64_t FIXED_CTR0_overflow : 1;
+ uint64_t FIXED_CTR1_overflow : 1;
+ uint64_t FIXED_CTR2_overflow : 1;
+ uint64_t reserved2 : 27;
+ uint64_t ovf_buffer : 1;
+ uint64_t cond_changed : 1;
+ } fld;
+ uint64_t u64;
+} pmc_global_status_t;
+
+#define MSR_PERF_GLOBAL_CTRL (0x38f)
+typedef union {
+ struct {
+ uint64_t PMC0_enable : 1;
+ uint64_t PMC1_enable : 1;
+ uint64_t reserved1 : 30;
+ uint64_t FIXED_CTR0_enable : 1;
+ uint64_t FIXED_CTR1_enable : 1;
+ uint64_t FIXED_CTR2_enable : 1;
+ } fld;
+ uint64_t u64;
+} pmc_global_ctrl_t;
+
+#define MSR_PERF_GLOBAL_OVF_CTRL (0x390)
+typedef union {
+ struct {
+ uint64_t PMC0_clr_overflow : 1;
+ uint64_t PMC1_clr_overflow : 1;
+ uint64_t reserved1 : 30;
+ uint64_t FIXED_CTR0_clr_overflow : 1;
+ uint64_t FIXED_CTR1_clr_overflow : 1;
+ uint64_t FIXED_CTR2_clr_overflow : 1;
+ uint64_t reserved2 : 27;
+ uint64_t clr_ovf_buffer : 1;
+ uint64_t clr_cond_changed : 1;
+ } fld;
+ uint64_t u64;
+} pmc_global_ovf_ctrl;
+