@@ -340,9 +340,16 @@ static void recalculate_misc(struct cpu_policy *p)
p->extd.raw[0x1e] = EMPTY_LEAF; /* TopoExt APIC ID/Core/Node */
p->extd.raw[0x1f] = EMPTY_LEAF; /* SEV */
p->extd.raw[0x20] = EMPTY_LEAF; /* Platform QoS */
- break;
- }
-}
+
+ /* These are not implemented yet, hide from CPUID.
+ * When they become implemented, make them available when full vpmu is on */
+ p->extd.irperf = 0;
+ p->extd.perfctrextnb = 0;
+ p->extd.perfctrextl2i = 0;
+
+ break;
+ }
+ }
void calculate_raw_cpu_policy(void)
{
@@ -391,6 +398,7 @@ static void __init calculate_host_policy(void)
if ( vpmu_mode == XENPMU_MODE_OFF ) {
p->basic.raw[0xa] = EMPTY_LEAF;
p->basic.pdcm = 0;
+ p->extd.perfctrextcore = 0;
}
if ( p->extd.svm )
@@ -1905,6 +1905,7 @@ static int cf_check svm_msr_read_intercept(
case MSR_AMD_FAM15H_EVNTSEL3:
case MSR_AMD_FAM15H_EVNTSEL4:
case MSR_AMD_FAM15H_EVNTSEL5:
+ /* TODO: IRPerfCnt, L2I_* and NB_* support */
if ( vpmu_do_rdmsr(msr, msr_content) )
goto gpf;
break;
@@ -1156,6 +1156,7 @@ static int cf_check write_msr(
if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
{
vpmu_msr = true;
+ /* fall-through */
case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
if ( vpmu_msr || (boot_cpu_data.x86_vendor &
@@ -166,7 +166,10 @@ XEN_CPUFEATURE(FMA4, 3*32+16) /*A 4 operands MAC instructions */
XEN_CPUFEATURE(NODEID_MSR, 3*32+19) /* NodeId MSR */
XEN_CPUFEATURE(TBM, 3*32+21) /*A trailing bit manipulations */
XEN_CPUFEATURE(TOPOEXT, 3*32+22) /* topology extensions CPUID leafs */
+XEN_CPUFEATURE(PERFCTREXTCORE, 3*32+23) /*A! Extended core performance event-select registers */
+XEN_CPUFEATURE(PERFCTREXTNB, 3*32+24) /* Extended Northbridge performance counters */
XEN_CPUFEATURE(DBEXT, 3*32+26) /*A data breakpoint extension */
+XEN_CPUFEATURE(PERFCTREXTL2I, 3*32+28) /* Extended L2 cache performance counters */
XEN_CPUFEATURE(MONITORX, 3*32+29) /* MONITOR extension (MONITORX/MWAITX) */
/* Intel-defined CPU features, CPUID level 0x0000000D:1.eax, word 4 */
@@ -238,6 +241,7 @@ XEN_CPUFEATURE(EFRO, 7*32+10) /* APERF/MPERF Read Only interface */
/* AMD-defined CPU features, CPUID level 0x80000008.ebx, word 8 */
XEN_CPUFEATURE(CLZERO, 8*32+ 0) /*A CLZERO instruction */
+XEN_CPUFEATURE(IRPERF, 8*32+ 1) /* Instruction Retired Performance Counter */
XEN_CPUFEATURE(RSTR_FP_ERR_PTRS, 8*32+ 2) /*A (F)X{SAVE,RSTOR} always saves/restores FPU Error pointers */
XEN_CPUFEATURE(WBNOINVD, 8*32+ 9) /* WBNOINVD instruction */
XEN_CPUFEATURE(IBPB, 8*32+12) /*A IBPB support only (no IBRS, used by AMD) */