diff options
-rw-r--r-- | xen/common/event_channel.c | 2 | ||||
-rw-r--r-- | xen/common/spinlock.c | 8 | ||||
-rw-r--r-- | xen/include/xen/spinlock.h | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 8e3e0d1f64..3993df4bc5 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -386,7 +386,7 @@ static long __evtchn_close(struct domain *d1, int port1) if ( v->virq_to_evtchn[chn1->u.virq] != port1 ) continue; v->virq_to_evtchn[chn1->u.virq] = 0; - spin_barrier(&v->virq_lock); + spin_barrier_irq(&v->virq_lock); } break; diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 15420ebfe7..125e12d1bf 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -54,6 +54,14 @@ void _spin_barrier(spinlock_t *lock) mb(); } +void _spin_barrier_irq(spinlock_t *lock) +{ + unsigned long flags; + local_irq_save(flags); + _spin_barrier(lock); + local_irq_restore(flags); +} + void _spin_lock_recursive(spinlock_t *lock) { int cpu = smp_processor_id(); diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index 289018fea0..c49be63c5f 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -34,6 +34,7 @@ void _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags); int _spin_is_locked(spinlock_t *lock); int _spin_trylock(spinlock_t *lock); void _spin_barrier(spinlock_t *lock); +void _spin_barrier_irq(spinlock_t *lock); void _spin_lock_recursive(spinlock_t *lock); void _spin_unlock_recursive(spinlock_t *lock); @@ -67,6 +68,7 @@ void _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags); /* Ensure a lock is quiescent between two critical operations. */ #define spin_barrier(l) _spin_barrier(l) +#define spin_barrier_irq(l) _spin_barrier_irq(l) /* * spin_[un]lock_recursive(): Use these forms when the lock can (safely!) be |