From cd5ee8e0d93efc4fd53e369d5e3ab9e2db28d77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Date: Tue, 30 Jun 2026 15:02:00 +0200 Subject: [PATCH] xen/irq: handle IRQ being disabled while executing its handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é Reviewed-by: Jan Beulich master commit: b5edd9c58e0c77c9e8de26f1e29bc903152f85f1 master date: 2026-06-29 17:14:47 +0200 --- 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 b9bf4eb3c2..ec8b0976bf 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -2074,7 +2074,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);