]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86/xen: Allow 'out of range' event channel ports in IRQ routing table.
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 8 May 2025 20:30:12 +0000 (13:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:35:12 +0000 (18:35 +0200)
commit20d1d9e7ce694cf1587fb54b0faf9df02392f89e
tree60755bf7224a21b8cfce39405c5cf5d788593e65
parenta18776abc5922114dbc960d73e739e4a5d912413
KVM: x86/xen: Allow 'out of range' event channel ports in IRQ routing table.

commit a7f4dff21fd744d08fa956c243d2b1795f23cbf7 upstream.

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>
Reviewed-by: Paul Durrant <paul@xen.org>
Link: https://lore.kernel.org/r/e489252745ac4b53f1f7f50570b03fb416aa2065.camel@infradead.org
[sean: massage comment]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/xen.c