From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Wang Subject: [PATCH kvm-unit-test 1/6] Introduce memory barriers. Date: Fri, 27 Aug 2010 13:49:11 +0800 Message-ID: <20100827054911.7409.1538.stgit@FreeLancer> References: <20100827054733.7409.63882.stgit@FreeLancer> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: glommer@redhat.com To: mtosatti@redhat.com, avi@redhat.com, kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1688 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752461Ab0H0FtQ (ORCPT ); Fri, 27 Aug 2010 01:49:16 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7R5nFFZ030452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 27 Aug 2010 01:49:15 -0400 In-Reply-To: <20100827054733.7409.63882.stgit@FreeLancer> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Jason Wang --- lib/x86/smp.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/lib/x86/smp.h b/lib/x86/smp.h index c2e7350..df5fdba 100644 --- a/lib/x86/smp.h +++ b/lib/x86/smp.h @@ -1,6 +1,10 @@ #ifndef __SMP_H #define __SMP_H +#define mb() asm volatile("mfence":::"memory") +#define rmb() asm volatile("lfence":::"memory") +#define wmb() asm volatile("sfence" ::: "memory") + struct spinlock { int v; };