xen/arm: Call context_saved() with interrupts enabled during context switch
authordenys drozdov <denys.drozdov@globallogic.com>
Wed, 4 Feb 2015 17:13:05 +0000 (19:13 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 5 Feb 2015 12:22:33 +0000 (12:22 +0000)
This is a requirement of the scheduler interface, violating this
causes for example with the RT scheduler:

(XEN) Assertion 'local_irq_is_enabled()' failed at spinlock.c:137
(XEN) ----[ Xen-4.5.0  arm32  debug=y  Not tainted ]----
(XEN) CPU:    0
(XEN) PC:     0022a074 _spin_lock_irq+0x18/0x94

(XEN) Xen call trace:
(XEN)    [<0022a074>] _spin_lock_irq+0x18/0x94 (PC)
(XEN)    [<002256b8>] rt_context_saved+0x3c/0x144 (LR)
(XEN)    [<002256b8>] rt_context_saved+0x3c/0x144
(XEN)    [<00228ed8>] context_saved+0x4c/0x80
(XEN)    [<002524b4>] schedule_tail+0x148/0x2f0
(XEN)    [<00252668>] continue_new_vcpu+0xc/0x70
(XEN)    [<00252a18>] context_switch+0x74/0x7c

Signed-off-by: denys drozdov <denys.drozdov@globallogic.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/domain.c

index cfc7ab45f71cbcbd582be0a951b52d424fc45b9d..3e3fe9228e7ded297ef77487a4e8fa89edf54ac2 100644 (file)
@@ -64,7 +64,7 @@ static void ctxt_switch_from(struct vcpu *p)
      * mode. Therefore we don't need to save the context of an idle VCPU.
      */
     if ( is_idle_vcpu(p) )
-        goto end_context;
+        return;
 
     p2m_save_state(p);
 
@@ -138,9 +138,6 @@ static void ctxt_switch_from(struct vcpu *p)
     gic_save_state(p);
 
     isb();
-
-end_context:
-    context_saved(p);
 }
 
 static void ctxt_switch_to(struct vcpu *n)
@@ -246,6 +243,8 @@ static void schedule_tail(struct vcpu *prev)
 
     local_irq_enable();
 
+    context_saved(prev);
+
     if ( prev != current )
         update_runstate_area(current);