WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Define spin_barrier_irq() for IRQ-safe sp

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Define spin_barrier_irq() for IRQ-safe spinlocks, and use it for virq_lock.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Oct 2008 07:00:15 -0700
Delivery-date: Thu, 23 Oct 2008 07:00:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224684361 -3600
# Node ID 876618c33914861f3abce927001b0ffc98a203a9
# Parent  6f74549ac4c5b9a83187994e6c7b149961b176da
Define spin_barrier_irq() for IRQ-safe spinlocks, and use it for virq_lock.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/event_channel.c |    2 +-
 xen/common/spinlock.c      |    8 ++++++++
 xen/include/xen/spinlock.h |    2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff -r 6f74549ac4c5 -r 876618c33914 xen/common/event_channel.c
--- a/xen/common/event_channel.c        Wed Oct 22 12:08:16 2008 +0100
+++ b/xen/common/event_channel.c        Wed Oct 22 15:06:01 2008 +0100
@@ -386,7 +386,7 @@ static long __evtchn_close(struct domain
             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 -r 6f74549ac4c5 -r 876618c33914 xen/common/spinlock.c
--- a/xen/common/spinlock.c     Wed Oct 22 12:08:16 2008 +0100
+++ b/xen/common/spinlock.c     Wed Oct 22 15:06:01 2008 +0100
@@ -52,6 +52,14 @@ void _spin_barrier(spinlock_t *lock)
 {
     do { mb(); } while ( _raw_spin_is_locked(&lock->raw) );
     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)
diff -r 6f74549ac4c5 -r 876618c33914 xen/include/xen/spinlock.h
--- a/xen/include/xen/spinlock.h        Wed Oct 22 12:08:16 2008 +0100
+++ b/xen/include/xen/spinlock.h        Wed Oct 22 15:06:01 2008 +0100
@@ -34,6 +34,7 @@ int _spin_is_locked(spinlock_t *lock);
 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 *
 
 /* 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

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Define spin_barrier_irq() for IRQ-safe spinlocks, and use it for virq_lock., Xen patchbot-unstable <=