]> xenbits.xensource.com Git - xen.git/commitdiff
x86/irq: remove offline CPUs from old CPU mask when adjusting move_cleanup_count
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 10 Jun 2024 08:33:22 +0000 (10:33 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 10 Jun 2024 08:33:22 +0000 (10:33 +0200)
When adjusting move_cleanup_count to account for CPUs that are offline also
adjust old_cpu_mask, otherwise further calls to fixup_irqs() could subtract
those again and create an imbalance in move_cleanup_count.

Fixes: 472e0b74c5c4 ('x86/IRQ: deal with move cleanup count state in fixup_irqs()')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/irq.c

index e36e06deaa6813652a3d3c72db63d829144bdbb5..d101ffeaf9f36d99aea5f16de5f9b7c0086c2d77 100644 (file)
@@ -2563,6 +2563,14 @@ void fixup_irqs(const cpumask_t *mask, bool verbose)
             desc->arch.move_cleanup_count -= cpumask_weight(affinity);
             if ( !desc->arch.move_cleanup_count )
                 release_old_vec(desc);
+            else
+                /*
+                 * Adjust old_cpu_mask to account for the offline CPUs,
+                 * otherwise further calls to fixup_irqs() could subtract those
+                 * again and possibly underflow the counter.
+                 */
+                cpumask_andnot(desc->arch.old_cpu_mask, desc->arch.old_cpu_mask,
+                               affinity);
         }
 
         if ( !desc->action || cpumask_subset(desc->affinity, mask) )