Received: by 10.223.171.82 with SMTP id r18csp17377wrc; Thu, 22 Feb 2018 15:16:03 -0800 (PST) X-Google-Smtp-Source: AH8x2256W64RHpB7cuV8x1+TOScNh5DSBe5HSQMjGFzWy7xPkqk3dbCTb1hSPHzS6NKkwKKCr/sb X-Received: by 10.99.116.90 with SMTP id e26mr6771424pgn.16.1519341363322; Thu, 22 Feb 2018 15:16:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519341363; cv=none; d=google.com; s=arc-20160816; b=y4hoZ2nANvXnpfWwdupVuz9V2lceeQ4jyqwncdZhnYPGJ663ZYGeoAfoI7bTiTWKXb BvjrURTjtOp2X60/jzz0yF7NlGdxT1Vba+6UJVMDp9Oo+wd6Qg/4gvljqvUabzxipN5V bry9nSkfWyqbsupxxQSbs0w4eCsWoIErh1sEE7Kx27A130RssO/qwckfSTGRMzfEUflt p6zlh9g1DjB0NidNS06S8f8fdKjwzuW6CHi0FzJo1Pw7e+FkBNDquBF55QqDAhI25SI8 9JuTdiF277L4ulJypRRDgGlDcgLbmLEwc3cn/JzseFGQaMEToTbpKkdTbeznRPQmnBaD oTug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature :arc-authentication-results; bh=ZCBwA6EOBgiHRuJBzZnFRrQbbpp7dS28phVCDFqeu8c=; b=ziEz9f8VstuZlbj9I428oOBhhr5s7bHjL6Ya1vvOxVxAgcI4lZueIBBZXkQbacpT9c erE1OuWjbLgThacdhOnC+W0Y24GOHrLtjWVKKnHqv3inwRNaIoGBQwi8UmKvg3xAUG34 brL1GByVqecTq/AS1BDYZITbQPtB9jKOWLkRTi7cpzBXfkwSWgM5cW9SZ9+2YM/MKD0T kPW1QWvChwC0Seg1GEPdHw0eWjw8kCE7N0SJTH3LRJWjeMLWZoYQCCUwzz1G7AdrKoDn mEWFugeUlc6ttadsh8p7NNAC7eZFtzsAtrGNTGSe02G51wCf6KfuasLvJHcBuwQlWks5 Ymbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=FzZgFfLM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4-v6si746217plp.253.2018.02.22.15.15.32; Thu, 22 Feb 2018 15:16:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=FzZgFfLM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751920AbeBVXOy (ORCPT + 99 others); Thu, 22 Feb 2018 18:14:54 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:44036 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbeBVXOx (ORCPT ); Thu, 22 Feb 2018 18:14:53 -0500 Received: by mail-pf0-f196.google.com with SMTP id 17so2710807pfw.11 for ; Thu, 22 Feb 2018 15:14:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=ZCBwA6EOBgiHRuJBzZnFRrQbbpp7dS28phVCDFqeu8c=; b=FzZgFfLM8dDWhHCLl5RpGQkg7/Cb5IFVA47bHRShrNsNv1b6uRz874ZVPLOs2LP83S C51mrqTHinIMqv5WOqDtqIS4xIhZQhNjumgXHdjy+zk24rMiUEUTuAFC79fAoMIwUNHP mQpBDJQ4tTtHeRS3MA5POnz3xzw25C960b7y4hr1EekvswuhvJWyJK7Koj3/Fa7sKWSo XuYKd0UKo3B1vGkn/bEpA31KXXP9Lt/9+gueWOw59OXNQ9vHRnKL+5VyZTjkFueRhRF+ Xcmca5aGJvI+wMN6HesiPgccPX2T7/wJeFUZlb1PQXf1WRMdfssxAkWaGsuidpLQm8TW 19pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=ZCBwA6EOBgiHRuJBzZnFRrQbbpp7dS28phVCDFqeu8c=; b=Z4vzQcQcM/hmaEt7thv5aRAR8lCUABeHCsBO4Of5+Ysk597pC1XfvcZX0jAqXvPXpx rq/v4swQvTUFzxxbW4ABW1SZiRS8zX7jPXheXISF4KGYpmM0BsoXdRVCLUjYUU4nGCwe 9mFnLPHyPEG6859NG6slodbxuAAmAcle5sSQrxBPRclRN4/85Jl2NbWD8cjXcM1T/VH8 v/GoZs6egqRR9XuMwugitM5eUQo7+e9eq1uDjrgDsMehUWuFo2TmCi1mtTlTf/pGPYOh dy6qdcp3impsbvTeKsRFkkIv61+YzouVU8XUeiG8DEl7BitjLelGxGufE8FayNCrSFWb UKfw== X-Gm-Message-State: APf1xPCM/06gb53AmYIGpovyQSVT5xKKMRSBTisZLw7q/IYDPRYb1jHC 1wTqUSXSECRCnxtdIxaKNs6oOrYhSa4= X-Received: by 10.99.157.193 with SMTP id i184mr6804324pgd.197.1519341292756; Thu, 22 Feb 2018 15:14:52 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id p123sm1703170pfb.6.2018.02.22.15.14.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 15:14:52 -0800 (PST) Date: Thu, 22 Feb 2018 15:14:52 -0800 (PST) X-Google-Original-Date: Thu, 22 Feb 2018 14:58:37 PST (-0800) Subject: Re: [PATCH RFC] riscv/barrier: Define __smp_{mb,rmb,wmb} In-Reply-To: <1519121848-28582-1-git-send-email-parri.andrea@gmail.com> CC: albert@sifive.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, parri.andrea@gmail.com From: Palmer Dabbelt To: parri.andrea@gmail.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Feb 2018 02:17:28 PST (-0800), parri.andrea@gmail.com wrote: > Introduce __smp_{mb,rmb,wmb}, and rely on the generic definitions > for smp_{mb,rmb,wmb}. A first consequence is that smp_{mb,rmb,wmb} > map to a compiler barrier on !SMP (while their definition remains > unchanged on SMP). As a further consequence, smp_load_acquire and > smp_store_release have "fence rw,rw" instead of "fence iorw,iorw". > > Signed-off-by: Andrea Parri > --- > arch/riscv/include/asm/barrier.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/include/asm/barrier.h b/arch/riscv/include/asm/barrier.h > index c0319cbf1eec5..5510366d169ae 100644 > --- a/arch/riscv/include/asm/barrier.h > +++ b/arch/riscv/include/asm/barrier.h > @@ -34,9 +34,9 @@ > #define wmb() RISCV_FENCE(ow,ow) > > /* These barriers do not need to enforce ordering on devices, just memory. */ > -#define smp_mb() RISCV_FENCE(rw,rw) > -#define smp_rmb() RISCV_FENCE(r,r) > -#define smp_wmb() RISCV_FENCE(w,w) > +#define __smp_mb() RISCV_FENCE(rw,rw) > +#define __smp_rmb() RISCV_FENCE(r,r) > +#define __smp_wmb() RISCV_FENCE(w,w) > > /* > * This is a very specific barrier: it's currently only used in two places in Thanks! I'm going to take this for the next RC.