All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@redhat.com>
To: kvm@vger.kernel.org
Cc: "Alexander Gordeev" <agordeev@redhat.com>,
	"Andrew Jones" <drjones@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: [kvm-unit-tests PATCH v3 05/10] x86: Introduce lib/x86/asm/barrier.h
Date: Fri, 29 Apr 2016 13:38:01 +0200	[thread overview]
Message-ID: <eec6c45284bacc5e63f990dd856c4931cbef123c.1461928138.git.agordeev@redhat.com> (raw)
In-Reply-To: <cover.1461928138.git.agordeev@redhat.com>

Make x86 consistent with other architectures and put
memory barrier defines to lib/x86/asm/barrier.h

Cc: Andrew Jones <drjones@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 lib/x86/asm/barrier.h | 8 ++++++++
 lib/x86/smp.h         | 4 ----
 x86/hyperv_stimer.c   | 1 +
 x86/kvmclock.c        | 1 +
 4 files changed, 10 insertions(+), 4 deletions(-)
 create mode 100644 lib/x86/asm/barrier.h

diff --git a/lib/x86/asm/barrier.h b/lib/x86/asm/barrier.h
new file mode 100644
index 0000000..0ca1c56
--- /dev/null
+++ b/lib/x86/asm/barrier.h
@@ -0,0 +1,8 @@
+#ifndef _ASM_X86_BARRIER_H_
+#define _ASM_X86_BARRIER_H_
+
+#define mb()	asm volatile("mfence":::"memory")
+#define rmb()	asm volatile("lfence":::"memory")
+#define wmb()	asm volatile("sfence" ::: "memory")
+
+#endif
diff --git a/lib/x86/smp.h b/lib/x86/smp.h
index 566018f..afabac8 100644
--- a/lib/x86/smp.h
+++ b/lib/x86/smp.h
@@ -2,10 +2,6 @@
 #define __SMP_H
 #include <asm/spinlock.h>
 
-#define mb() 	asm volatile("mfence":::"memory")
-#define rmb()	asm volatile("lfence":::"memory")
-#define wmb()	asm volatile("sfence" ::: "memory")
-
 void smp_init(void);
 
 int cpu_count(void);
diff --git a/x86/hyperv_stimer.c b/x86/hyperv_stimer.c
index 9a971ef..6382938 100644
--- a/x86/hyperv_stimer.c
+++ b/x86/hyperv_stimer.c
@@ -8,6 +8,7 @@
 #include "smp.h"
 #include "atomic.h"
 #include "hyperv.h"
+#include "asm/barrier.h"
 
 #define MAX_CPUS 4
 
diff --git a/x86/kvmclock.c b/x86/kvmclock.c
index 327e60d..208d43c 100644
--- a/x86/kvmclock.c
+++ b/x86/kvmclock.c
@@ -3,6 +3,7 @@
 #include "atomic.h"
 #include "processor.h"
 #include "kvmclock.h"
+#include "asm/barrier.h"
 
 #define unlikely(x)	__builtin_expect(!!(x), 0)
 #define likely(x)	__builtin_expect(!!(x), 1)
-- 
1.8.3.1


  parent reply	other threads:[~2016-04-29 11:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 11:37 [kvm-unit-tests PATCH v3 00/10] Cleanup low-level arch code Alexander Gordeev
2016-04-29 11:37 ` [kvm-unit-tests PATCH v3 01/10] Remove unused and unnecessary PHYS32 macro Alexander Gordeev
2016-04-29 11:37 ` [kvm-unit-tests PATCH v3 02/10] Move phys_addr_t type definition to lib/libcflat.h Alexander Gordeev
2016-04-29 14:16   ` Andrew Jones
2016-04-29 11:37 ` [kvm-unit-tests PATCH v3 03/10] x86: Introduce lib/x86/asm/page.h Alexander Gordeev
2016-04-29 14:19   ` Andrew Jones
2016-04-29 11:38 ` [kvm-unit-tests PATCH v3 04/10] x86: Introduce lib/x86/asm/io.h Alexander Gordeev
2016-04-29 14:26   ` Andrew Jones
2016-04-29 11:38 ` Alexander Gordeev [this message]
2016-04-29 14:29   ` [kvm-unit-tests PATCH v3 05/10] x86: Introduce lib/x86/asm/barrier.h Andrew Jones
2016-04-29 11:38 ` [kvm-unit-tests PATCH v3 06/10] io: Separate overrides of virt_to_phys() and phys_to_virt() Alexander Gordeev
2016-04-29 14:30   ` Andrew Jones
2016-04-29 11:38 ` [kvm-unit-tests PATCH v3 07/10] io: Disallow memory re-ordering for generic memory barriers Alexander Gordeev
2016-04-29 11:38 ` [kvm-unit-tests PATCH v3 08/10] io: Make ioremap() prototype conform to Linux one Alexander Gordeev
2016-04-29 11:38 ` [kvm-unit-tests PATCH v3 09/10] io/x86: Factor out ioremap() Alexander Gordeev
2016-04-29 14:48   ` Andrew Jones
2016-04-29 18:58     ` Alexander Gordeev
2016-04-29 19:16       ` Andrew Jones
2016-04-29 11:38 ` [kvm-unit-tests PATCH v3 10/10] x86: Remove size specifier from PAGE_SIZE constant Alexander Gordeev
2016-04-29 14:53   ` Andrew Jones
2016-04-29 17:52     ` Alexander Gordeev
2016-04-29 19:09       ` Andrew Jones

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=eec6c45284bacc5e63f990dd856c4931cbef123c.1461928138.git.agordeev@redhat.com \
    --to=agordeev@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=thuth@redhat.com \
    /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.