Skip to content

Commit

Permalink
KVM: selftests: check returned evmcs version range
Browse files Browse the repository at this point in the history
Check that KVM_CAP_HYPERV_ENLIGHTENED_VMCS returns correct version range.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Vitaly Kuznetsov authored and Paolo Bonzini committed Jan 25, 2019
1 parent 3a2f577 commit 35b531a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/testing/selftests/kvm/x86_64/evmcs_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ int main(int argc, char *argv[])

vcpu_ioctl(vm, VCPU_ID, KVM_ENABLE_CAP, &enable_evmcs_cap);

/* KVM should return supported EVMCS version range */
TEST_ASSERT(((evmcs_ver >> 8) >= (evmcs_ver & 0xff)) &&
(evmcs_ver & 0xff) > 0,
"Incorrect EVMCS version range: %x:%x\n",
evmcs_ver & 0xff, evmcs_ver >> 8);

run = vcpu_state(vm, VCPU_ID);

vcpu_regs_get(vm, VCPU_ID, &regs1);
Expand Down

0 comments on commit 35b531a

Please sign in to comment.