2021-05-21 11:52:04 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2021, Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* Tests for Hyper-V features enablement
|
|
|
|
*/
|
|
|
|
#include <asm/kvm_para.h>
|
|
|
|
#include <linux/kvm_para.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "test_util.h"
|
|
|
|
#include "kvm_util.h"
|
|
|
|
#include "processor.h"
|
|
|
|
#include "hyperv.h"
|
|
|
|
|
2022-10-13 11:58:47 +02:00
|
|
|
/*
|
|
|
|
* HYPERV_CPUID_ENLIGHTMENT_INFO.EBX is not a 'feature' CPUID leaf
|
|
|
|
* but to activate the feature it is sufficient to set it to a non-zero
|
|
|
|
* value. Use BIT(0) for that.
|
|
|
|
*/
|
|
|
|
#define HV_PV_SPINLOCKS_TEST \
|
|
|
|
KVM_X86_CPU_FEATURE(HYPERV_CPUID_ENLIGHTMENT_INFO, 0, EBX, 0)
|
|
|
|
|
2021-05-21 11:52:04 +02:00
|
|
|
struct msr_data {
|
|
|
|
uint32_t idx;
|
2022-10-13 11:58:46 +02:00
|
|
|
bool fault_expected;
|
2021-05-21 11:52:04 +02:00
|
|
|
bool write;
|
|
|
|
u64 write_val;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct hcall_data {
|
|
|
|
uint64_t control;
|
|
|
|
uint64_t expect;
|
2021-07-30 14:26:25 +02:00
|
|
|
bool ud_expected;
|
2021-05-21 11:52:04 +02:00
|
|
|
};
|
|
|
|
|
2022-10-13 11:58:48 +02:00
|
|
|
static bool is_write_only_msr(uint32_t msr)
|
|
|
|
{
|
|
|
|
return msr == HV_X64_MSR_EOI;
|
|
|
|
}
|
|
|
|
|
2021-05-21 11:52:04 +02:00
|
|
|
static void guest_msr(struct msr_data *msr)
|
|
|
|
{
|
2022-10-13 11:58:48 +02:00
|
|
|
uint8_t vector = 0;
|
|
|
|
uint64_t msr_val = 0;
|
2022-06-08 22:45:15 +00:00
|
|
|
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
GUEST_ASSERT(msr->idx);
|
2021-05-21 11:52:04 +02:00
|
|
|
|
2022-10-13 11:58:48 +02:00
|
|
|
if (msr->write)
|
2022-06-08 22:45:15 +00:00
|
|
|
vector = wrmsr_safe(msr->idx, msr->write_val);
|
2021-05-21 11:52:04 +02:00
|
|
|
|
2022-10-13 11:58:48 +02:00
|
|
|
if (!vector && (!msr->write || !is_write_only_msr(msr->idx)))
|
|
|
|
vector = rdmsr_safe(msr->idx, &msr_val);
|
|
|
|
|
2022-10-13 11:58:46 +02:00
|
|
|
if (msr->fault_expected)
|
2023-07-28 17:36:31 -07:00
|
|
|
__GUEST_ASSERT(vector == GP_VECTOR,
|
|
|
|
"Expected #GP on %sMSR(0x%x), got vector '0x%x'",
|
2023-11-29 14:49:15 -08:00
|
|
|
msr->write ? "WR" : "RD", msr->idx, vector);
|
2022-10-13 11:58:46 +02:00
|
|
|
else
|
2023-07-28 17:36:31 -07:00
|
|
|
__GUEST_ASSERT(!vector,
|
|
|
|
"Expected success on %sMSR(0x%x), got vector '0x%x'",
|
2023-11-29 14:49:15 -08:00
|
|
|
msr->write ? "WR" : "RD", msr->idx, vector);
|
2022-10-13 11:58:48 +02:00
|
|
|
|
|
|
|
if (vector || is_write_only_msr(msr->idx))
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
if (msr->write)
|
2023-07-28 17:36:31 -07:00
|
|
|
__GUEST_ASSERT(!vector,
|
2023-11-29 14:49:14 -08:00
|
|
|
"WRMSR(0x%x) to '0x%lx', RDMSR read '0x%lx'",
|
2023-07-28 17:36:31 -07:00
|
|
|
msr->idx, msr->write_val, msr_val);
|
2022-10-13 11:58:49 +02:00
|
|
|
|
|
|
|
/* Invariant TSC bit appears when TSC invariant control MSR is written to */
|
|
|
|
if (msr->idx == HV_X64_MSR_TSC_INVARIANT_CONTROL) {
|
|
|
|
if (!this_cpu_has(HV_ACCESS_TSC_INVARIANT))
|
|
|
|
GUEST_ASSERT(this_cpu_has(X86_FEATURE_INVTSC));
|
|
|
|
else
|
|
|
|
GUEST_ASSERT(this_cpu_has(X86_FEATURE_INVTSC) ==
|
|
|
|
!!(msr_val & HV_INVARIANT_TSC_EXPOSED));
|
|
|
|
}
|
|
|
|
|
2022-10-13 11:58:48 +02:00
|
|
|
done:
|
2021-05-21 11:52:04 +02:00
|
|
|
GUEST_DONE();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void guest_hcall(vm_vaddr_t pgs_gpa, struct hcall_data *hcall)
|
|
|
|
{
|
2021-07-30 14:26:25 +02:00
|
|
|
u64 res, input, output;
|
2022-06-08 22:45:15 +00:00
|
|
|
uint8_t vector;
|
2021-05-21 11:52:04 +02:00
|
|
|
|
2023-07-28 17:36:31 -07:00
|
|
|
GUEST_ASSERT_NE(hcall->control, 0);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
|
2022-11-01 15:54:09 +01:00
|
|
|
wrmsr(HV_X64_MSR_GUEST_OS_ID, HYPERV_LINUX_OS_ID);
|
2021-05-21 11:52:04 +02:00
|
|
|
wrmsr(HV_X64_MSR_HYPERCALL, pgs_gpa);
|
|
|
|
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
if (!(hcall->control & HV_HYPERCALL_FAST_BIT)) {
|
|
|
|
input = pgs_gpa;
|
|
|
|
output = pgs_gpa + 4096;
|
|
|
|
} else {
|
|
|
|
input = output = 0;
|
2021-05-21 11:52:04 +02:00
|
|
|
}
|
|
|
|
|
2022-11-01 15:54:11 +01:00
|
|
|
vector = __hyperv_hypercall(hcall->control, input, output, &res);
|
2022-09-21 23:24:51 -07:00
|
|
|
if (hcall->ud_expected) {
|
2023-07-28 17:36:31 -07:00
|
|
|
__GUEST_ASSERT(vector == UD_VECTOR,
|
2023-11-29 14:49:15 -08:00
|
|
|
"Expected #UD for control '%lu', got vector '0x%x'",
|
2023-07-28 17:36:31 -07:00
|
|
|
hcall->control, vector);
|
2022-09-21 23:24:51 -07:00
|
|
|
} else {
|
2023-07-28 17:36:31 -07:00
|
|
|
__GUEST_ASSERT(!vector,
|
2023-11-29 14:49:15 -08:00
|
|
|
"Expected no exception for control '%lu', got vector '0x%x'",
|
2023-07-28 17:36:31 -07:00
|
|
|
hcall->control, vector);
|
|
|
|
GUEST_ASSERT_EQ(res, hcall->expect);
|
2022-09-21 23:24:51 -07:00
|
|
|
}
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
|
2021-05-21 11:52:04 +02:00
|
|
|
GUEST_DONE();
|
|
|
|
}
|
|
|
|
|
2022-06-14 20:06:51 +00:00
|
|
|
static void vcpu_reset_hv_cpuid(struct kvm_vcpu *vcpu)
|
2021-05-21 11:52:04 +02:00
|
|
|
{
|
2022-06-14 20:06:51 +00:00
|
|
|
/*
|
|
|
|
* Enable all supported Hyper-V features, then clear the leafs holding
|
|
|
|
* the features that will be tested one by one.
|
|
|
|
*/
|
|
|
|
vcpu_set_hv_cpuid(vcpu);
|
|
|
|
|
|
|
|
vcpu_clear_cpuid_entry(vcpu, HYPERV_CPUID_FEATURES);
|
|
|
|
vcpu_clear_cpuid_entry(vcpu, HYPERV_CPUID_ENLIGHTMENT_INFO);
|
|
|
|
vcpu_clear_cpuid_entry(vcpu, HYPERV_CPUID_SYNDBG_PLATFORM_CAPABILITIES);
|
2021-05-21 11:52:04 +02:00
|
|
|
}
|
|
|
|
|
2021-11-22 18:58:17 +01:00
|
|
|
static void guest_test_msrs_access(void)
|
2021-05-21 11:52:04 +02:00
|
|
|
{
|
2022-06-14 20:06:51 +00:00
|
|
|
struct kvm_cpuid2 *prev_cpuid = NULL;
|
2022-02-15 16:50:11 -08:00
|
|
|
struct kvm_vcpu *vcpu;
|
2021-11-22 18:58:17 +01:00
|
|
|
struct kvm_vm *vm;
|
2021-05-21 11:52:04 +02:00
|
|
|
struct ucall uc;
|
2022-02-15 16:50:11 -08:00
|
|
|
int stage = 0;
|
2021-11-22 18:58:17 +01:00
|
|
|
vm_vaddr_t msr_gva;
|
|
|
|
struct msr_data *msr;
|
2022-10-13 11:58:49 +02:00
|
|
|
bool has_invtsc = kvm_cpu_has(X86_FEATURE_INVTSC);
|
2021-05-21 11:52:04 +02:00
|
|
|
|
|
|
|
while (true) {
|
2022-02-15 16:50:11 -08:00
|
|
|
vm = vm_create_with_one_vcpu(&vcpu, guest_msr);
|
2021-11-22 18:58:17 +01:00
|
|
|
|
|
|
|
msr_gva = vm_vaddr_alloc_page(vm);
|
|
|
|
memset(addr_gva2hva(vm, msr_gva), 0x0, getpagesize());
|
|
|
|
msr = addr_gva2hva(vm, msr_gva);
|
|
|
|
|
2022-06-02 13:41:33 -07:00
|
|
|
vcpu_args_set(vcpu, 1, msr_gva);
|
|
|
|
vcpu_enable_cap(vcpu, KVM_CAP_HYPERV_ENFORCE_CPUID, 1);
|
2021-11-22 18:58:17 +01:00
|
|
|
|
2022-06-14 20:06:51 +00:00
|
|
|
if (!prev_cpuid) {
|
|
|
|
vcpu_reset_hv_cpuid(vcpu);
|
2021-11-22 18:58:17 +01:00
|
|
|
|
2022-06-14 20:06:51 +00:00
|
|
|
prev_cpuid = allocate_kvm_cpuid2(vcpu->cpuid->nent);
|
|
|
|
} else {
|
|
|
|
vcpu_init_cpuid(vcpu, prev_cpuid);
|
|
|
|
}
|
|
|
|
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
/* TODO: Make this entire test easier to maintain. */
|
|
|
|
if (stage >= 21)
|
|
|
|
vcpu_enable_cap(vcpu, KVM_CAP_HYPERV_SYNIC2, 0);
|
|
|
|
|
2021-05-21 11:52:04 +02:00
|
|
|
switch (stage) {
|
|
|
|
case 0:
|
|
|
|
/*
|
|
|
|
* Only available when Hyper-V identification is set
|
|
|
|
*/
|
|
|
|
msr->idx = HV_X64_MSR_GUEST_OS_ID;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
msr->idx = HV_X64_MSR_HYPERCALL;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_HYPERCALL_AVAILABLE);
|
2021-05-21 11:52:04 +02:00
|
|
|
/*
|
|
|
|
* HV_X64_MSR_GUEST_OS_ID has to be written first to make
|
|
|
|
* HV_X64_MSR_HYPERCALL available.
|
|
|
|
*/
|
|
|
|
msr->idx = HV_X64_MSR_GUEST_OS_ID;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2022-11-01 15:54:09 +01:00
|
|
|
msr->write_val = HYPERV_LINUX_OS_ID;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
msr->idx = HV_X64_MSR_GUEST_OS_ID;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
msr->idx = HV_X64_MSR_HYPERCALL;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
msr->idx = HV_X64_MSR_VP_RUNTIME;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 6:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_VP_RUNTIME_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_VP_RUNTIME;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
/* Read only */
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_VP_RUNTIME;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
msr->idx = HV_X64_MSR_TIME_REF_COUNT;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 9:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_TIME_REF_COUNT_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_TIME_REF_COUNT;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
/* Read only */
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_TIME_REF_COUNT;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 11:
|
|
|
|
msr->idx = HV_X64_MSR_VP_INDEX;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 12:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_VP_INDEX_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_VP_INDEX;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 13:
|
|
|
|
/* Read only */
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_VP_INDEX;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 14:
|
|
|
|
msr->idx = HV_X64_MSR_RESET;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 15:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_RESET_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_RESET;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 16:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_RESET;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2022-10-13 11:58:48 +02:00
|
|
|
/*
|
|
|
|
* TODO: the test only writes '0' to HV_X64_MSR_RESET
|
|
|
|
* at the moment, writing some other value there will
|
|
|
|
* trigger real vCPU reset and the code is not prepared
|
|
|
|
* to handle it yet.
|
|
|
|
*/
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 0;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 17:
|
|
|
|
msr->idx = HV_X64_MSR_REFERENCE_TSC;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 18:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_REFERENCE_TSC_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_REFERENCE_TSC;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 19:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_REFERENCE_TSC;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 0;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 20:
|
|
|
|
msr->idx = HV_X64_MSR_EOM;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 21:
|
|
|
|
/*
|
|
|
|
* Remains unavailable even with KVM_CAP_HYPERV_SYNIC2
|
|
|
|
* capability enabled and guest visible CPUID bit unset.
|
|
|
|
*/
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_EOM;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 22:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_SYNIC_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_EOM;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 23:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_EOM;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 0;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 24:
|
|
|
|
msr->idx = HV_X64_MSR_STIMER0_CONFIG;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 25:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_SYNTIMER_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_STIMER0_CONFIG;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 26:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_STIMER0_CONFIG;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 0;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 27:
|
|
|
|
/* Direct mode test */
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_STIMER0_CONFIG;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1 << 12;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 28:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_STIMER_DIRECT_MODE_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_STIMER0_CONFIG;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->write_val = 1 << 12;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 29:
|
|
|
|
msr->idx = HV_X64_MSR_EOI;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 30:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_APIC_ACCESS_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_EOI;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 31:
|
|
|
|
msr->idx = HV_X64_MSR_TSC_FREQUENCY;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 32:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_ACCESS_FREQUENCY_MSRS);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_TSC_FREQUENCY;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 33:
|
|
|
|
/* Read only */
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_TSC_FREQUENCY;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 34:
|
|
|
|
msr->idx = HV_X64_MSR_REENLIGHTENMENT_CONTROL;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 35:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_ACCESS_REENLIGHTENMENT);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_REENLIGHTENMENT_CONTROL;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 36:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_REENLIGHTENMENT_CONTROL;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 37:
|
|
|
|
/* Can only write '0' */
|
|
|
|
msr->idx = HV_X64_MSR_TSC_EMULATION_STATUS;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 38:
|
|
|
|
msr->idx = HV_X64_MSR_CRASH_P0;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 39:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_CRASH_P0;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 40:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_CRASH_P0;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 1;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 41:
|
|
|
|
msr->idx = HV_X64_MSR_SYNDBG_STATUS;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 42:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_FEATURE_DEBUG_MSRS_AVAILABLE);
|
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_X64_SYNDBG_CAP_ALLOW_KERNEL_DEBUGGING);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_SYNDBG_STATUS;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
case 43:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
msr->idx = HV_X64_MSR_SYNDBG_STATUS;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->write = true;
|
2021-05-21 11:52:04 +02:00
|
|
|
msr->write_val = 0;
|
2022-10-13 11:58:46 +02:00
|
|
|
msr->fault_expected = false;
|
2021-05-21 11:52:04 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 44:
|
2022-10-13 11:58:49 +02:00
|
|
|
/* MSR is not available when CPUID feature bit is unset */
|
|
|
|
if (!has_invtsc)
|
2024-01-29 09:58:46 +01:00
|
|
|
goto next_stage;
|
2022-10-13 11:58:49 +02:00
|
|
|
msr->idx = HV_X64_MSR_TSC_INVARIANT_CONTROL;
|
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = true;
|
|
|
|
break;
|
|
|
|
case 45:
|
|
|
|
/* MSR is vailable when CPUID feature bit is set */
|
|
|
|
if (!has_invtsc)
|
2024-01-29 09:58:46 +01:00
|
|
|
goto next_stage;
|
2022-10-13 11:58:49 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_ACCESS_TSC_INVARIANT);
|
|
|
|
msr->idx = HV_X64_MSR_TSC_INVARIANT_CONTROL;
|
|
|
|
msr->write = false;
|
|
|
|
msr->fault_expected = false;
|
|
|
|
break;
|
|
|
|
case 46:
|
|
|
|
/* Writing bits other than 0 is forbidden */
|
|
|
|
if (!has_invtsc)
|
2024-01-29 09:58:46 +01:00
|
|
|
goto next_stage;
|
2022-10-13 11:58:49 +02:00
|
|
|
msr->idx = HV_X64_MSR_TSC_INVARIANT_CONTROL;
|
|
|
|
msr->write = true;
|
|
|
|
msr->write_val = 0xdeadbeef;
|
|
|
|
msr->fault_expected = true;
|
|
|
|
break;
|
|
|
|
case 47:
|
|
|
|
/* Setting bit 0 enables the feature */
|
|
|
|
if (!has_invtsc)
|
2024-01-29 09:58:46 +01:00
|
|
|
goto next_stage;
|
2022-10-13 11:58:49 +02:00
|
|
|
msr->idx = HV_X64_MSR_TSC_INVARIANT_CONTROL;
|
|
|
|
msr->write = true;
|
|
|
|
msr->write_val = 1;
|
|
|
|
msr->fault_expected = false;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
kvm_vm_free(vm);
|
|
|
|
return;
|
2021-05-21 11:52:04 +02:00
|
|
|
}
|
|
|
|
|
2022-06-14 20:06:51 +00:00
|
|
|
vcpu_set_cpuid(vcpu);
|
|
|
|
|
|
|
|
memcpy(prev_cpuid, vcpu->cpuid, kvm_cpuid2_size(vcpu->cpuid->nent));
|
2021-05-21 11:52:04 +02:00
|
|
|
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
pr_debug("Stage %d: testing msr: 0x%x for %s\n", stage,
|
|
|
|
msr->idx, msr->write ? "write" : "read");
|
2021-05-21 11:52:04 +02:00
|
|
|
|
2022-06-02 13:41:33 -07:00
|
|
|
vcpu_run(vcpu);
|
2023-02-03 17:45:44 -08:00
|
|
|
TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
|
2021-05-21 11:52:04 +02:00
|
|
|
|
2022-06-02 13:41:33 -07:00
|
|
|
switch (get_ucall(vcpu, &uc)) {
|
2021-05-21 11:52:04 +02:00
|
|
|
case UCALL_ABORT:
|
2023-07-28 17:36:31 -07:00
|
|
|
REPORT_GUEST_ASSERT(uc);
|
2021-05-21 11:52:04 +02:00
|
|
|
return;
|
|
|
|
case UCALL_DONE:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
TEST_FAIL("Unhandled ucall: %ld", uc.cmd);
|
2021-05-21 11:52:04 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-01-29 09:58:46 +01:00
|
|
|
next_stage:
|
2021-05-21 11:52:04 +02:00
|
|
|
stage++;
|
2021-11-22 18:58:17 +01:00
|
|
|
kvm_vm_free(vm);
|
2021-05-21 11:52:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-22 18:58:17 +01:00
|
|
|
static void guest_test_hcalls_access(void)
|
2021-05-21 11:52:04 +02:00
|
|
|
{
|
2022-06-14 20:06:51 +00:00
|
|
|
struct kvm_cpuid2 *prev_cpuid = NULL;
|
2022-02-15 16:50:11 -08:00
|
|
|
struct kvm_vcpu *vcpu;
|
2021-11-22 18:58:17 +01:00
|
|
|
struct kvm_vm *vm;
|
2021-05-21 11:52:04 +02:00
|
|
|
struct ucall uc;
|
2022-02-15 16:50:11 -08:00
|
|
|
int stage = 0;
|
2021-11-22 18:58:17 +01:00
|
|
|
vm_vaddr_t hcall_page, hcall_params;
|
|
|
|
struct hcall_data *hcall;
|
2021-05-21 11:52:04 +02:00
|
|
|
|
|
|
|
while (true) {
|
2022-02-15 16:50:11 -08:00
|
|
|
vm = vm_create_with_one_vcpu(&vcpu, guest_hcall);
|
2021-11-22 18:58:17 +01:00
|
|
|
|
|
|
|
/* Hypercall input/output */
|
|
|
|
hcall_page = vm_vaddr_alloc_pages(vm, 2);
|
|
|
|
memset(addr_gva2hva(vm, hcall_page), 0x0, 2 * getpagesize());
|
|
|
|
|
|
|
|
hcall_params = vm_vaddr_alloc_page(vm);
|
|
|
|
memset(addr_gva2hva(vm, hcall_params), 0x0, getpagesize());
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall = addr_gva2hva(vm, hcall_params);
|
2021-11-22 18:58:17 +01:00
|
|
|
|
2022-06-02 13:41:33 -07:00
|
|
|
vcpu_args_set(vcpu, 2, addr_gva2gpa(vm, hcall_page), hcall_params);
|
|
|
|
vcpu_enable_cap(vcpu, KVM_CAP_HYPERV_ENFORCE_CPUID, 1);
|
2021-11-22 18:58:17 +01:00
|
|
|
|
2022-06-14 20:06:51 +00:00
|
|
|
if (!prev_cpuid) {
|
|
|
|
vcpu_reset_hv_cpuid(vcpu);
|
2021-11-22 18:58:17 +01:00
|
|
|
|
2022-06-14 20:06:51 +00:00
|
|
|
prev_cpuid = allocate_kvm_cpuid2(vcpu->cpuid->nent);
|
|
|
|
} else {
|
|
|
|
vcpu_init_cpuid(vcpu, prev_cpuid);
|
|
|
|
}
|
|
|
|
|
2021-05-21 11:52:04 +02:00
|
|
|
switch (stage) {
|
|
|
|
case 0:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_MSR_HYPERCALL_AVAILABLE);
|
2022-09-22 10:39:41 +02:00
|
|
|
hcall->control = 0xbeef;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_INVALID_HYPERCALL_CODE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
hcall->control = HVCALL_POST_MESSAGE;
|
|
|
|
hcall->expect = HV_STATUS_ACCESS_DENIED;
|
|
|
|
break;
|
|
|
|
case 2:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_POST_MESSAGES);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_POST_MESSAGE;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_INVALID_HYPERCALL_INPUT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
hcall->control = HVCALL_SIGNAL_EVENT;
|
|
|
|
hcall->expect = HV_STATUS_ACCESS_DENIED;
|
|
|
|
break;
|
|
|
|
case 4:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_SIGNAL_EVENTS);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_SIGNAL_EVENT;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_INVALID_HYPERCALL_INPUT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
hcall->control = HVCALL_RESET_DEBUG_SESSION;
|
|
|
|
hcall->expect = HV_STATUS_INVALID_HYPERCALL_CODE;
|
|
|
|
break;
|
|
|
|
case 6:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_X64_SYNDBG_CAP_ALLOW_KERNEL_DEBUGGING);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_RESET_DEBUG_SESSION;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_ACCESS_DENIED;
|
|
|
|
break;
|
|
|
|
case 7:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_DEBUGGING);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_RESET_DEBUG_SESSION;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_OPERATION_DENIED;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
hcall->control = HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE;
|
|
|
|
hcall->expect = HV_STATUS_ACCESS_DENIED;
|
|
|
|
break;
|
|
|
|
case 9:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_SUCCESS;
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
hcall->control = HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX;
|
|
|
|
hcall->expect = HV_STATUS_ACCESS_DENIED;
|
|
|
|
break;
|
|
|
|
case 11:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_SUCCESS;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 12:
|
|
|
|
hcall->control = HVCALL_SEND_IPI;
|
|
|
|
hcall->expect = HV_STATUS_ACCESS_DENIED;
|
|
|
|
break;
|
|
|
|
case 13:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_X64_CLUSTER_IPI_RECOMMENDED);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_SEND_IPI;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_INVALID_HYPERCALL_INPUT;
|
|
|
|
break;
|
|
|
|
case 14:
|
|
|
|
/* Nothing in 'sparse banks' -> success */
|
|
|
|
hcall->control = HVCALL_SEND_IPI_EX;
|
|
|
|
hcall->expect = HV_STATUS_SUCCESS;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 15:
|
|
|
|
hcall->control = HVCALL_NOTIFY_LONG_SPIN_WAIT;
|
|
|
|
hcall->expect = HV_STATUS_ACCESS_DENIED;
|
|
|
|
break;
|
|
|
|
case 16:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_PV_SPINLOCKS_TEST);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_NOTIFY_LONG_SPIN_WAIT;
|
2021-05-21 11:52:04 +02:00
|
|
|
hcall->expect = HV_STATUS_SUCCESS;
|
|
|
|
break;
|
|
|
|
case 17:
|
2021-07-30 14:26:25 +02:00
|
|
|
/* XMM fast hypercall */
|
|
|
|
hcall->control = HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE | HV_HYPERCALL_FAST_BIT;
|
|
|
|
hcall->ud_expected = true;
|
|
|
|
break;
|
|
|
|
case 18:
|
2022-10-13 11:58:47 +02:00
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_X64_HYPERCALL_XMM_INPUT_AVAILABLE);
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
hcall->control = HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE | HV_HYPERCALL_FAST_BIT;
|
2021-07-30 14:26:25 +02:00
|
|
|
hcall->ud_expected = false;
|
|
|
|
hcall->expect = HV_STATUS_SUCCESS;
|
|
|
|
break;
|
|
|
|
case 19:
|
2022-12-12 10:37:17 -08:00
|
|
|
hcall->control = HV_EXT_CALL_QUERY_CAPABILITIES;
|
|
|
|
hcall->expect = HV_STATUS_ACCESS_DENIED;
|
|
|
|
break;
|
|
|
|
case 20:
|
|
|
|
vcpu_set_cpuid_feature(vcpu, HV_ENABLE_EXTENDED_HYPERCALLS);
|
|
|
|
hcall->control = HV_EXT_CALL_QUERY_CAPABILITIES | HV_HYPERCALL_FAST_BIT;
|
|
|
|
hcall->expect = HV_STATUS_INVALID_PARAMETER;
|
|
|
|
break;
|
|
|
|
case 21:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
kvm_vm_free(vm);
|
|
|
|
return;
|
2021-05-21 11:52:04 +02:00
|
|
|
}
|
|
|
|
|
2022-06-14 20:06:51 +00:00
|
|
|
vcpu_set_cpuid(vcpu);
|
|
|
|
|
|
|
|
memcpy(prev_cpuid, vcpu->cpuid, kvm_cpuid2_size(vcpu->cpuid->nent));
|
2021-05-21 11:52:04 +02:00
|
|
|
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
pr_debug("Stage %d: testing hcall: 0x%lx\n", stage, hcall->control);
|
2021-05-21 11:52:04 +02:00
|
|
|
|
2022-06-02 13:41:33 -07:00
|
|
|
vcpu_run(vcpu);
|
2023-02-03 17:45:44 -08:00
|
|
|
TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
|
2021-05-21 11:52:04 +02:00
|
|
|
|
2022-06-02 13:41:33 -07:00
|
|
|
switch (get_ucall(vcpu, &uc)) {
|
2021-05-21 11:52:04 +02:00
|
|
|
case UCALL_ABORT:
|
2023-07-28 17:36:31 -07:00
|
|
|
REPORT_GUEST_ASSERT(uc);
|
2021-05-21 11:52:04 +02:00
|
|
|
return;
|
|
|
|
case UCALL_DONE:
|
KVM: selftests: Mostly fix broken Hyper-V Features test
Explicitly do all setup at every stage of the Hyper-V Features test, e.g.
set the MSR/hypercall, enable capabilities, etc... Now that the VM is
recreated for every stage, values that are written into the VM's address
space, i.e. shared with the guest, are reset between sub-tests, as are
any capabilities, etc...
Fix the hypercall params as well, which were broken in the same rework.
The "hcall" struct/pointer needs to point at the hcall_params object, not
the set of hypercall pages.
The goofs were hidden by the test's dubious behavior of using '0' to
signal "done", i.e. the MSR test ran exactly one sub-test, and the
hypercall test was a gigantic nop.
Fixes: 6c1186430a80 ("KVM: selftests: Avoid KVM_SET_CPUID2 after KVM_RUN in hyperv_features test")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-08 22:45:14 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
TEST_FAIL("Unhandled ucall: %ld", uc.cmd);
|
2021-05-21 11:52:04 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
stage++;
|
2021-11-22 18:58:17 +01:00
|
|
|
kvm_vm_free(vm);
|
2021-05-21 11:52:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2023-12-05 11:36:23 +01:00
|
|
|
TEST_REQUIRE(kvm_has_cap(KVM_CAP_HYPERV_ENFORCE_CPUID));
|
|
|
|
|
2021-05-21 11:52:04 +02:00
|
|
|
pr_info("Testing access to Hyper-V specific MSRs\n");
|
2021-11-22 18:58:17 +01:00
|
|
|
guest_test_msrs_access();
|
2021-05-21 11:52:04 +02:00
|
|
|
|
|
|
|
pr_info("Testing access to Hyper-V hypercalls\n");
|
2021-11-22 18:58:17 +01:00
|
|
|
guest_test_hcalls_access();
|
2021-05-21 11:52:04 +02:00
|
|
|
}
|