diff options
author | Jaeyong Yoo <jaeyong.yoo@samsung.com> | 2013-05-22 02:34:18 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-05-23 12:51:51 +0100 |
commit | 9f5179a4ecafd9a15e0a066e0f935ded681bf997 (patch) | |
tree | ecde9c7ad1797ead325fa754da1ce3aba147284f | |
parent | 13b37b6e08679d810544c99e69cfd81b7d34db18 (diff) | |
download | xen-9f5179a4ecafd9a15e0a066e0f935ded681bf997.tar.gz xen-9f5179a4ecafd9a15e0a066e0f935ded681bf997.tar.bz2 xen-9f5179a4ecafd9a15e0a066e0f935ded681bf997.zip |
xen/arm: Disable interrupts for the entire duration of the context switch
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 ]
-rw-r--r-- | xen/arch/arm/domain.c | 4 | ||||
-rw-r--r-- | xen/arch/arm/gic.c | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 9ca44eaa4e..ee12b5f08f 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -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); } diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 30bf8d1e99..d9940ead05 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -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(); |