Patch "xen: evtchn: Allow shared registration of IRQ handers" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    xen: evtchn: Allow shared registration of IRQ handers

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xen-evtchn-allow-shared-registration-of-irq-handers.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 861d0c8cff0a50b41cac7a7ce7ed17b274d2e406
Author: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
Date:   Mon Oct 16 12:41:26 2023 +0530

    xen: evtchn: Allow shared registration of IRQ handers
    
    [ Upstream commit 9e90e58c11b74c2bddac4b2702cf79d36b981278 ]
    
    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@xxxxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    Link: https://lore.kernel.org/r/99b1edfd3147c6b5d22a5139dab5861e767dc34a.1697439990.git.viresh.kumar@xxxxxxxxxx
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Stable-dep-of: fa765c4b4aed ("xen/events: close evtchn after mapping cleanup")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index c50419638ac0a..cd33a418344a8 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1235,7 +1235,8 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t evtchn, struct irq_chip *chip,
 		bind_evtchn_to_cpu(evtchn, 0, false);
 	} else {
 		struct irq_info *info = info_for_irq(irq);
-		WARN_ON(info == NULL || info->type != IRQT_EVTCHN);
+		if (!WARN_ON(!info || info->type != IRQT_EVTCHN))
+			info->refcnt++;
 	}
 
 out:
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index 9139a7364df53..59717628ca42b 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -397,7 +397,7 @@ static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port,
 	if (rc < 0)
 		goto err;
 
-	rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, 0,
+	rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, IRQF_SHARED,
 					       u->name, evtchn);
 	if (rc < 0)
 		goto err;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux