x86/IRQ: deal with move cleanup count state in fixup_irqs()
authorJan Beulich <jbeulich@suse.com>
Mon, 22 Jul 2019 09:41:55 +0000 (11:41 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 22 Jul 2019 09:41:55 +0000 (11:41 +0200)
commit472e0b74c5c4720c5aa70c0ad85c587679bde868
treeddfc4879c39e464ec8c15f10582f412d55ad4e4a
parent9260609aa93d6c825d88412e599619787e77f059
x86/IRQ: deal with move cleanup count state in fixup_irqs()

The cleanup IPI may get sent immediately before a CPU gets removed from
the online map. In such a case the IPI would get handled on the CPU
being offlined no earlier than in the interrupts disabled window after
fixup_irqs()' main loop. This is too late, however, because a possible
affinity change may incur the need for vector assignment, which will
fail when the IRQ's move cleanup count is still non-zero.

To fix this
- record the set of CPUs the cleanup IPIs gets actually sent to alongside
  setting their count,
- adjust the count in fixup_irqs(), accounting for all CPUs that the
  cleanup IPI was sent to, but that are no longer online,
- bail early from the cleanup IPI handler when the CPU is no longer
  online, to prevent double accounting.

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