From: Jerone Young <jyoung5@us.ibm.com>
To: xen-devel <xen-devel@lists.sourceforge.net>
Subject: [PATCH][UPDATED] cpu barriers moved and x86-64 cpu barriers added
Date: Tue, 01 Mar 2005 23:56:47 -0600 [thread overview]
Message-ID: <1109743007.14777.13.camel@thinkpad> (raw)
[-- Attachment #1: Type: text/plain, Size: 589 bytes --]
Last patch had build error in blktap that I missed since it is not apart
of the standard build process. Also evidence point to that X86-64 by
default does have CONFIG_UNORDERED_IO on in the Linux kernel default
configuration for x86-64, so since it is really a no op nothing can
really go wrong (Anthony you win this time!).
This patch moves all cpu barrier definitions to libxc/xc.h and also adds
X86-64 barrier definitions.
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: 3251 bytes --]
diff -Nuarp xen-unstable.orig/tools/blktap/blktaplib.h xen-unstable/tools/blktap/blktaplib.h
--- xen-unstable.orig/tools/blktap/blktaplib.h 2005-03-01 22:50:19.499166000 -0500
+++ xen-unstable/tools/blktap/blktaplib.h 2005-03-01 23:07:52.849166000 -0500
@@ -8,24 +8,7 @@
#ifndef __BLKTAPLIB_H__
#define __BLKTAPLIB_H__
-#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 <xc.h>
#include <sys/user.h>
#include <xen/xen.h>
#include <xen/io/blkif.h>
diff -Nuarp xen-unstable.orig/tools/libxc/xc.h xen-unstable/tools/libxc/xc.h
--- xen-unstable.orig/tools/libxc/xc.h 2005-03-01 22:50:19.499166000 -0500
+++ xen-unstable/tools/libxc/xc.h 2005-03-01 23:07:14.069166000 -0500
@@ -25,6 +25,21 @@ typedef int64_t s64;
#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__ ( "sfence" : : : "memory" )
+#else
+#error "Define barriers"
+#endif
+
/*\
* INITIALIZATION FUNCTIONS
\*/
diff -Nuarp xen-unstable.orig/tools/python/xen/lowlevel/xu/xu.c xen-unstable/tools/python/xen/lowlevel/xu/xu.c
--- xen-unstable.orig/tools/python/xen/lowlevel/xu/xu.c 2005-03-01 22:50:19.519166000 -0500
+++ xen-unstable/tools/python/xen/lowlevel/xu/xu.c 2005-03-01 23:07:14.069166000 -0500
@@ -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 -Nuarp xen-unstable.orig/tools/xcs/xcs.h xen-unstable/tools/xcs/xcs.h
--- xen-unstable.orig/tools/xcs/xcs.h 2005-03-01 22:50:19.499166000 -0500
+++ xen-unstable/tools/xcs/xcs.h 2005-03-01 23:07:14.069166000 -0500
@@ -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 { \
reply other threads:[~2005-03-02 5:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1109743007.14777.13.camel@thinkpad \
--to=jyoung5@us.ibm.com \
--cc=xen-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.