diff options
author | Sean Christopherson <seanjc@google.com> | 2022-02-15 11:49:42 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-11 10:15:35 -0400 |
commit | 38d4a385a345d807652f748822630f309786b658 (patch) | |
tree | 51585afb2ec3c35cb4a24358601af98d29b19b46 /tools/testing/selftests/kvm/aarch64 | |
parent | KVM: sefltests: Use vcpu_ioctl() and __vcpu_ioctl() helpers (diff) | |
download | linux-dev-38d4a385a345d807652f748822630f309786b658.tar.xz linux-dev-38d4a385a345d807652f748822630f309786b658.zip |
KVM: selftests: Add __vcpu_run() helper
Add __vcpu_run() so that tests that want to avoid asserts on KVM_RUN
failures don't need to open code the ioctl() call.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/aarch64')
-rw-r--r-- | tools/testing/selftests/kvm/aarch64/vgic_init.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/testing/selftests/kvm/aarch64/vgic_init.c b/tools/testing/selftests/kvm/aarch64/vgic_init.c index 4b7e7ba43969..42c9209f7786 100644 --- a/tools/testing/selftests/kvm/aarch64/vgic_init.c +++ b/tools/testing/selftests/kvm/aarch64/vgic_init.c @@ -55,10 +55,8 @@ static void guest_code(void) static int run_vcpu(struct kvm_vm *vm, uint32_t vcpuid) { ucall_init(vm, NULL); - int ret = __vcpu_ioctl(vm, vcpuid, KVM_RUN, NULL); - if (ret) - return -errno; - return 0; + + return __vcpu_run(vm, vcpuid) ? -errno : 0; } static struct vm_gic vm_gic_create_with_vcpus(uint32_t gic_dev_type, uint32_t nr_vcpus) |