summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '0022-x86-irq-remove-offline-CPUs-from-old-CPU-mask-when-a.patch')
-rw-r--r--0022-x86-irq-remove-offline-CPUs-from-old-CPU-mask-when-a.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/0022-x86-irq-remove-offline-CPUs-from-old-CPU-mask-when-a.patch b/0022-x86-irq-remove-offline-CPUs-from-old-CPU-mask-when-a.patch
new file mode 100644
index 0000000..28fec3e
--- /dev/null
+++ b/0022-x86-irq-remove-offline-CPUs-from-old-CPU-mask-when-a.patch
@@ -0,0 +1,44 @@
+From 52e16bf065cb42b79d14ac74d701d1f9d8506430 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
+Date: Wed, 26 Jun 2024 13:37:20 +0200
+Subject: [PATCH 22/56] x86/irq: remove offline CPUs from old CPU mask when
+ adjusting move_cleanup_count
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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>
+master commit: e63209d3ba2fd1b2f232babd14c9c679ffa7b09a
+master date: 2024-06-10 10:33:22 +0200
+---
+ xen/arch/x86/irq.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
+index e07006391a..db14df93db 100644
+--- a/xen/arch/x86/irq.c
++++ b/xen/arch/x86/irq.c
+@@ -2576,6 +2576,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) )
+--
+2.45.2
+