Received: by 10.213.65.68 with SMTP id h4csp1069895imn; Fri, 6 Apr 2018 14:03:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx483MVFE9eB6ws+AwVwgkNkyiV1tbplu2oS+wyopZwB2hGoFARp365Q1LfKiohxF/XxUJjgS X-Received: by 2002:a17:902:5c6:: with SMTP id f64-v6mr11230053plf.77.1523048618691; Fri, 06 Apr 2018 14:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523048618; cv=none; d=google.com; s=arc-20160816; b=sJ8qlWvKJ3r1Kmx1e6CX5Jo67sNNPykqpv2TKzZGgFqbnQ4b0s8LFxrPvbtyrXrkVY LUouTzsQsPuomF2i/7IfEMJ9QVwXmVED2dJsaTaKKZEmoNNWnY+p7bLcMm7TeYivXRVL Vh/nWjdek6gOplp0vLDHAERG9yuyq5+QIQGoQVSe0DH8o3QuHJqPcPCu7GkJp7AJ5dEk GQ6Ho07gujsJwcMQs+lpS9MSb2MdAtoSi6smeoN3Go5W6fSKFiWv4O8jmgwYHVv5biZ/ 82I7DyoUjGKBKezuy2KhkRDR+7dTHyl31C80205FJ/E/eqbN1aeAZfHKoZ1OlL4psX5m soog== 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=IuilqlHojZTGfYziPFiNhtCZtNj3R79H2walZ3hjx6A=; b=g0m6YGffuti1aRsCr8bLcnCs/7o3lg5kjY/nRhsdrYpoZIxARIUCokoAusKMGlr425 Kirk/qIiK5X2+Ftchdb8S8uP2D5vnbHqMn72LY98qknhDJeDlY/KPKOknZDtyWo1bQV7 jBg4YykqK5Hvv7T9y5Pd4Zk4xAB4N3dEbmrpLCdqSo5eGt+PxCpGIyMkEuZdln7iokNe ff4RsRKsUWxlmfTlzSdCJ7hVeJboxbXweq98XossapjpHy3wECQDyZ002OQC/WfPq7dO oLumyp/tUlop+1ZNFiC+zRf3sZhQ6ZrmQavBYZ76PDBzuHvHQz5qQvhZp8+GcOtCi+4Y KD0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rI2e8K++; 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 w19-v6si8882988plq.156.2018.04.06.14.03.02; Fri, 06 Apr 2018 14:03:38 -0700 (PDT) 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=rI2e8K++; 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 S1752598AbeDFU7Y (ORCPT + 99 others); Fri, 6 Apr 2018 16:59:24 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36928 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752487AbeDFU66 (ORCPT ); Fri, 6 Apr 2018 16:58:58 -0400 Received: by mail-pf0-f195.google.com with SMTP id x16so1592797pfm.4 for ; Fri, 06 Apr 2018 13:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=IuilqlHojZTGfYziPFiNhtCZtNj3R79H2walZ3hjx6A=; b=rI2e8K++LN9Bq0tTxh39tFjB4X4pjHN2OzldLN49+7jjesPV/hLIUS1iYcLIhnrKmU 6o2D/g+N+eoYJBiJHF03oiYLf7z7DFXeWhKFo3O9MOvm52pDBzAS/U4wn7pL6/y5C6SN L1gTTbW3EtZ35TSSpaXf6EUR0ODD6VAqSz96kgJ3KrY+lPgLzOkTCxHptSYlauBsg+1X uiDKy0PhFWKMEzjhH4RyLomvzv7VwK6cefdyBmrV0hyY6VzZRECdNUyMfXyIqpSB64EB t3jdPm65mtZuu90+KGFt4RheQFdbpwu8VKyQGEFfOYK7/Cj9ySkCWAZimVxjVcB/JGYk fNdQ== 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=IuilqlHojZTGfYziPFiNhtCZtNj3R79H2walZ3hjx6A=; b=Kyj4UVZaFNxrKr3OCrTM8TbECo4CWF5qE1yDk42how4X11E9F0Qbi1/H18BIi8g+43 5J8DS2HLUmleotS5NL7Myt6bPQunBjbyRHCEqM7mWciJE2Z5247XA14yzH0H+YaXFe7B jqDQt4Q3hLQdTTZ0oktoT+swXgCtM0u+9TtQ0wY9/gY4ZzF4a2lzLp6V+TZOiB56uy3W q3jwckWVpuTeJKKU5k9FsOqiuHBs7hDNzMIwUx35StpcH7r2fi/pBV+891unMf8MOo5l Qxeg3JIOLzsyjftp4wISemPOUSOcgDwuVlaTCdwNxasky0N4hlmxX8F7oD8Z6jq6vq/U m6ig== X-Gm-Message-State: ALQs6tBmPm2FrYjgyXpn4FJF8lPcIXD6BGsw7yHZf9sDQ/W8/EWA4ToO 0Y4QshARdbWi+fBqiplkqsE6yt75ADM= X-Received: by 10.98.163.74 with SMTP id s71mr12421934pfe.72.1523048337707; Fri, 06 Apr 2018 13:58:57 -0700 (PDT) Received: from localhost (g6.211-132-165.ppp.wakwak.ne.jp. [211.132.165.6]) by smtp.gmail.com with ESMTPSA id z27sm5422925pff.7.2018.04.06.13.58.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Apr 2018 13:58:57 -0700 (PDT) From: Stafford Horne To: LKML Cc: Stafford Horne , Peter Zijlstra , Will Deacon , Jonas Bonn , Stefan Kristiansson , Masahiro Yamada , Thomas Gleixner , Jan Henrik Weinstock , Michael Ellerman , Nicolas Dichtel , openrisc@lists.librecores.org Subject: [PATCH] openrisc: define mb() as its mandatory Date: Sat, 7 Apr 2018 05:58:49 +0900 Message-Id: <20180406205852.14821-1-shorne@gmail.com> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following Peter Z's patch ("asm-generic: Disallow no-op mb() for SMP systems") which makes mb() mandatory for SMP architectures we define it as l.msync. On OpenRISC this will flush the current cores write buffer and trigger remote cores to invalidate their caches of the written memory. Signed-off-by: Stafford Horne Link: https://lkml.org/lkml/2018/1/31/254 Cc: Peter Zijlstra Cc: Will Deacon --- Notes: - Sorry, its been a while since we discussed this patch is the parent to this still going in Peter? - I have not got around to updating our architecture spec for the TSO/PSO notes we discussed. arch/openrisc/include/asm/Kbuild | 1 - arch/openrisc/include/asm/barrier.h | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 arch/openrisc/include/asm/barrier.h diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 6eb16719549e..fea95ee2fb84 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -1,4 +1,3 @@ -generic-y += barrier.h generic-y += bug.h generic-y += bugs.h generic-y += checksum.h diff --git a/arch/openrisc/include/asm/barrier.h b/arch/openrisc/include/asm/barrier.h new file mode 100644 index 000000000000..77eaad9ba0c4 --- /dev/null +++ b/arch/openrisc/include/asm/barrier.h @@ -0,0 +1,8 @@ +#ifndef _ASM_OPENRISC_BARRIER_H +#define _ASM_OPENRISC_BARRIER_H + +#define mb() asm volatile ("l.msync":::"memory") + +#include + +#endif /* _ASM_OPENRISC_BARRIER_H */ -- 2.13.6