Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp958161rdb; Wed, 6 Dec 2023 05:06:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IErQeDLqoDEotdiELaKnICjl/Hk6fQRbx/nnZtl5FVjZzvjFgwvfOhWckNJ21vEjHYhXEWe X-Received: by 2002:a05:6a20:9146:b0:18f:97c:b9fe with SMTP id x6-20020a056a20914600b0018f097cb9femr582672pzc.88.1701867963435; Wed, 06 Dec 2023 05:06:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701867963; cv=none; d=google.com; s=arc-20160816; b=EQWxkYIbmTWF4YWgWsf9Btn2MsgFXbp2Z4KDS44etxxc7ll9FbAaBCY3mlk7Pjla0A pQwMiXumhqVxbDNHfuiAsqpcvd8m2oa+cv4swPRjlogXGClyu9f9UbZmSb/2pKnV9ekZ 7BY+Bu42S92ccTtVisQaXPoPKqw66/sOKcv9ttqNzWqXyXdWTmgCR71VqeOL5+hly0k2 ck0jEl5s4JReSHqw2OTsR4WFHdhbLkj4t9UsZfbH3C7vsf3JCIzLpHol1vZyO2qg2FCX TbcG9S7QzLh02lbKEvQe+Au790GIC9gxhX4z4+slt/rUOwrbax5MKB8c0eQav1irma3Y FfUg== 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:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=vzgbFdAZtuGUcSvqWCnnqwHA8w3xAQKY5QSWn1ivO1Q=; fh=wfLuxy7+aeBxWTWNe0TWuu/y+laUOmu+yyLHrUPd+Tg=; b=oNpQyLP/ecz0eygtUPyby5LcVfF1VaUqQ6HRzdbVfIIxbpFNUppF+mH9IpNUYgK/oV 69fQZZ3WPT5x1bLm6a+UhpyQA2U4hVmVvDcxvw+19EwBKl5mwyiFfWSFNXOpAwgd0crr lA3JvXXa0Nbj53K5ml7bvBJ1X3mYlR5NlaBTfGzWfpFy2THC3+GY8Hzc23tMvvtwbYoz LgWybg9zX49XmsDS6UiEkW7Mt2TduXtfJ6+phzgg7L2x6yZnp2I9Bsd2P8heja/aWxYD OKH/Af/B+xSnUDrjaltM7RlAVn+yzyGqOfzKC8oVC8GvV+5wjg/GhtAFyPpV07bJJGhM a26w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20230601.gappssmtp.com header.s=20230601 header.b=0jGVZKjJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l65-20020a632544000000b005c1739564f7si7078872pgl.351.2023.12.06.05.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 05:06:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20230601.gappssmtp.com header.s=20230601 header.b=0jGVZKjJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7BC7A81BB1A2; Wed, 6 Dec 2023 05:06:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378392AbjLFNFp (ORCPT + 99 others); Wed, 6 Dec 2023 08:05:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378112AbjLFNFn (ORCPT ); Wed, 6 Dec 2023 08:05:43 -0500 Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E7CAC for ; Wed, 6 Dec 2023 05:05:49 -0800 (PST) Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-1f060e059a3so3789208fac.1 for ; Wed, 06 Dec 2023 05:05:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20230601.gappssmtp.com; s=20230601; t=1701867949; x=1702472749; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=vzgbFdAZtuGUcSvqWCnnqwHA8w3xAQKY5QSWn1ivO1Q=; b=0jGVZKjJMkR4k3SzhwUcmsr1ARpdtEuHE5otTODLVzyQWKIMd/b+gbSP2urj2UbuD5 44lqgzcofE+vH/7OioWTzJ3ZfVIkCLB7J6oeEnBJz0JIzLtLNlpnWDOmRn3uqTww4sNo GZWebmKeRCV4oYnPSdQavq+c2XYkQoq2HJ0/+rGwxfkdRVY95zZd7Lb/vIeKnqX+rF4B a/YBqba9L8RgtkB7UtlvE0yCG3H/M7OR3Q1o32v6f6PqBK6whJ83IpjNYHtyNDV1huml QBdvokDAbwrhWjMic0/AwZp157Zbw1skcuxTyaSeu0mF75xFBZJInrlV42Y8BCKdOP0l JdSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701867949; x=1702472749; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vzgbFdAZtuGUcSvqWCnnqwHA8w3xAQKY5QSWn1ivO1Q=; b=Do/Q9GgIsl17iEffsjxTqAcxik3HwG6ETE3noIHuadAAR93xSwEZUueqxGfpt6wnDw Gt3iLKWNTgxfp/KNWH7QOqO1dKZ6nY4SMc7oaW3xeHHz738IgOWJMQ/HHSrbNDo6XKia QAqT7pOYeFn/068xs8GnaXGbiiKV6SmgPYwhhA0oRl09SK7fdUd9IJ19BaRs60YCFZUt ZSkmJZQm0fNeSyi40OVPmd5DE6fVdCBlFwuwRhYOJ1CZAjawbDK+Pceb2u9gRyN14J+p WH1izNNHaGJl/PENVW0ADdhbP7N5WenFNMEutrJ98feN2rifpBU9r3HQjeSrdJGkge6G i/nA== X-Gm-Message-State: AOJu0YxjrLl0/2o7dyVB0GGINZOAURV8Y4jE6sEMoKegPJdxkaGt3jPW 3HduVPeg0c4UvncjY7z14yhIgA== X-Received: by 2002:a05:6870:9e82:b0:1fa:df52:beb4 with SMTP id pu2-20020a0568709e8200b001fadf52beb4mr1148224oab.32.1701867949085; Wed, 06 Dec 2023 05:05:49 -0800 (PST) Received: from localhost ([192.184.165.199]) by smtp.gmail.com with ESMTPSA id gy26-20020a056870289a00b001fb3240116bsm2094303oab.7.2023.12.06.05.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 05:05:48 -0800 (PST) Date: Wed, 06 Dec 2023 05:05:48 -0800 (PST) X-Google-Original-Date: Wed, 06 Dec 2023 05:05:46 PST (-0800) Subject: Re: [PATCH 2/2] membarrier: riscv: Provide core serializing command In-Reply-To: CC: mathieu.desnoyers@efficios.com, paulmck@kernel.org, Paul Walmsley , aou@eecs.berkeley.edu, 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 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 06 Dec 2023 05:06:00 -0800 (PST) On Wed, 29 Nov 2023 14:43:34 PST (-0800), parri.andrea@gmail.com wrote: >> > So I should probably stick to 93917ad50972, which apparently selected >> > CONFIG_MEMBARRIER on RISC-V, for the Fixes: tag in question. >> >> I think it goes further than that, because you can explicitly >> CONFIG_MEMBARRIER=y, see init/Kconfig: >> >> config MEMBARRIER >> bool "Enable membarrier() system call" if EXPERT >> default y >> help >> Enable the membarrier() system call that allows issuing memory >> barriers across all running threads, which can be used to distribute >> the cost of user-space memory barriers asymmetrically by transforming >> pairs of memory barriers into pairs consisting of membarrier() and a >> compiler barrier. >> >> If unsure, say Y. >> >> Before 1464d00b27b2, riscv just happened to set it to =n in the defconfig. >> >> I suspect the initial port of riscv merged after v4.14 was already broken. > > I see. Oh well, guess I'll have to leave this up to the maintainers then > (I believe I've never managed to build riscv that far), Palmer? I see $ git grep "config MEMBARRIER" fab957c11efe2f405e08b9f0d080524bc2631428 fab957c11efe2f405e08b9f0d080524bc2631428:init/Kconfig:config MEMBARRIER so IMO this is just one of those forever bugs. So I'd lean towards Fixes: fab957c11efe ("RISC-V: Atomic and Locking Code") (or anything in that original patch set). It's not that big of a backport, so I think it's safe enough? >> > I'll look into adding the membarrier feature you mention (as a final/ >> > follow-up patch), unless you or someone else want to take care of it. >> >> I'll be happy to review it :) > > Sweet! :-) > > Andrea