All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpu barriers moved and x86-64 cpu barriers added
@ 2005-03-02  3:50 Jerone Young
  0 siblings, 0 replies; only message in thread
From: Jerone Young @ 2005-03-02  3:50 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

Apologies if this is comes in twice. I sent this earlier today but I
don't see it on the list...;-0

We actually should have wmb() be defined as "asm volatile("":::"memory")
since we are not using out of order io.

The patch attached removes all the instances and places the definitions
in libxc/xc.h as per the discussion last week between Anthony & Keir.


Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

-- 
Jerone Young
Open Virtualization
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)

[-- Attachment #2: cpu_barrier_patch.diff --]
[-- Type: text/x-patch, Size: 3223 bytes --]

diff -Nur xen-unstable-0301.orig/tools/blktap/blktaplib.h xen-unstable-0301-test/tools/blktap/blktaplib.h
--- xen-unstable-0301.orig/tools/blktap/blktaplib.h	2005-03-01 06:54:49.000000000 -0600
+++ xen-unstable-0301-test/tools/blktap/blktaplib.h	2005-03-01 16:24:25.780124280 -0600
@@ -10,22 +10,6 @@
 
 #include <stdint.h>
 
-typedef uint8_t            u8;
-typedef uint16_t           u16;
-typedef uint32_t           u32;
-typedef uint64_t           u64;
-typedef int8_t             s8;
-typedef int16_t            s16;
-typedef int32_t            s32;
-typedef int64_t            s64;
-                                                                                
-#if defined(__i386__)
-#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define wmb() __asm__ __volatile__ ( "" : : : "memory" )
-#else
-#error "Define barriers"
-#endif
-    
 #include <sys/user.h>
 #include <xen/xen.h>
 #include <xen/io/blkif.h>
diff -Nur xen-unstable-0301.orig/tools/libxc/xc.h xen-unstable-0301-test/tools/libxc/xc.h
--- xen-unstable-0301.orig/tools/libxc/xc.h	2005-03-01 06:54:49.000000000 -0600
+++ xen-unstable-0301-test/tools/libxc/xc.h	2005-03-01 16:05:53.248254832 -0600
@@ -25,6 +25,21 @@
 #include <xen/event_channel.h>
 #include <xen/sched_ctl.h>
 
+
+/*\
+ *  DEFINITIONS FOR CPU BARRIERS
+\*/ 
+#if defined(__i386__)
+#define rmb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
+#define wmb() __asm__ __volatile__ ("" : : : "memory")
+#elif defined(__x86_64__)
+#define mb()     asm volatile("mfence":::"memory")
+#define rmb()    asm volatile("lfence":::"memory")
+#define wmb()    asm volatile( "" :::"memory")
+#else
+#error "Define barriers"
+#endif
+
 /*\
  *  INITIALIZATION FUNCTIONS
 \*/ 
diff -Nur xen-unstable-0301.orig/tools/python/xen/lowlevel/xu/xu.c xen-unstable-0301-test/tools/python/xen/lowlevel/xu/xu.c
--- xen-unstable-0301.orig/tools/python/xen/lowlevel/xu/xu.c	2005-03-01 06:54:49.000000000 -0600
+++ xen-unstable-0301-test/tools/python/xen/lowlevel/xu/xu.c	2005-03-01 16:01:13.083846296 -0600
@@ -49,14 +49,6 @@
 /* Size of a machine page frame. */
 #define PAGE_SIZE 4096
 
-#if defined(__i386__)
-#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define wmb() __asm__ __volatile__ ( "" : : : "memory" )
-#else
-#error "Define barriers"
-#endif
-
-
 /* Set the close-on-exec flag on a file descriptor.  Doesn't currently bother
  * to check for errors. */
 /*
diff -Nur xen-unstable-0301.orig/tools/xcs/xcs.h xen-unstable-0301-test/tools/xcs/xcs.h
--- xen-unstable-0301.orig/tools/xcs/xcs.h	2005-03-01 06:54:49.000000000 -0600
+++ xen-unstable-0301-test/tools/xcs/xcs.h	2005-03-01 16:02:22.707261928 -0600
@@ -39,13 +39,6 @@
 /* Size of a machine page frame. */
 #define PAGE_SIZE 4096
 
-#if defined(__i386__)
-#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define wmb() __asm__ __volatile__ ( "" : : : "memory" )
-#else
-#error "Define barriers"
-#endif
-
 #ifndef timersub /* XOPEN and __BSD don't cooperate well... */
 #define timersub(a, b, result)                                                \
   do {                                                                        \

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

only message in thread, other threads:[~2005-03-02  3:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-02  3:50 [PATCH] cpu barriers moved and x86-64 cpu barriers added Jerone Young

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.