]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen/events: Update virq_to_irq on migration
authorJason Andryuk <jason.andryuk@amd.com>
Thu, 28 Aug 2025 00:36:03 +0000 (20:36 -0400)
committerJuergen Gross <jgross@suse.com>
Tue, 9 Sep 2025 07:09:30 +0000 (09:09 +0200)
commit3fcc8e146935415d69ffabb5df40ecf50e106131
treec7dafb76b71ac911379f147980c16e0a19dd0a1f
parent07ce121d93a5e5fb2440a24da3dbf408fcee978e
xen/events: Update virq_to_irq on migration

VIRQs come in 3 flavors, per-VPU, per-domain, and global, and the VIRQs
are tracked in per-cpu virq_to_irq arrays.

Per-domain and global VIRQs must be bound on CPU 0, and
bind_virq_to_irq() sets the per_cpu virq_to_irq at registration time
Later, the interrupt can migrate, and info->cpu is updated.  When
calling __unbind_from_irq(), the per-cpu virq_to_irq is cleared for a
different cpu.  If bind_virq_to_irq() is called again with CPU 0, the
stale irq is returned.  There won't be any irq_info for the irq, so
things break.

Make xen_rebind_evtchn_to_cpu() update the per_cpu virq_to_irq mappings
to keep them update to date with the current cpu.  This ensures the
correct virq_to_irq is cleared in __unbind_from_irq().

Fixes: e46cdb66c8fc ("xen: event channels")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20250828003604.8949-4-jason.andryuk@amd.com>
drivers/xen/events/events_base.c