提交 97705e78 编写于 作者: J Juergen Gross 提交者: Yang Yingliang

xen/events: switch user event channels to lateeoi model

mainline inclusion
from mainline-v5.10
commit c44b849c
category: bugfix
bugzilla: NA
CVE: NA

--------------------------------

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: NJulien Grall <julien@xen.org>
Signed-off-by: NJuergen Gross <jgross@suse.com>
Tested-by: NStefano Stabellini <sstabellini@kernel.org>
Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
Reviewed-by: NJan Beulich <jbeulich@suse.com>
Reviewed-by: NWei Liu <wl@xen.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 11dce48a
...@@ -166,7 +166,6 @@ static irqreturn_t evtchn_interrupt(int irq, void *data) ...@@ -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", "Interrupt for port %d, but apparently not enabled; per-user %p\n",
evtchn->port, u); evtchn->port, u);
disable_irq_nosync(irq);
evtchn->enabled = false; evtchn->enabled = false;
spin_lock(&u->ring_prod_lock); spin_lock(&u->ring_prod_lock);
...@@ -292,7 +291,7 @@ static ssize_t evtchn_write(struct file *file, const char __user *buf, ...@@ -292,7 +291,7 @@ static ssize_t evtchn_write(struct file *file, const char __user *buf,
evtchn = find_evtchn(u, port); evtchn = find_evtchn(u, port);
if (evtchn && !evtchn->enabled) { if (evtchn && !evtchn->enabled) {
evtchn->enabled = true; 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) ...@@ -392,8 +391,8 @@ static int evtchn_bind_to_user(struct per_user_data *u, int port)
if (rc < 0) if (rc < 0)
goto err; goto err;
rc = bind_evtchn_to_irqhandler(port, evtchn_interrupt, 0, rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, 0,
u->name, evtchn); u->name, evtchn);
if (rc < 0) if (rc < 0)
goto err; goto err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册