if ( vpmu_mode == XENPMU_MODE_OFF )
return 0;
+ if ( v->domain->arch.cpuid->basic.pmu_version <= 1 ||
+ v->domain->arch.cpuid->basic.pmu_version >= 5 )
+ return -EINVAL;
+
if ( (arch_pmc_cnt + fixed_pmc_cnt) == 0 )
return -EINVAL;
}
break;
+ case 0xa:
+ if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
+ break;
+
+ /* If PMU version is zero then the guest doesn't have VPMU */
+ if ( p->basic.pmu_version == 0 )
+ {
+ struct vcpu *v;
+
+ for_each_vcpu ( d, v )
+ vpmu_destroy(v);
+ }
+ break;
+
case 0xd:
if ( ctl->input[1] != 1 )
break;
/* Leaf 0x2 - TLB/Cache/Prefetch. */
uint8_t l2_nr_queries; /* Documented as fixed to 1. */
+ uint8_t l2_desc[15];
+
+ uint64_t :64, :64; /* Leaf 0x3 - PSN. */
+ uint64_t :64, :64; /* Leaf 0x4 - Structured Cache. */
+ uint64_t :64, :64; /* Leaf 0x5 - MONITOR. */
+ uint64_t :64, :64; /* Leaf 0x6 - Therm/Perf. */
+ uint64_t :64, :64; /* Leaf 0x7 - Structured Features. */
+ uint64_t :64, :64; /* Leaf 0x8 - rsvd */
+ uint64_t :64, :64; /* Leaf 0x9 - DCA */
+
+ /* Leaf 0xa - Intel PMU. */
+ uint8_t pmu_version;
};
} basic;