All of lore.kernel.org
 help / color / mirror / Atom feed
* XenFreeBSD lockup fix
@ 2005-04-22 22:22 Kip Macy
  0 siblings, 0 replies; only message in thread
From: Kip Macy @ 2005-04-22 22:22 UTC (permalink / raw)
  To: xen-devel

Old bug.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/04/22 15:19:02-07:00 kmacy@curly.lab.netapp.com 
#   Fix lockup in evtchn_do_upcall
#   Signed-off-by: Kip Macy <kmacy@fsmware.com>
# 
# freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
#   2005/04/22 15:18:57-07:00 kmacy@curly.lab.netapp.com +6 -1
#   Work around potential recursive locking in event channel handler
# 
diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/e
vtchn.c
--- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c 2005-04-21
15:24:19 -07:00
+++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c 2005-04-21
15:24:19 -07:00
@@ -54,7 +54,7 @@
 {
     unsigned long  l1, l2;
     unsigned int   l1i, l2i, port;
-    int            irq;
+    int            irq, owned;
     unsigned long  flags;
     shared_info_t *s = HYPERVISOR_shared_info;
     vcpu_info_t   *vcpu_info = &s->vcpu_data[smp_processor_id()];
@@ -78,12 +78,17 @@
                 l2 &= ~(1 << l2i);
             
                 port = (l1i << 5) + l2i;
+               if ((owned = mtx_owned(&sched_lock)) != 0)
+                        mtx_unlock_spin_flags(&sched_lock, MTX_QUIET);
                 if ( (irq = evtchn_to_irq[port]) != -1 ) {
                    struct intsrc *isrc = intr_lookup_source(irq);
                    intr_execute_handlers(isrc, frame);
                } else {
                     evtchn_device_upcall(port);
                }
+               if (owned)
+                   mtx_lock_spin_flags(&sched_lock, MTX_QUIET);
+
             }
         }
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-22 22:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-22 22:22 XenFreeBSD lockup fix Kip Macy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.