public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* About Celeron processor memory barrier problem
@ 1999-12-23  9:24 michael chen
  2000-12-23 11:04 ` Erik Mouw
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: michael chen @ 1999-12-23  9:24 UTC (permalink / raw)
  To: alan, torvalds; +Cc: linux-kernel

Hi,
        I found that when I compiled the 2.4 kernel with the option
    of Pentium III or Pentium 4 on a Celeron's PC, it could cause  the
    system hang at very beginning boot stage, and I found the problem
    is cause by the fact that Intel Celeron doesn't have a real memory
    barrier,but when you choose the Pentium III option, the kernel
    assume the processor has a real memory barrier.
    Here is a patch to fix it:

    Merry Christmas :)
    Michael Chen

diff -Nur linux/include/asm-i386/system.h linux.new/include/asm-i386/system.h
--- linux/include/asm-i386/system.h     Mon Dec 11 19:26:39 2000
+++ linux.new/include/asm-i386/system.h Sat Dec 23 16:06:01 2000
@@ -274,7 +274,14 @@
 #ifndef CONFIG_X86_XMM
 #define mb()   __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
 #else
-#define mb()   __asm__ __volatile__ ("sfence": : :"memory")
+#define mb()  do { \
+       if ( cpu_has_xmm ) { \
+               asm volatile("sfence": : :"memory"); \
+       } \
+       else { \
+               asm volatile("lock; addl $0,0(%%esp)": : :"memory"); \
+       } \
+} while (0)                                                            
 #endif
 #define rmb()  mb()
 #define wmb()  __asm__ __volatile__ ("": : :"memory")
diff -Nur linux/include/linux/tqueue.h linux.new/include/linux/tqueue.h
--- linux/include/linux/tqueue.h        Sat Dec 23 16:16:44 2000
+++ linux.new/include/linux/tqueue.h    Sat Dec 23 16:06:01 2000
@@ -17,6 +17,7 @@
 #include <linux/list.h>
 #include <asm/bitops.h>
 #include <asm/system.h>
+#include <asm/processor.h>
 
 /*
  * New proposed "bottom half" handlers:
diff -Nur linux/include/asm-i386/system.h linux.new/include/asm-i386/system.h
--- linux/include/asm-i386/system.h     Mon Dec 11 19:26:39 2000
+++ linux.new/include/asm-i386/system.h Sat Dec 23 16:06:01 2000
@@ -274,7 +274,14 @@
 #ifndef CONFIG_X86_XMM
 #define mb()   __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
 #else
-#define mb()   __asm__ __volatile__ ("sfence": : :"memory")
+#define mb()  do { \
+       if ( cpu_has_xmm ) { \
+               asm volatile("sfence": : :"memory"); \
+       } \
+       else { \
+               asm volatile("lock; addl $0,0(%%esp)": : :"memory"); \
+       } \
+} while (0)                                                            
 #endif
 #define rmb()  mb()
 #define wmb()  __asm__ __volatile__ ("": : :"memory")
diff -Nur linux/include/linux/tqueue.h linux.new/include/linux/tqueue.h
--- linux/include/linux/tqueue.h        Sat Dec 23 16:16:44 2000
+++ linux.new/include/linux/tqueue.h    Sat Dec 23 16:06:01 2000
@@ -17,6 +17,7 @@
 #include <linux/list.h>
 #include <asm/bitops.h>
 #include <asm/system.h>
+#include <asm/processor.h>
 
 /*
  * New proposed "bottom half" handlers:


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <fa.gm0b5nv.1h2mope@ifi.uio.no>]

end of thread, other threads:[~2001-01-01 23:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-12-23  9:24 About Celeron processor memory barrier problem michael chen
2000-12-23 11:04 ` Erik Mouw
2000-12-23 17:21 ` Linus Torvalds
2000-12-23 23:27   ` Erik Mouw
2000-12-24  9:45     ` Jeffrey Rose
2000-12-24 11:48       ` Erik Mouw
2000-12-23 23:36   ` Matthias Schniedermeyer
2000-12-24  9:36   ` Kai Henningsen
2000-12-24 20:50     ` Tim Wright
2000-12-24 22:25       ` Linus Torvalds
2000-12-25  2:38         ` Tim Wright
2000-12-25  7:19         ` The Doctor What
2000-12-26  1:40         ` Alan Cox
2000-12-26 18:14           ` Linus Torvalds
2000-12-26 22:31             ` Rogier Wolff
2001-01-01 11:55         ` Riley Williams
2000-12-25 11:12       ` Kai Henningsen
2000-12-25 19:37         ` Ian Stirling
2000-12-26 20:38         ` Pavel Machek
2000-12-26  0:15       ` Albert D. Cahalan
2000-12-23 22:34 ` Pavel Machek
     [not found] <fa.gm0b5nv.1h2mope@ifi.uio.no>
     [not found] ` <fa.n7l96dv.2nah0l@ifi.uio.no>
2000-12-26 19:24   ` Giacomo Catenazzi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox