From b5edd9c58e0c77c9e8de26f1e29bc903152f85f1 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Thu, 25 Jun 2026 12:25:27 +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 Release-Acked-by: Oleksii Kurochko --- 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 739fc04bd1..2082ad489d 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);