#define X86_FEATURE_SPEC_CTRL KVM_X86_CPU_FEATURE(0x7, 0, EDX, 26)
#define X86_FEATURE_ARCH_CAPABILITIES KVM_X86_CPU_FEATURE(0x7, 0, EDX, 29)
#define X86_FEATURE_PKS KVM_X86_CPU_FEATURE(0x7, 0, ECX, 31)
+#define X86_FEATURE_XSAVES KVM_X86_CPU_FEATURE(0xD, 1, EAX, 3)
/*
* Extended Leafs, a.k.a. AMD defined
#define MSR_BITS 64
-#define X86_FEATURE_XSAVES (1<<3)
-
int main(int argc, char *argv[])
{
- struct kvm_cpuid_entry2 *entry;
bool xss_in_msr_list;
struct kvm_vm *vm;
struct kvm_vcpu *vcpu;
/* Create VM */
vm = vm_create_with_one_vcpu(&vcpu, NULL);
- TEST_REQUIRE(kvm_get_cpuid_max_basic() >= 0xd);
-
- entry = kvm_get_supported_cpuid_index(0xd, 1);
- TEST_REQUIRE(entry->eax & X86_FEATURE_XSAVES);
+ TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_XSAVES));
xss_val = vcpu_get_msr(vcpu, MSR_IA32_XSS);
TEST_ASSERT(xss_val == 0,