Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xen: evtchn: Allow shared registration of IRQ handers

Currently the handling of events is supported either in the kernel or
userspace, but not both.

In order to support fast delivery of interrupts from the guest to the
backend, we need to handle the Queue notify part of Virtio protocol in
kernel and the rest in userspace.

Update the interrupt handler registration flag to IRQF_SHARED for event
channels, which would allow multiple entities to bind their interrupt
handler for the same event channel port.

Also increment the reference count of irq_info when multiple entities
try to bind event channel to irqchip, so the unbinding happens only
after all the users are gone.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/99b1edfd3147c6b5d22a5139dab5861e767dc34a.1697439990.git.viresh.kumar@linaro.org
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Viresh Kumar and committed by
Juergen Gross
9e90e58c 767e33ca

+3 -2
+2 -1
drivers/xen/events/events_base.c
··· 1229 1229 bind_evtchn_to_cpu(evtchn, 0, false); 1230 1230 } else { 1231 1231 struct irq_info *info = info_for_irq(irq); 1232 - WARN_ON(info == NULL || info->type != IRQT_EVTCHN); 1232 + if (!WARN_ON(!info || info->type != IRQT_EVTCHN)) 1233 + info->refcnt++; 1233 1234 } 1234 1235 1235 1236 out:
+1 -1
drivers/xen/evtchn.c
··· 397 397 if (rc < 0) 398 398 goto err; 399 399 400 - rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, 0, 400 + rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, IRQF_SHARED, 401 401 u->name, evtchn); 402 402 if (rc < 0) 403 403 goto err;