[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH for-4.22 v2 3/4] xen/irq: handle IRQ being disabled while executing its handler


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Mon, 29 Jun 2026 11:45:30 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hINVQXag379ub8ETN0UXT7mZHnxEf6Iv20JJg6aNYIM=; b=HWVs6nrWoUjPZsALRrwP5P89ZtKEo1t89m7nPvH7JA0CBLMGucJaSAddQr0d3zdZOK2PXmAfPETUU6o+k1/AsCLCJuuq3MgwgQ7CKqSWryjkddHyZclEpvPKnwWb3WgKq4f+JqA3o/fSq3nNwWa4/eB67LnFSiXs+RWCgpWmfJJRWId58HjXVJi2K1uVjHT2V9hjhIlzt+zVYbAzVPYykSsUPD/+4N+wvdFOGOGc41izn16yfjLw5bE0qmwF7Vfk17ho+ojUnHu1bnK1GWAKJ9n95ovw8+vaUXAIl22jSeFfsFqaRY4or+vv/hMA8wIpWoh8PN6HDPgvxG3ykAMxTw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g3Fw/rpbwGRSRsZZCxcLzAPizsuE2H4e1CuTf0VVkx246aAO0ZkPRzeiaVBmDjEgh7SVbG9o1G5waz7M1NqX+xSJ4C9sByRbV1FgxTOhour1KRTsvYAnq2YgiWoRvMPlvgeo66FN2gGPFNiN0LTY5YRTgG+OXyEBhA29xzQq1QcGNB1584ckwuDL0v1bqqTvvpx8tUGVpSzsOEhldXWvy+5ojALAS8bW/4x+HJ2cGfrwc7fhlRe0d5XujKeCaSTfeEBCvRAicV6/XoPyZcnlBUKqVPsEYqGnFSNK++lmpZ1JtCRrUFNcxW4nZ+IQKsvy9WctoYSlTZBLNyVxcvl52g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Mon, 29 Jun 2026 09:46:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxxxxx>
---
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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.