Skip to content

Commit 033b76b

Browse files
committed
KVM: selftests: Assert that eventfd() succeeds in Xen shinfo test
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>
1 parent b599d44 commit 033b76b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tools/testing/selftests/kvm/x86/xen_shinfo_test.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,14 +548,11 @@ int main(int argc, char *argv[])
548548

549549
if (do_eventfd_tests) {
550550
irq_fd[0] = eventfd(0, 0);
551-
irq_fd[1] = eventfd(0, 0);
551+
TEST_ASSERT(irq_fd[0] >= 0, __KVM_SYSCALL_ERROR("eventfd()", irq_fd[0]));
552552

553-
/* Unexpected, but not a KVM failure */
554-
if (irq_fd[0] == -1 || irq_fd[1] == -1)
555-
do_evtchn_tests = do_eventfd_tests = false;
556-
}
553+
irq_fd[1] = eventfd(0, 0);
554+
TEST_ASSERT(irq_fd[1] >= 0, __KVM_SYSCALL_ERROR("eventfd()", irq_fd[1]));
557555

558-
if (do_eventfd_tests) {
559556
irq_routes.info.nr = 2;
560557

561558
irq_routes.entries[0].gsi = 32;

0 commit comments

Comments
 (0)