vpci: fix deferral of long operations
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 26 Nov 2018 14:41:12 +0000 (15:41 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Nov 2018 14:41:12 +0000 (15:41 +0100)
commit3e568fa9e19ccefcfd0d3056cb80d0b15f2bf0f7
tree8cf0c668f1a33cb9a384f3b18fe23002b71bf35b
parent0290d553e0d5ae395c88bd82301251d579e15ea7
vpci: fix deferral of long operations

Current logic to handle long running operations is flawed because it
doesn't prevent the guest vcpu from running. Fix this by raising a
scheduler softirq when preemption is required, so that the do_softirq
call in the guest entry path performs a rescheduling. Also move the
call to vpci_process_pending into handle_hvm_io_completion, together
with the IOREQ code that handles pending IO instructions.

Note that a scheduler softirq is also raised when the long running
operation is queued in order to prevent the guest vcpu from resuming
execution.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/ioreq.c
xen/drivers/vpci/header.c