Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2377336rdh; Sun, 26 Nov 2023 04:35:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLKVABxenY8uYm1sA/iFlLx/2JTQUy63zw8lzP3syiH7MDIlBctB5escN0T+SVgMt+vaM0 X-Received: by 2002:a17:90b:38d2:b0:285:b687:b82b with SMTP id nn18-20020a17090b38d200b00285b687b82bmr3264557pjb.1.1701002112341; Sun, 26 Nov 2023 04:35:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701002112; cv=none; d=google.com; s=arc-20160816; b=trsas50QPwamLeaabO0t70axStzUVtNbdP6Rmr0qr8IUmLHoDAi6uy4rOy34OfDZQy fx6biIJYmNkMAFBfXzmUOnCA0ktfaZguLqMugPr2MrEX0pUkUMxBP2vUrahPYUkOmbiD aVEbTVcpGpLQv40PRby7aCn1o4a/sZelbz/A3itW5ZmYEW431uIqNdiuhPXN+0FD1fcZ KUF66MjOynfpXCQbGxP52spYhrtqHm2347lThfQS0AUwd1v6tKM0vCYgeOT1hTCs9noF 9w75Euzu0X1QRBcniDHP+x5KWI7BCC7LnfQ24IQtvK5ow33Imq7BPhmMxc01AMu29H88 W64A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Y4plK1pWCjcHzMiproMKi9fgkNdmfmPsozKd+XMQ5GI=; fh=3La2j/pYkP+0xDmE5vJOIN+QfmeeHhFE6DUm8SiqfOU=; b=DvbfMrCAIv1l2OToWYLz3MQG7Vp8X+FjhZBRh1FDgFKv2dV1URIkQzZIB13adm5wxJ 6/QepckUi2Vifbi9UBsXvAqByOh5peZt7Tyvv1DWXiKCLsJUryHS3UmpiRz4rySqvXas P1b+4zC/3hd9+BbvI9X4E6b2zxkyt1l1mE6Q7gmQHmyjbvTN83Ar8OKvHMOxRQSdVTFH IclDh+jmpB6mvMQgDbkKVtHJsLWIARPI/tnXFdMVsT4KArapkRWHHJ18TRYO5jJPk/Xn dFC1NBqm5r2jVdr0NQCzYDQoD470seSAZSWJ7V0JLgks67vXcUtRXyXsDmlyd3IqeKU1 s1Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ovWSeHXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id m12-20020a170902bb8c00b001cfb2ab4cf6si3281457pls.163.2023.11.26.04.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 04:35:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ovWSeHXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EF24D806934A; Sun, 26 Nov 2023 04:35:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbjKZMei (ORCPT + 99 others); Sun, 26 Nov 2023 07:34:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjKZMeh (ORCPT ); Sun, 26 Nov 2023 07:34:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E9F8DE for ; Sun, 26 Nov 2023 04:34:43 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B280C433C8; Sun, 26 Nov 2023 12:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701002082; bh=M5JWFk6PhkRfznjeZqDoIn4AkQrs7NTEUWLaLy4lG2k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ovWSeHXBh0A2MZJQ/EfKKAo8vihoDaRc/mmDRXRdZQ1cymyR0CZgi2+igVHtCrM2T zqqSG8YZAp82QWv2sbNPyhWyFUsKHKpYsHcDv/yL1TwhHNn80ikMyGbRxW/AsJ3/d5 Vm6XKs9LhdGkTTqWQJnmEsmkJumf6kcCT2bhDu1akObRN0JiM0Ceexv5U37GwnqANA Dpr5xqPzxoq4wDmqbalgFplpTcuwjlLc39CQ06Tn6GYOZBUu3KNL+K+8FmVBN1Ku59 sVaVZoylBh8Q0y0qCxpzCZWRTkPcPKHQs483GcS1P5Q80sSQGesUi/xPMhvNqxbSFN PzW9WCdyeh7rg== Date: Sun, 26 Nov 2023 07:34:30 -0500 From: Guo Ren To: Jonas Oberhauser Cc: Peter Zijlstra , Christoph Muellner , linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Albert Ou , Andrew Morton , Shuah Khan , Jonathan Corbet , Anup Patel , Philipp Tomsich , Andrew Jones , Daniel Henrique Barboza , Conor Dooley , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Alan Stern , Andrea Parri , Will Deacon , Daniel Lustig Subject: Re: [RFC PATCH 0/5] RISC-V: Add dynamic TSO support Message-ID: References: <20231124072142.2786653-1-christoph.muellner@vrull.eu> <20231124101519.GP3818@noisy.programming.kicks-ass.net> <59da3e41-abb3-405a-8f98-c74bdf26935b@huaweicloud.com> <20231124115430.GS3818@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231124115430.GS3818@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sun, 26 Nov 2023 04:35:10 -0800 (PST) On Fri, Nov 24, 2023 at 12:54:30PM +0100, Peter Zijlstra wrote: > On Fri, Nov 24, 2023 at 12:04:09PM +0100, Jonas Oberhauser wrote: > > > > I think ARM64 approached this problem by adding the > > > load-acquire/store-release instructions and for TSO based code, > > > translate into those (eg. x86 -> arm64 transpilers). > > > > > > Although those instructions have a bit more ordering constraints. > > > > I have heard rumors that the apple chips also have a register that can be > > set at runtime. I could understand the rumor, smart design! Thx for sharing. > > Oh, I thought they made do with the load-acquire/store-release thingies. > But to be fair, I haven't been paying *that* much attention to the apple > stuff. > > I did read about how they fudged some of the x86 flags thing. > > > And there are some IBM machines that have a setting, but not sure how it is > > controlled. > > Cute, I'm assuming this is the Power series (s390 already being TSO)? I > wasn't aware they had this. > > > > IIRC Risc-V actually has such instructions as well, so *why* are you > > > doing this?!?! > > > > > > Unfortunately, at least last time I checked RISC-V still hadn't gotten such > > instructions. > > What they have is the *semantics* of the instructions, but no actual opcodes > > to encode them. > > Well, that sucks.. > > > I argued for them in the RISC-V memory group, but it was considered to be > > outside the scope of that group. > > > > Transpiling with sufficient DMB ISH to get the desired ordering is really > > bad for performance. > > Ha!, quite dreadful I would imagine. > > > That is not to say that linux should support this. Perhaps linux should > > pressure RISC-V into supporting implicit barriers instead. > > I'm not sure I count for much in this regard, but yeah, that sounds like > a plan :-) >