Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3854161rdb; Mon, 11 Dec 2023 01:44:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEeunaRRMaAbklbnwsk71ha6I830TZDHl4xFgPd+kZa2oz13S4j4KfoFqaHsakMOlXIjigg X-Received: by 2002:a17:90a:5787:b0:288:966b:9f41 with SMTP id g7-20020a17090a578700b00288966b9f41mr1505113pji.22.1702287893801; Mon, 11 Dec 2023 01:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702287893; cv=none; d=google.com; s=arc-20160816; b=g+u7RTQq8xiak8W2FcbZgWfMcxzS8DZoyABgDRvNiJOfKE6vJ+Y1qV76t12h1F4nyE fOvhyMrNFHKYBNyEKO/bw2AgrJMgDZsYBt8LgiKssveCd+fzgXbuCzmV2OORS7XYaIUM unTCmFQP8YMaGEFUiFNqQEZbUgC0pDdA/0bubUxF3TALiafqPYfGBZQ/M6R+pMkMV5NJ Z/2pw2PVC5uKcnIvSZm+4ysAYsHo5T+uGghyBS884cgx5yFhDAbQBjnn/1wl+sTW0Nc+ yDacTi5wbfR2+cr3b90hquHR9mJIPyJMZZ9CG/RbjKQ7ky+0CewIO2BPjUmjzaY3pFe/ fHaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=AkVX/kO8wR8tFky0mjPSXH+PwnVI8mpjAOkFM1M+MLk=; fh=6I8UF0n155JlUMKXPHZEdVXaDDfdWw9idVSmXg1+KEE=; b=y9FlhP2JNzVt28uK5C/wxDeMSh3IA8/8YLmA+nb0U9eoKC3TQv2M2Q2TQO9/thsBiA D7pmHiHmaXuZkqAlK9VThgoiOHRrayMgVxcD0ccsHcimCPYMEwmzYgx3nJgzAfYFDo7l GiMFaDDnBllkwE0hduLK4UkcfiWHQuPGo00mSqqnPK6v/9XL+s0CXEinnGxq4MtGVB7T 97IpWekAwA7bUYo2sZznzeztrK20PIIpENNhskCE5ekvffEMxc3K33ZXl8Dha5PeDwJx A7IIA4ppB2qmNTtOx7SMBtQ31GTSMgfn7tDD10cA9oXxlX82EIUX8lZbsRi8z4qboWAZ WG7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kV4gTIcE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d3-20020a17090ab30300b00286785e0bfesi7306929pjr.147.2023.12.11.01.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 01:44:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kV4gTIcE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EA3B38062938; Mon, 11 Dec 2023 01:44:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234621AbjLKJo2 (ORCPT + 99 others); Mon, 11 Dec 2023 04:44:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234468AbjLKJoZ (ORCPT ); Mon, 11 Dec 2023 04:44:25 -0500 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08ACBE5 for ; Mon, 11 Dec 2023 01:44:28 -0800 (PST) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2c9fe0b5b28so53822071fa.1 for ; Mon, 11 Dec 2023 01:44:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702287866; x=1702892666; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AkVX/kO8wR8tFky0mjPSXH+PwnVI8mpjAOkFM1M+MLk=; b=kV4gTIcEl1J3LFI+Xst4+SECU6vohdQ32uj3LG2Km485KNGX0EAjEmLfI9NUe6EhSw /9uVPzZLGs5PAdF3TMizL2sFp0wMKMbcwxTrvr/Q6OcNUlcChZhJrQ+orAvmZ3IL9lgZ QFyQTzScYpWvGUYV45qc7DyTc63ooCT0Lg5bdKbot1xjVQE9l0oujGcZlsAKNkD3ThpV hLLvBN2/l9ovPxl938SfSof+y/os1dw1nBo0iPMZeQGjdpeKwi8Qo0R75PrevsNHxhy0 rHmChucbPJ3RWVFYhyPzn5c2OgVS9TNNqDXzLcF2Rx4FzIWTuBQ7p/seGUllHlUCF8nQ pxQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702287866; x=1702892666; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AkVX/kO8wR8tFky0mjPSXH+PwnVI8mpjAOkFM1M+MLk=; b=AfJaPzvpIpY1jIlCl01Y0TZMVT83tojjGShQFJJ98Xw3mifYkj5BP/cZEEHdwlQcO5 ECPiP818Si6Ii0iwtZsPnOXAc72Q2udqM/qghfEZtWVmQU2B7FrULXmQOs7pO8rbCc+T 5T+IJ9wKAHkLKMWXlBJo0/Chpv8AMIKkTq+DAW4pUSPzgv9zVRXBY7isSJml7/E8Qk7Z eEQILrENAxizHcoOzSZuI6BMc8uWt9tfg2K9eRZBKYCQxiuue010OcaQq/UQ6tr/gj8q RPlUzBrzzs57v+qJw9cjOmjCYpr1GzMC5Q4t1uOOW7pdxmm57rRdczIOvQ+YjScoMDLt y4AQ== X-Gm-Message-State: AOJu0YwUgl5s/l4z8HYUlkbqa23lXqxQmMJmIsgbY21T4AHccqPJNH48 HyAKAaOYeXPWnAZOi/JmaNI= X-Received: by 2002:a05:651c:b09:b0:2ca:68:acf6 with SMTP id b9-20020a05651c0b0900b002ca0068acf6mr1588150ljr.88.1702287865734; Mon, 11 Dec 2023 01:44:25 -0800 (PST) Received: from andrea.wind3.hub ([31.189.124.152]) by smtp.gmail.com with ESMTPSA id if3-20020a0564025d8300b0054afcab0af2sm3463505edb.59.2023.12.11.01.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 01:44:25 -0800 (PST) From: Andrea Parri To: mathieu.desnoyers@efficios.com, paulmck@kernel.org, palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu Cc: mmaas@google.com, hboehm@google.com, striker@us.ibm.com, charlie@rivosinc.com, rehn@rivosinc.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Andrea Parri Subject: [PATCH v2 0/4] membarrier: riscv: Core serializing command Date: Mon, 11 Dec 2023 10:44:10 +0100 Message-Id: <20231211094414.8078-1-parri.andrea@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 11 Dec 2023 01:44:51 -0800 (PST) Changes since v1 ([1]): Add patch 1/4 to resolve the "sync core" scenario reported by Mathieu in [1] and meet the requirement of the membarrier "private expedited" command. Miscellaneous improvements/additions to documentation and MAINTAINERS files. Follow up on Mathieu's suggestion in [1] to introduce a Kconfig /feature for the latter command (patch 4/4). N.B. Patch 4/4 is in RFC-mode, the plan being to submit this patch to the various archs/doc lists (more likely, as a stand-alone patch) once I've got some ack/positive feedback from the MEMBARRIER maintainers. Andrea [1] https://lore.kernel.org/all/20231127103235.28442-1-parri.andrea@gmail.com/ Andrea Parri (4): membarrier: riscv: Add full memory barrier in switch_mm() locking: Introduce prepare_sync_core_cmd() membarrier: riscv: Provide core serializing command membarrier: Introduce Kconfig ARCH_HAS_MEMBARRIER .../membarrier-sync-core/arch-support.txt | 18 ++++++- .../sched/membarrier/arch-support.txt | 50 +++++++++++++++++++ MAINTAINERS | 4 +- arch/alpha/Kconfig | 1 + arch/arc/Kconfig | 1 + arch/arm/Kconfig | 1 + arch/arm64/Kconfig | 1 + arch/hexagon/Kconfig | 1 + arch/mips/Kconfig | 1 + arch/powerpc/Kconfig | 1 + arch/riscv/Kconfig | 5 ++ arch/riscv/include/asm/membarrier.h | 48 ++++++++++++++++++ arch/riscv/include/asm/sync_core.h | 29 +++++++++++ arch/riscv/mm/context.c | 2 + arch/s390/Kconfig | 1 + arch/sparc/Kconfig | 1 + arch/x86/Kconfig | 1 + include/linux/sync_core.h | 16 +++++- init/Kconfig | 6 +++ kernel/sched/core.c | 9 ++-- kernel/sched/membarrier.c | 16 +++++- 21 files changed, 204 insertions(+), 9 deletions(-) create mode 100644 Documentation/features/sched/membarrier/arch-support.txt create mode 100644 arch/riscv/include/asm/membarrier.h create mode 100644 arch/riscv/include/asm/sync_core.h -- 2.34.1