]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/x86: assert that local_events_need_delivery is not called by the idle domain
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 28 Oct 2016 09:16:39 +0000 (11:16 +0200)
committerRoger Pau Monne <roger.pau@citrix.com>
Wed, 2 Nov 2016 17:34:49 +0000 (18:34 +0100)
It doesn't make sense since the idle domain doesn't receive any events. This
is relevant in order to be sure that hypercall_preempt_check is not called
by the idle domain, which would happen previously when calling
{hap/sh}_set_allocation during domain 0 creation.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes since v2:
 - Expand commit message.

xen/include/asm-x86/event.h

index a82062e339d5be03441a3e5837a087b04499179f..d589d6f86c71ed3434726299e878de61b5ce1ea2 100644 (file)
@@ -23,6 +23,9 @@ int hvm_local_events_need_delivery(struct vcpu *v);
 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)));