From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Gordeev Subject: [PATCH v2 9/9] io: Disable memory re-ordering for generic memory barriers Date: Wed, 27 Apr 2016 15:13:58 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Alexander Gordeev , Andrew Jones , Thomas Huth , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37539 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627AbcD0NOQ (ORCPT ); Wed, 27 Apr 2016 09:14:16 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDF9D62653 for ; Wed, 27 Apr 2016 13:14:15 +0000 (UTC) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Suggested-by: Thomas Huth Cc: Andrew Jones Cc: Thomas Huth Cc: Radim Kr=C4=8Dm=C3=A1=C5=99 Signed-off-by: Alexander Gordeev --- lib/asm-generic/io.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index 28fe981..1710cc4 100644 --- a/lib/asm-generic/io.h +++ b/lib/asm-generic/io.h @@ -127,11 +127,14 @@ static inline u64 __bswap64(u64 x) ({ u64 __r =3D !__cpu_is_be() ? __bswap64(x) : ((u64)x); __r; }) #define cpu_to_be64 be64_to_cpu =20 +#ifndef mb +#define mb() asm volatile("":::"memory") +#endif #ifndef rmb -#define rmb() do { } while (0) +#define rmb() asm volatile("":::"memory") #endif #ifndef wmb -#define wmb() do { } while (0) +#define wmb() asm volatile("" ::: "memory") #endif =20 #define readb(addr) \ --=20 1.8.3.1