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] [patch] small accounting and lockup fix for xenfreebsd on -u

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [patch] small accounting and lockup fix for xenfreebsd on -unstable
From: Kip Macy <kip.macy@xxxxxxxxx>
Date: Thu, 24 Mar 2005 13:22:11 -0800
Delivery-date: Thu, 24 Mar 2005 21:25:13 +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; b=WEflufzeorLzGILWApKTNo/GtyDUbTKKC5T3k5c+b4/eLZHSWsGpfMWDysr9pIw+muGcs/GvKgCcZGMg2uv8L8rPkTSv3HWcncqYSLcDGwQTv24tKmf5GTt4cBNoA943j5UMZrNzAlpBIdX9r5axoGPVVCcLecHPWXzMt81n/lQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Reply-to: Kip Macy <kip.macy@xxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/23 18:27:49-08:00 kmacy@xxxxxxxxxxxxxxxxxxxx 
#   only bump tmpindex by NKPT-1 once
#   release sched lock on upcall
#   Signed-off-by: Kip Macy <kmacy@xxxxxxxxxxx>
# 
# freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c
#   2005/03/23 18:24:47-08:00 kmacy@xxxxxxxxxxxxxxxxxxxx +0 -4
#   remove extra bump of tmpindex
# 
# freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
#   2005/03/23 18:24:47-08:00 kmacy@xxxxxxxxxxxxxxxxxxxx +7 -3
#   release sched lock on upcall
# 
diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
--- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c 2005-03-24
13:19:58 -08:00
+++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c 2005-03-24
13:19:58 -08:00
@@ -54,16 +54,16 @@
 {
     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()];
 
     local_irq_save(flags);
 
-    while ( s->vcpu_data[0].evtchn_upcall_pending )
+    while ( vcpu_info->evtchn_upcall_pending )
     {
-        s->vcpu_data[0].evtchn_upcall_pending = 0;
+        vcpu_info->evtchn_upcall_pending = 0;
         /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
         l1 = xen_xchg(&vcpu_info->evtchn_pending_sel, 0);
         while ( (l1i = ffs(l1)) != 0 )
@@ -78,12 +78,16 @@
                 l2 &= ~(1 << l2i);
             
                 port = (l1i << 5) + l2i;
+               if ((owned = mtx_recursed(&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);
             }
         }
     }
diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c
b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c
--- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c       
2005-03-24 13:19:58 -08:00
+++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c       
2005-03-24 13:19:58 -08:00
@@ -1454,10 +1454,6 @@
     for (i = 0; i < NKPT-1; i++, tmpindex++)
        xpq_queue_pt_update(IdlePTD + KPTDI + i + 1,
xpmap_ptom((tmpindex << PAGE_SHIFT))| PG_M | PG_RW | PG_V | PG_A);
     tmpindex += NKPT-1;
-
-
-
-    tmpindex += NKPT-1;
     PT_UPDATES_FLUSH();
 
     HYPERVISOR_shared_info = (shared_info_t *)(KERNBASE + (tmpindex
<< PAGE_SHIFT));


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [patch] small accounting and lockup fix for xenfreebsd on -unstable, Kip Macy <=