@@ -3360,8 +3360,8 @@ static int cf_check vmx_msr_read_intercept(
MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
/* Perhaps vpmu will change some bits. */
/* FALLTHROUGH */
- case MSR_P6_PERFCTR(0)...MSR_P6_PERFCTR(7):
- case MSR_P6_EVNTSEL(0)...MSR_P6_EVNTSEL(3):
+ case MSR_P6_PERFCTR(0)...MSR_P6_PERFCTR_LAST:
+ case MSR_P6_EVNTSEL(0)...MSR_P6_EVNTSEL_LAST:
case MSR_CORE_PERF_FIXED_CTR0...MSR_CORE_PERF_FIXED_CTR2:
case MSR_CORE_PERF_FIXED_CTR_CTRL...MSR_CORE_PERF_GLOBAL_OVF_CTRL:
case MSR_IA32_PEBS_ENABLE:
@@ -3678,8 +3678,8 @@ static int cf_check vmx_msr_write_intercept(
goto gp_fault;
break;
- case MSR_P6_PERFCTR(0)...MSR_P6_PERFCTR(7):
- case MSR_P6_EVNTSEL(0)...MSR_P6_EVNTSEL(7):
+ case MSR_P6_PERFCTR(0)...MSR_P6_PERFCTR_LAST:
+ case MSR_P6_EVNTSEL(0)...MSR_P6_EVNTSEL_LAST:
case MSR_CORE_PERF_FIXED_CTR0...MSR_CORE_PERF_FIXED_CTR2:
case MSR_CORE_PERF_FIXED_CTR_CTRL...MSR_CORE_PERF_GLOBAL_OVF_CTRL:
case MSR_IA32_PEBS_ENABLE:
@@ -521,8 +521,11 @@
#define MSR_IA32_PSR_MBA_MASK(n) (0x00000d50 + (n))
/* Intel Model 6 */
+#define MSR_P6_PERFCTR_MAX 8
#define MSR_P6_PERFCTR(n) (0x000000c1 + (n))
#define MSR_P6_EVNTSEL(n) (0x00000186 + (n))
+#define MSR_P6_PERFCTR_LAST MSR_P6_PERFCTR(MSR_P6_PERFCTR_MAX-1)
+#define MSR_P6_EVNTSEL_LAST MSR_P6_EVNTSEL(MSR_P6_PERFCTR_MAX-1)
/* P4/Xeon+ specific */
#define MSR_IA32_MCG_EAX 0x00000180
@@ -965,8 +965,8 @@ static int cf_check read_msr(
*val = 0;
return X86EMUL_OKAY;
- case MSR_P6_PERFCTR(0) ... MSR_P6_PERFCTR(7):
- case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL(3):
+ case MSR_P6_PERFCTR(0) ... MSR_P6_PERFCTR_LAST:
+ case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL_LAST:
case MSR_CORE_PERF_FIXED_CTR0 ... MSR_CORE_PERF_FIXED_CTR2:
case MSR_CORE_PERF_FIXED_CTR_CTRL ... MSR_CORE_PERF_GLOBAL_OVF_CTRL:
if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
@@ -1145,8 +1145,8 @@ static int cf_check write_msr(
return X86EMUL_OKAY;
break;
- case MSR_P6_PERFCTR(0) ... MSR_P6_PERFCTR(7):
- case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL(3):
+ case MSR_P6_PERFCTR(0) ... MSR_P6_PERFCTR_LAST:
+ case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL_LAST:
case MSR_CORE_PERF_FIXED_CTR0 ... MSR_CORE_PERF_FIXED_CTR2:
case MSR_CORE_PERF_FIXED_CTR_CTRL ... MSR_CORE_PERF_GLOBAL_OVF_CTRL:
if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )