static inline int local_events_need_delivery(void)
{
struct vcpu *v = current;
+
+ ASSERT(!is_idle_vcpu(v));
+
return (has_hvm_container_vcpu(v) ? hvm_local_events_need_delivery(v) :
(vcpu_info(v, evtchn_upcall_pending) &&
!vcpu_info(v, evtchn_upcall_mask)));
unsigned int op, const char *format, ...);
void hypercall_cancel_continuation(void);
+/*
+ * For long-running operations that must be in hypercall context, check
+ * if there is background work to be done that should interrupt this
+ * operation.
+ */
#define hypercall_preempt_check() (unlikely( \
softirq_pending(smp_processor_id()) | \
local_events_need_delivery() \
))
+/*
+ * For long-running operations that may be in hypercall context or on
+ * the idle vcpu (e.g. during dom0 construction), check if there is
+ * background work to be done that should interrupt this operation.
+ */
+#define general_preempt_check() (unlikely( \
+ softirq_pending(smp_processor_id()) || \
+ (!is_idle_vcpu(current) && local_events_need_delivery()) \
+ ))
+
extern struct domain *domain_list;
/* Caller must hold the domlist_read_lock or domlist_update_lock. */