From patchwork Tue Aug 31 08:37:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 144711 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o7V8bDR8008933 for ; Tue, 31 Aug 2010 08:37:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752648Ab0HaIhK (ORCPT ); Tue, 31 Aug 2010 04:37:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34344 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752420Ab0HaIhJ (ORCPT ); Tue, 31 Aug 2010 04:37:09 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7V8b9hF026831 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 31 Aug 2010 04:37:09 -0400 Received: from [127.0.1.1] (dhcp-65-37.nay.redhat.com [10.66.65.37]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7V8b6HW010850; Tue, 31 Aug 2010 04:37:07 -0400 Subject: [PATCH kvm-unit-tests v2 3/8] Introduce memory barriers. To: zamsden@redhat.com, glommer@redhat.com, mtosatti@redhat.com, avi@redhat.com, kvm@vger.kernel.org From: Jason Wang Date: Tue, 31 Aug 2010 16:37:06 +0800 Message-ID: <20100831083706.10672.49492.stgit@FreeLancer> In-Reply-To: <20100831083216.10672.20413.stgit@FreeLancer> References: <20100831083216.10672.20413.stgit@FreeLancer> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 31 Aug 2010 08:37:13 +0000 (UTC) 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; };