]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/irq: deal with old_cpu_mask for interrupts in movement in fixup_irqs()
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 18 Jun 2024 13:14:49 +0000 (15:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 18 Jun 2024 13:14:49 +0000 (15:14 +0200)
commit817d1cd627be668c358d038f0fadbf7d24d417d3
tree060e41a2db854667e636de21a370dd51b16fab94
parentfa4d026737a47cd1d66ffb797a29150b4453aa9f
x86/irq: deal with old_cpu_mask for interrupts in movement in fixup_irqs()

Given the current logic it's possible for ->arch.old_cpu_mask to get out of
sync: if a CPU set in old_cpu_mask is offlined and then onlined
again without old_cpu_mask having been updated the data in the mask will no
longer be accurate, as when brought back online the CPU will no longer have
old_vector configured to handle the old interrupt source.

If there's an interrupt movement in progress, and the to be offlined CPU (which
is the call context) is in the old_cpu_mask, clear it and update the mask, so
it doesn't contain stale data.

Note that when the system is going down fixup_irqs() will be called by
smp_send_stop() from CPU 0 with a mask with only CPU 0 on it, effectively
asking to move all interrupts to the current caller (CPU 0) which is the only
CPU to remain online.  In that case we don't care to migrate interrupts that
are in the process of being moved, as it's likely we won't be able to move all
interrupts to CPU 0 due to vector shortage anyway.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/irq.c