[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] 2.6.11-rc2 SMP fixes


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
  • From: Rik van Riel <riel@xxxxxxxxxx>
  • Date: Mon, 31 Jan 2005 15:33:54 -0500 (EST)
  • Delivery-date: Mon, 31 Jan 2005 20:36:14 +0000
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>

This small patch was needed to make the xenU kernel compile
and boot in SMP mode.  There are a number of run-time warnings
left, which I will tackle later.

Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>

--- linux-2.6.10/arch/xen/i386/kernel/smpboot.c.xensmp  2005-01-31 
15:32:11.260228265 -0500
+++ linux-2.6.10/arch/xen/i386/kernel/smpboot.c 2005-01-31 14:04:09.300916781 
-0500
@@ -437,9 +437,6 @@

 int cpucount;

-extern int cpu_idle(void);
-
-
 static irqreturn_t local_debug_interrupt(int irq, void *dev_id,
                                         struct pt_regs *regs)
 {
@@ -496,7 +493,9 @@
                        }
                }
        }
-       return cpu_idle();
+       cpu_idle();
+       /* Unreached, cpu_idle() never returns. */
+       return -1;
 }

 /*
--- linux-2.6.10/include/asm-xen/asm-i386/spinlock.h.xensmp     2005-01-31 
14:18:33.000000000 -0500
+++ linux-2.6.10/include/asm-xen/asm-i386/spinlock.h    2005-01-31 
14:19:54.693968423 -0500
@@ -212,6 +212,16 @@
 #define _raw_read_unlock(rw)           asm volatile("lock ; incl %0" :"=m" ((rw)->lock) 
: : "memory")
 #define _raw_write_unlock(rw)  asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0":"=m" 
((rw)->lock) : : "memory")

+static inline int _raw_read_trylock(rwlock_t *lock)
+{
+       atomic_t *count = (atomic_t *)lock;
+       atomic_dec(count);
+       if (atomic_read(count) >= 0)
+               return 1;
+       atomic_inc(count);
+       return 0;
+}
+
 static inline int _raw_write_trylock(rwlock_t *lock)
 {
        atomic_t *count = (atomic_t *)lock;


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.