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-devel

[Xen-devel] XenFreeBSD lockup fix

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] XenFreeBSD lockup fix
From: Kip Macy <kip.macy@xxxxxxxxx>
Date: Fri, 22 Apr 2005 15:22:14 -0700
Delivery-date: Fri, 22 Apr 2005 22:22:02 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=UEgiAVoQPyzor8OyfLklx5YvE0PBB3EdmYnLLSijM09/3HCzyQzsSqQ0iDtRY7NBdO0ha2bOT5omP1T3lIeyoeKKl2nVFDvstoUsqes0sQDp/4vkYVLjIdfNwgiymcmuHG6jkmorP0Sty5xYQ2N2R1OJIrNgwkaigPCIlI0Cj0c=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Kip Macy <kip.macy@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Old bug.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/04/22 15:19:02-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx 
#   Fix lockup in evtchn_do_upcall
#   Signed-off-by: Kip Macy <kmacy@xxxxxxxxxxx>
# 
# freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
#   2005/04/22 15:18:57-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx +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);
+
             }
         }
     }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] XenFreeBSD lockup fix, Kip Macy <=