18e83f28bf
A guest which has configured the per-vCPU upcall vector may set the
HVM_PARAM_CALLBACK_IRQ param to fairly much anything other than zero.
For example, Linux v6.0+ after commit b1c3497e604 ("x86/xen: Add support
for HVMOP_set_evtchn_upcall_vector") will just do this after setting the
vector:
/* Trick toolstack to think we are enlightened. */
if (!cpu)
rc = xen_set_callback_via(1);
That's explicitly setting the delivery to GSI#1, but it's supposed to be
overridden by the per-vCPU vector setting. This mostly works in Qemu
*except* for the logic to enable the in-kernel handling of event channels,
which falsely determines that the kernel cannot accelerate GSI delivery
in this case.
Add a kvm_xen_has_vcpu_callback_vector() to report whether vCPU#0 has
the vector set, and use that in xen_evtchn_set_callback_param() to
enable the kernel acceleration features even when the param *appears*
to be set to target a GSI.
Preserve the Xen behaviour that when HVM_PARAM_CALLBACK_IRQ is set to
*zero* the event channel delivery is disabled completely. (Which is
what that bizarre guest behaviour is working round in the first place.)
Cc: qemu-stable@nongnu.org
Fixes:
|
||
---|---|---|
.. | ||
apic.c | ||
clock.c | ||
clock.h | ||
i8254.c | ||
i8259.c | ||
ioapic.c | ||
meson.build | ||
trace-events | ||
trace.h | ||
xen_evtchn.c | ||
xen_evtchn.h | ||
xen_gnttab.c | ||
xen_gnttab.h | ||
xen_overlay.c | ||
xen_overlay.h | ||
xen_xenstore.c | ||
xen_xenstore.h | ||
xen-stubs.c | ||
xenstore_impl.c | ||
xenstore_impl.h |