Received: by 10.223.185.116 with SMTP id b49csp461024wrg; Tue, 20 Feb 2018 02:18:53 -0800 (PST) X-Google-Smtp-Source: AH8x2264ShHCaWsUw+lKEaoa/PSc45D2N6q73/0aUl/TlGAfHNXtGp94nWazFfemmWjGY8FmIN00 X-Received: by 10.101.66.1 with SMTP id c1mr444510pgq.137.1519121933399; Tue, 20 Feb 2018 02:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519121933; cv=none; d=google.com; s=arc-20160816; b=iO6B3f1x9XEwmGnaagNL44XKjyJfq1Mzb3/9t9SrDuVmr3E7UDZaCHev9XPnEU2EzT C6CdUF5LbKUeUa4jQHJuYVN/I+nRgjzIgGBwqWjKVtEg4ZvSCeJdHt8ha1yn61/VfuWk oKvuNjxuXMCVanztpds/3oGdOAaoXQEpdmiYJ5ESqvo30V8FOh8gm56D6AJP91DyfJpP tYTd/nO0nm75aFGWT0XMleTFFBg7oSphrd3WFgnA0+xh1gisKxmpYFHTYRHqPxN2PMII YhQTZ7eyqjaleI3qa8kYi3PQzIddREasURvMel3V0oRGtxnbJ2u7L+DsuMoKlKloIwbK pmLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=hDHghfNAOck2GvvCBOgcuVThgfm0YW0IKpORYbhjlv0=; b=eeaYpuDZ5kQ30ElXTrkZJPRCoJUI4Qzedh4CsRi4JstiL5WMy4s/miOsAy8Cjad+uY NEJFjhx31uf03umtP6acBk1sJq8LXBjGnYkeb5/06qDbcOuuC/3DzEQid76xQMvgAVpn Zee3lz6+iG13JijLZcj4t0NAsjgl0lNHvKtS3ANUG9razunGdyHaf7psqFrYfytYLvX+ 1Or2Z4nL1BGwTrSvoSMYXM1CCKBqmrXh1HzVMcXZuj8fqHTJ8YdBeHqWnosOzd661IuG aVVCO04XNp0EKRE2DjpFHT3Lg5ppLdercYCEfXBp5NPmh/XrBul9wFCudhMaY+7p4/rs BhEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PcSWsn6X; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si1117082pfa.168.2018.02.20.02.18.38; Tue, 20 Feb 2018 02:18:53 -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=@gmail.com header.s=20161025 header.b=PcSWsn6X; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751402AbeBTKRp (ORCPT + 99 others); Tue, 20 Feb 2018 05:17:45 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:41339 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbeBTKRn (ORCPT ); Tue, 20 Feb 2018 05:17:43 -0500 Received: by mail-wr0-f194.google.com with SMTP id f14so8290971wre.8 for ; Tue, 20 Feb 2018 02:17:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hDHghfNAOck2GvvCBOgcuVThgfm0YW0IKpORYbhjlv0=; b=PcSWsn6XuWUg3Q0imxMCcOUcEpYaNNFhM6FwWGjewH5dTvXaKmheObfndHkEN+tG7r DIlSnwn7hjQUw+YMMRD26ll03i5IMmwnx0wvJ6TFuedwpSPKhYd/C9N5Nhr9owwGHtsP t8Gnhbjy7sJNq0YF4zdsVRoeiLws6h9+9Polxmx2VFFfELP3/6NEe1pmvlmgjHEoop5r rrcwvvrTbT7o2gPaRa93apNThRqpIH5Bzoc84HDEepD0jRAYJFg/+xiDT+UWTZHwD5gs N6uAN4nAUsPtqadY4WasrPnedDsG9gB6ejwLJtO9HYyAAgm5N9R38FlV4JUvyKa2w4zZ XNOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hDHghfNAOck2GvvCBOgcuVThgfm0YW0IKpORYbhjlv0=; b=aM04BgKcuV6Pg90xHFqcQDHvnG8QWUiGJtzgEDHCh6pUUVUlcyPww0/0M68si418hA vLkLIhHwinm8qqxWaZ8x0rFffpeO9LmlB621tGHHTlk3kQPgQ9iRsxJ1T/MmIEXlNVHz 9vjBNe8BMrHb7tEKPjCtuqo0Ym3LB9pHfVXme98ovJDm14w9UADGBDnBtiJxgrTWTHjx QXjPvzSU4Nyk5k/NZ+YPDoqp1MqHcgLgK7uvTDcPEXLErVAkWZFb9f/ZJfjnO2IW5fpu +d16NJR7/OYZkOvAAhJL86s+xmvkSYdnmwKQGeX0YB12BBXjuVr6/jme5fllxVjOJDJ6 lwlA== X-Gm-Message-State: APf1xPDpVTO3+EwsPaHfsOBGleghwLW9PB83u5PghZ8YzUD7JqIKMTVX PXdkBu+30HDQZowPJtjs8BLNsxKB X-Received: by 10.223.139.131 with SMTP id o3mr8392381wra.279.1519121862348; Tue, 20 Feb 2018 02:17:42 -0800 (PST) Received: from andrea.amarulasolutions.com (86.100.broadband17.iol.cz. [109.80.100.86]) by smtp.gmail.com with ESMTPSA id u22sm30941140wrf.86.2018.02.20.02.17.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Feb 2018 02:17:41 -0800 (PST) From: Andrea Parri To: Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Andrea Parri Subject: [PATCH RFC] riscv/barrier: Define __smp_{mb,rmb,wmb} Date: Tue, 20 Feb 2018 11:17:28 +0100 Message-Id: <1519121848-28582-1-git-send-email-parri.andrea@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.7.4