All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: Pekka Enberg <penberg@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>, Asias He <asias.hejun@gmail.com>,
	Sasha Levin <levinsasha928@gmail.com>,
	KVM-ML <kvm@vger.kernel.org>
Subject: [PATCH] kvm tool: Add own barrier() definition
Date: Tue, 8 May 2012 13:52:40 +0400	[thread overview]
Message-ID: <20120508095240.GC14037@moon> (raw)

Otherwise I'm getting the following compile
problem on my Fedora machine. The helper is
rather taken from linux kernel.

 | [cyrill@moon kvm]$ make tags
 | x86/include/kvm/barrier.h:11:25: fatal error: asm/barrier.h: No such file or directory compilation terminated.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Ingo Molnar <mingo@kernel.org>
---
 tools/kvm/x86/include/kvm/barrier.h |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

Index: linux-2.6.git/tools/kvm/x86/include/kvm/barrier.h
===================================================================
--- linux-2.6.git.orig/tools/kvm/x86/include/kvm/barrier.h
+++ linux-2.6.git/tools/kvm/x86/include/kvm/barrier.h
@@ -1,13 +1,20 @@
 #ifndef _KVM_BARRIER_H_
 #define _KVM_BARRIER_H_
 
-/*
- * asm/system.h cannot be #included standalone on 32-bit x86 yet.
- *
- * Provide the dependencies here - we can drop these wrappers once
- * the header is fixed upstream:
- */
+#define barrier() asm volatile("": : :"memory")
 
-#include <asm/barrier.h>
+#define mb()	asm volatile ("mfence": : :"memory")
+#define rmb()	asm volatile ("lfence": : :"memory")
+#define wmb()	asm volatile ("sfence": : :"memory")
+
+#ifdef CONFIG_SMP
+#define smp_mb()	mb()
+#define smp_rmb()	rmb()
+#define smp_wmb()	wmb()
+#else
+#define smp_mb()	barrier()
+#define smp_rmb()	barrier()
+#define smp_wmb()	barrier()
+#endif
 
 #endif /* _KVM_BARRIER_H_ */

             reply	other threads:[~2012-05-08  9:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08  9:52 Cyrill Gorcunov [this message]
2012-05-08 12:31 ` [PATCH] kvm tool: Add own barrier() definition Pekka Enberg

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=20120508095240.GC14037@moon \
    --to=gorcunov@openvz.org \
    --cc=asias.hejun@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=mingo@kernel.org \
    --cc=penberg@kernel.org \
    /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.