#define X86_FEATURE_MWAIT KVM_X86_CPU_FEATURE(0x1, 0, ECX, 3)
#define X86_FEATURE_VMX KVM_X86_CPU_FEATURE(0x1, 0, ECX, 5)
#define X86_FEATURE_SMX KVM_X86_CPU_FEATURE(0x1, 0, ECX, 6)
+#define X86_FEATURE_PDCM KVM_X86_CPU_FEATURE(0x1, 0, ECX, 15)
#define X86_FEATURE_PCID KVM_X86_CPU_FEATURE(0x1, 0, ECX, 17)
#define X86_FEATURE_MOVBE KVM_X86_CPU_FEATURE(0x1, 0, ECX, 22)
#define X86_FEATURE_TSC_DEADLINE_TIMER KVM_X86_CPU_FEATURE(0x1, 0, ECX, 24)
#include "kvm_util.h"
#include "vmx.h"
-#define X86_FEATURE_PDCM (1<<15)
#define PMU_CAP_FW_WRITES (1ULL << 13)
#define PMU_CAP_LBR_FMT 0x3f
int main(int argc, char *argv[])
{
struct kvm_cpuid2 *cpuid;
- struct kvm_cpuid_entry2 *entry_1_0;
struct kvm_cpuid_entry2 *entry_a_0;
struct kvm_vm *vm;
struct kvm_vcpu *vcpu;
vm = vm_create_with_one_vcpu(&vcpu, guest_code);
cpuid = kvm_get_supported_cpuid();
- TEST_REQUIRE(kvm_get_cpuid_max_basic() >= 0xa);
+ TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_PDCM));
- entry_1_0 = kvm_get_supported_cpuid_index(1, 0);
+ TEST_REQUIRE(kvm_get_cpuid_max_basic() >= 0xa);
entry_a_0 = kvm_get_supported_cpuid_index(0xa, 0);
- TEST_REQUIRE(entry_1_0->ecx & X86_FEATURE_PDCM);
eax.full = entry_a_0->eax;
__TEST_REQUIRE(eax.split.version_id, "PMU is not supported by the vCPU");