x86/upcall: inject a spurious event after setting upcall vector
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 4 Jan 2018 13:29:16 +0000 (14:29 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Jan 2018 13:29:16 +0000 (14:29 +0100)
commit7b5b8ca7dffde866d851f0b87b994e0b13e5b867
tree6d2fc335f8017029638dccfc897c34d529efa60e
parentb55f6c299d316b00f65b63137fde8c2524fb638a
x86/upcall: inject a spurious event after setting upcall vector

In case the vCPU has pending events to inject. This fixes a bug that
happened if the guest mapped the vcpu info area using
VCPUOP_register_vcpu_info without having setup the event channel
upcall, and then setup the upcall vector.

In this scenario the guest would not receive any upcalls, because the
call to VCPUOP_register_vcpu_info would have marked the vCPU as having
pending events, but the vector could not be injected because it was
not yet setup.

This has not caused issues so far because all the consumers first
setup the vector callback and then map the vcpu info page, but there's
no limitation that prevents doing it in the inverse order.

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