x86: allow calling {shadow/hap}_set_allocation with the idle domain
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 2 Dec 2016 17:07:58 +0000 (18:07 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 2 Dec 2016 17:07:58 +0000 (18:07 +0100)
commit7241fffcd918bce9824b9cca7f90cea1d5689062
treeff75fddfd116139230dc8c17f04c7b0a3bdaca44
parent03caf7d3dc1060cdd7edaeb329ba42371bad9597
x86: allow calling {shadow/hap}_set_allocation with the idle domain

... and using the "preempted" parameter. Introduce a new helper that can
be used from both hypercall or idle vcpu context (ie: during Dom0
creation) in order to check if preemption is needed. If such preemption
happens, the caller should then call process_pending_softirqs in order to
drain the pending softirqs, and then call *_set_allocation again to continue
with it's execution.

This allows us to call *_set_allocation() when building domain 0.

While there also document hypercall_preempt_check and add an assert to
local_events_need_delivery in order to be sure it's not called by the idle
domain, which doesn't receive any events (and that in turn
hypercall_preempt_check is also not called by the idle domain).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/hap/hap.c
xen/arch/x86/mm/shadow/common.c
xen/include/asm-x86/event.h
xen/include/xen/sched.h