From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
Roger Pau Monne <roger.pau@citrix.com>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH for-4.22 v2 3/4] xen/irq: handle IRQ being disabled while executing its handler
Date: Mon, 29 Jun 2026 11:45:30 +0200 [thread overview]
Message-ID: <20260629094531.55555-4-roger.pau@citrix.com> (raw)
In-Reply-To: <20260629094531.55555-1-roger.pau@citrix.com>
It's possible for IRQ_DISABLED to be set while running the handler
execution loop in do_IRQ(). Such disabling can be done by the handler
itself, or from a remote CPU.
Check for IRQ_DISABLED not being set in the loop condition, as to not
execute the handler if the IRQ has been disabled.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
I wanted to add a fixes tag, but this has been broken since forever, and
hence I should add:
Fixes: 4676bbf96dc8 ("bitkeeper revision 1.2 (3ddb79c9KusG02eh7i-uXkgY0IksKA)")
Which is pointless IMO.
---
xen/arch/x86/irq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 739fc04bd16a..2082ad489d74 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2088,7 +2088,9 @@ void do_IRQ(struct cpu_user_regs *regs)
desc->status |= IRQ_INPROGRESS;
action = desc->action;
- while ( desc->status & IRQ_PENDING )
+
+ /* Deal with IRQ_DISABLED being set while inside the loop body. */
+ while ( (desc->status & (IRQ_PENDING | IRQ_DISABLED)) == IRQ_PENDING )
{
desc->status &= ~IRQ_PENDING;
spin_unlock_irq(&desc->lock);
--
2.53.0
next prev parent reply other threads:[~2026-06-29 9:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 9:45 [PATCH for-4.22 v2 0/4] ns16550: bound interrupt handler execution time Roger Pau Monne
2026-06-29 9:45 ` [PATCH for-4.22 v2 1/4] riscv/irq: define a per-arch irq_to_desc() Roger Pau Monne
2026-06-29 10:01 ` Oleksii Kurochko
2026-06-29 10:06 ` Jan Beulich
2026-06-29 9:45 ` [PATCH for-4.22 v2 2/4] xen/ppc: introduce a dummy irq_to_desc() Roger Pau Monne
2026-06-29 10:07 ` Jan Beulich
2026-06-29 10:09 ` Oleksii Kurochko
2026-06-29 14:26 ` Oleksii Kurochko
2026-06-29 9:45 ` Roger Pau Monne [this message]
2026-06-29 10:31 ` [PATCH for-4.22 v2 3/4] xen/irq: handle IRQ being disabled while executing its handler Jan Beulich
2026-06-29 14:29 ` Roger Pau Monné
2026-06-29 14:31 ` Jan Beulich
2026-06-29 13:37 ` Oleksii Kurochko
2026-06-29 9:45 ` [PATCH for-4.22 v2 4/4] char/ns16550: bound execution time of ns16550_interrupt() Roger Pau Monne
2026-06-29 10:39 ` Jan Beulich
2026-06-29 14:44 ` Roger Pau Monné
2026-06-29 13:49 ` Oleksii Kurochko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260629094531.55555-4-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=oleksii.kurochko@gmail.com \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.