Skip to content

Commit b599d44

Browse files
committed
KVM: Drop sanity check that per-VM list of irqfds is unique
Now that the eventfd's waitqueue ensures it has at most one priority waiter, i.e. prevents KVM from binding multiple irqfds to one eventfd, drop KVM's sanity check that eventfds are unique for a single VM. 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-11-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 2cdd64c commit b599d44

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

virt/kvm/eventfd.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ static void kvm_irqfd_register(struct file *file, wait_queue_head_t *wqh,
288288
{
289289
struct kvm_irqfd_pt *p = container_of(pt, struct kvm_irqfd_pt, pt);
290290
struct kvm_kernel_irqfd *irqfd = p->irqfd;
291-
struct kvm_kernel_irqfd *tmp;
292291
struct kvm *kvm = p->kvm;
293292

294293
/*
@@ -328,16 +327,6 @@ static void kvm_irqfd_register(struct file *file, wait_queue_head_t *wqh,
328327
if (p->ret)
329328
goto out;
330329

331-
list_for_each_entry(tmp, &kvm->irqfds.items, list) {
332-
if (irqfd->eventfd != tmp->eventfd)
333-
continue;
334-
335-
WARN_ON_ONCE(1);
336-
/* This fd is used for another irq already. */
337-
p->ret = -EBUSY;
338-
goto out;
339-
}
340-
341330
list_add_tail(&irqfd->list, &kvm->irqfds.items);
342331

343332
out:

0 commit comments

Comments
 (0)