]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: selftests: Assert that eventfd() succeeds in Xen shinfo test
authorSean Christopherson <seanjc@google.com>
Thu, 22 May 2025 23:52:21 +0000 (16:52 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:51:00 +0000 (09:51 -0700)
Assert that eventfd() succeeds in the Xen shinfo test instead of skipping
the associated testcase.  While eventfd() is outside the scope of KVM, KVM
unconditionally selects EVENTFD, i.e. the syscall should always succeed.

Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250522235223.3178519-12-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86/xen_shinfo_test.c

index 287829f850f73e84cc611495598d4f68f6a662a3..34d180cf4eedc653dd041ae9d6f696489a22954d 100644 (file)
@@ -548,14 +548,11 @@ int main(int argc, char *argv[])
 
        if (do_eventfd_tests) {
                irq_fd[0] = eventfd(0, 0);
-               irq_fd[1] = eventfd(0, 0);
+               TEST_ASSERT(irq_fd[0] >= 0, __KVM_SYSCALL_ERROR("eventfd()", irq_fd[0]));
 
-               /* Unexpected, but not a KVM failure */
-               if (irq_fd[0] == -1 || irq_fd[1] == -1)
-                       do_evtchn_tests = do_eventfd_tests = false;
-       }
+               irq_fd[1] = eventfd(0, 0);
+               TEST_ASSERT(irq_fd[1] >= 0, __KVM_SYSCALL_ERROR("eventfd()", irq_fd[1]));
 
-       if (do_eventfd_tests) {
                irq_routes.info.nr = 2;
 
                irq_routes.entries[0].gsi = 32;