]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
xen/arm: Disable interrupts for the entire duration of the context switch
authorJaeyong Yoo <jaeyong.yoo@samsung.com>
Wed, 22 May 2013 02:34:18 +0000 (02:34 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 23 May 2013 11:51:51 +0000 (12:51 +0100)
Not just while saving state. Otherwise there is a race between interrupts
arriving and updating the LR state and gic_restore_state overwriting them with
the saved state.

With this change we no longer need to disable interrupts in gic_restore_state.

Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ ijc -- rewrote commit message ]

xen/arch/arm/domain.c
xen/arch/arm/gic.c

index 9ca44eaa4e8410ead2f7667e3b7c4c1ea271a794..ee12b5f08fe30bc0150bd47fd603eabc4922ee37 100644 (file)
@@ -226,10 +226,10 @@ static void schedule_tail(struct vcpu *prev)
 {
     ctxt_switch_from(prev);
 
-    local_irq_enable();
-
     ctxt_switch_to(current);
 
+    local_irq_enable();
+
     if ( prev != current )
         update_runstate_area(current);
 }
index 30bf8d1e99a2473a22f9c30782ff10c800d4de96..d9940ead0511f01a90cf4e4b0f682029eb828a11 100644 (file)
@@ -93,11 +93,9 @@ void gic_restore_state(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return;
 
-    spin_lock_irq(&gic.lock);
     this_cpu(lr_mask) = v->arch.lr_mask;
     for ( i=0; i<nr_lrs; i++)
         GICH[GICH_LR + i] = v->arch.gic_lr[i];
-    spin_unlock_irq(&gic.lock);
     GICH[GICH_APR] = v->arch.gic_apr;
     GICH[GICH_HCR] = GICH_HCR_EN;
     isb();