diff options
author | Vipin Sharma <vipinsh@google.com> | 2023-02-04 04:45:44 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-03-14 17:20:09 +0300 |
commit | c96f57b08012805da323c6bdf929bab1b88d250c (patch) | |
tree | 462f58f1e9409d8ac1b3b65c6b037dd6a7f511df /tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c | |
parent | e6239a4ec5c51e4d5ee4d1604f741f490c32054c (diff) | |
download | linux-c96f57b08012805da323c6bdf929bab1b88d250c.tar.xz |
KVM: selftests: Make vCPU exit reason test assertion common
Make TEST_ASSERT_KVM_EXIT_REASON() macro and replace all exit reason
test assert statements with it.
No functional changes intended.
Signed-off-by: Vipin Sharma <vipinsh@google.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Message-Id: <20230204014547.583711-2-vipinsh@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c b/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c index 465a9434d61c..d427eb146bc5 100644 --- a/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c +++ b/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c @@ -183,14 +183,10 @@ int main(int argc, char *argv[]) vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *) (tsc_khz / l1_scale_factor)); for (;;) { - volatile struct kvm_run *run = vcpu->run; struct ucall uc; vcpu_run(vcpu); - TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, - "Got exit_reason other than KVM_EXIT_IO: %u (%s)\n", - run->exit_reason, - exit_reason_str(run->exit_reason)); + TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); switch (get_ucall(vcpu, &uc)) { case UCALL_ABORT: |