]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/xen: Allow 'out of range' event channel ports in IRQ routing table. evtchnrange
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 8 May 2025 20:19:47 +0000 (21:19 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 8 May 2025 20:53:03 +0000 (21:53 +0100)
commitdc0bde86ef4be27670b3a3124dab5090ba608c68
tree441b225eb9ff0784ff348e6f861ddcd9f041bdd0
parentacaa3e726f4a29f32bca5146828565db56bc396f
KVM: x86/xen: Allow 'out of range' event channel ports in IRQ routing table.

To avoid imposing an ordering constraint on userspace, allow 'invalid'
event channel targets to be configured in the IRQ routing table.

This is the same as accepting interrupts targeted at vCPUs which don't
exist yet, which is already the case for both Xen event channels *and*
for MSIs (which don't do any filtering of permitted APIC ID targets at
all).

If userspace actually *triggers* an IRQ with an invalid target, that
will fail cleanly, as kvm_xen_set_evtchn_fast() also does the same range
check.

If KVM enforced that the IRQ target must be valid at the time it is
*configured*, that would force userspace to create all vCPUs and do
various other parts of setup (in this case, setting the Xen long_mode)
before restoring the IRQ table.

Cc: stable@vger.kernel.org
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/kvm/xen.c