]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
xen/events: switch user event channels to lateeoi model
authorJuergen Gross <jgross@suse.com>
Mon, 7 Sep 2020 13:47:29 +0000 (15:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:08:37 +0000 (11:08 +0100)
commit c44b849cee8c3ac587da3b0980e01f77500d158c upstream.

Instead of disabling the irq when an event is received and enabling
it again when handled by the user process use the lateeoi model.

This is part of XSA-332.

Cc: stable@vger.kernel.org
Reported-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wl@xen.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/evtchn.c

index 47c70b826a6abf227960030cb09dd3a45fec4746..4b11e60e37a33c20449a74f6ca679dd3dc07c48b 100644 (file)
@@ -166,7 +166,6 @@ static irqreturn_t evtchn_interrupt(int irq, void *data)
             "Interrupt for port %d, but apparently not enabled; per-user %p\n",
             evtchn->port, u);
 
-       disable_irq_nosync(irq);
        evtchn->enabled = false;
 
        spin_lock(&u->ring_prod_lock);
@@ -292,7 +291,7 @@ static ssize_t evtchn_write(struct file *file, const char __user *buf,
                evtchn = find_evtchn(u, port);
                if (evtchn && !evtchn->enabled) {
                        evtchn->enabled = true;
-                       enable_irq(irq_from_evtchn(port));
+                       xen_irq_lateeoi(irq_from_evtchn(port), 0);
                }
        }
 
@@ -392,8 +391,8 @@ static int evtchn_bind_to_user(struct per_user_data *u, int port)
        if (rc < 0)
                goto err;
 
-       rc = bind_evtchn_to_irqhandler(port, evtchn_interrupt, 0,
-                                      u->name, evtchn);
+       rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, 0,
+                                              u->name, evtchn);
        if (rc < 0)
                goto err;