KVM: Initialize irqfd waitqueue callback when adding to the queue
authorSean Christopherson <seanjc@google.com>
Thu, 22 May 2025 23:52:13 +0000 (16:52 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:55 +0000 (09:50 -0700)
commitb5c543518ae9df8e99c63cd08a8b573f0141b31a
tree931d86b57f89513bb52f7f943fdd1b825bf6a7be
parent140768a7bf03df2a746cdbd4b6dc938d80caad8d
KVM: Initialize irqfd waitqueue callback when adding to the queue

Initialize the irqfd waitqueue callback immediately prior to inserting the
irqfd into the eventfd's waitqueue.  Pre-initializing the state in a
completely different context is all kinds of confusing, and incorrectly
suggests that the waitqueue function needs to be initialize prior to
vfs_poll().

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-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
virt/kvm/eventfd.c