]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Mostly fix broken Hyper-V Features test
authorSean Christopherson <seanjc@google.com>
Wed, 8 Jun 2022 22:45:14 +0000 (22:45 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 20 Jun 2022 15:50:59 +0000 (11:50 -0400)
commit78fedfa9c17578e410abea2c43b91cee268c6726
tree4a3fa7d601c0e9306fe18650934727f74f4cf00a
parent17919ed2d5a33633d493a41e13b60f3c6bfbdaa6
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: 276ff22ed440 ("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>
tools/testing/selftests/kvm/x86_64/hyperv_features.c