Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759540AbbFBQPl (ORCPT ); Tue, 2 Jun 2015 12:15:41 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:33991 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759138AbbFBQPe (ORCPT ); Tue, 2 Jun 2015 12:15:34 -0400 Date: Tue, 2 Jun 2015 17:15:37 +0100 (BST) From: "Maciej W. Rozycki" To: James Hogan cc: Leonid Yegoshin , linux-mips@linux-mips.org, benh@kernel.crashing.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, Ralf Baechle , markos.chandras@imgtec.com, Steven.Hill@imgtec.com, alexander.h.duyck@redhat.com, "David S. Miller" Subject: Re: [PATCH 1/3] MIPS: R6: Use lightweight SYNC instruction in smp_* memory barriers In-Reply-To: <556D8A03.9080201@imgtec.com> Message-ID: References: <20150602000818.6668.76632.stgit@ubuntu-yegoshin> <20150602000934.6668.43645.stgit@ubuntu-yegoshin> <556D8A03.9080201@imgtec.com> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1306 Lines: 29 On Tue, 2 Jun 2015, James Hogan wrote: > > diff --git a/arch/mips/include/asm/barrier.h b/arch/mips/include/asm/barrier.h > > index 2b8bbbcb9be0..d2a63abfc7c6 100644 > > --- a/arch/mips/include/asm/barrier.h > > +++ b/arch/mips/include/asm/barrier.h > > @@ -96,9 +96,15 @@ > > # define smp_rmb() barrier() > > # define smp_wmb() __syncw() > > # else > > +# ifdef CONFIG_MIPS_LIGHTWEIGHT_SYNC > > +# define smp_mb() __asm__ __volatile__("sync 0x10" : : :"memory") > > +# define smp_rmb() __asm__ __volatile__("sync 0x13" : : :"memory") > > +# define smp_wmb() __asm__ __volatile__("sync 0x4" : : :"memory") > > binutils appears to support the sync_mb, sync_rmb, sync_wmb aliases > since version 2.21. Can we safely use them? I suggest that we don't -- we still officially support binutils 2.12 and have other places where we even use `.word' to insert instructions current versions of binutils properly handle. It may be worth noting in a comment though that these encodings correspond to these operations that you named. Maciej -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/