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

[PATCH 12/12] x86/irq: convert irq_desc pending_mask field to integer


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 20 Nov 2025 10:58:26 +0100
  • 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=TbCrwlvezFLJjSfH4rjfQHTAYF9jHHhDrcGai00ypnA=; b=DNgRG0OYRZ4b+r2ZEw7lSz15sY9ucpMTQc9W6pkz356i97AvW1OevlV2HGH2Dc27wdBFT6F1McKzbOJwROzdJUJdeTxfmhHsOCL5yZL1jixLRJQi/r7HrEocoqltcwCXxfOj0s1GAbqSP+TRXmIQAbWiDJ1CkS3Lk8YxB1NCr76pi+OeuPL+LQ3+Yt+NV6DIxZy6ysBVwJxwP4/9ALK9JOxc2KMyxyIoCc9SoDl/2yKhILgS2eecw3zDi+ljnfdm/EyUDZBLqfDGmS/gr4fOAWWMSKQq4QeQwdkPiLKmd756FVvC2VA5usrllNduzWfVAJohUh6HeZR5GepleaWNoA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b54PghwqrbFFnH3+0Cz5Nev/aq+/5b3vzaM2JX5xYtm2Fv5TeztRpQ3WBnjO5yJtgL4eTGOeKKkGYKxPO37KuNdZVhcLjWG3+OLx0N2oEIWrVmlnyVlbjws2rympb/+Sk1WGE8uRL0TQRKJHjAX5l1ULXaVeTXvMPJa7bxs9fL3LDCQ4t61M0+tdj3NluH6xoqucgsedWO04qmQjxbJuG28lKybgwZUpKFQOJ3X0Xv9sf4jjWFDxJulKqbqvhRhPZHH6C6Wdd8Uw0pq5Z/NF9YziY0RQJfmRhApo3J1Eddk/KaDGrpTTX5q9zoIctx82aIm+y0AZlWEkKBQzqhM5SA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Thu, 20 Nov 2025 09:59:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Much like the rest of the fields that relate to the current or old CPU
target, the pending_mask can be converted into an integer field.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/include/asm/irq.h |  2 +-
 xen/arch/x86/irq.c             | 14 +++++---------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index bc59ce7c3ffb..55047772eb46 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -73,7 +73,7 @@ struct arch_irq_desc {
 #define CPU_INVALID  ~0U
         unsigned int cpu;                /* Target CPU of the interrupt. */
         unsigned int old_cpu;
-        cpumask_var_t pending_mask;
+        unsigned int pending_cpu;
         vmask_t *used_vectors;
         bool move_cleanup : 1;
         bool move_in_progress : 1;
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 680f190da065..8d7947116e33 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -387,11 +387,9 @@ int irq_to_vector(int irq)
 
 int arch_init_one_irq_desc(struct irq_desc *desc)
 {
-    if ( !alloc_cpumask_var(&desc->arch.pending_mask) )
-        return -ENOMEM;
-
     desc->arch.cpu = CPU_INVALID;
     desc->arch.old_cpu = CPU_INVALID;
+    desc->arch.pending_cpu = CPU_INVALID;
     desc->arch.vector = IRQ_VECTOR_UNASSIGNED;
     desc->arch.old_vector = IRQ_VECTOR_UNASSIGNED;
     desc->arch.creator_domid = DOMID_INVALID;
@@ -760,8 +758,6 @@ void setup_vector_irq(unsigned int cpu)
 
 void move_masked_irq(struct irq_desc *desc)
 {
-    cpumask_t *pending_mask = desc->arch.pending_mask;
-
     if (likely(!(desc->status & IRQ_MOVE_PENDING)))
         return;
     
@@ -779,10 +775,10 @@ void move_masked_irq(struct irq_desc *desc)
      *
      * For correct operation this depends on the caller masking the irqs.
      */
-    if ( likely(cpumask_intersects(pending_mask, &cpu_online_map)) )
-        desc->handler->set_affinity(desc, pending_mask);
+    if ( likely(cpu_online(desc->arch.pending_cpu)) )
+        desc->handler->set_affinity(desc, cpumask_of(desc->arch.pending_cpu));
 
-    cpumask_clear(pending_mask);
+    desc->arch.pending_cpu = CPU_INVALID;
 }
 
 void move_native_irq(struct irq_desc *desc)
@@ -926,7 +922,7 @@ void irq_set_affinity(struct irq_desc *desc, unsigned int 
cpu)
     ASSERT(spin_is_locked(&desc->lock));
     desc->status &= ~IRQ_MOVE_PENDING;
     smp_wmb();
-    cpumask_copy(desc->arch.pending_mask, cpumask_of(cpu));
+    desc->arch.pending_cpu = cpu;
     smp_wmb();
     desc->status |= IRQ_MOVE_PENDING;
 }
-- 
2.51.0




 


Rackspace

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