Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3957869pxb; Wed, 13 Oct 2021 17:04:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW4bDg/LBHIA66YPDivmeEQbISf9KS1nhJppXridCPXYkMurg28Yrgm2w8FIol8Le3q8Q7 X-Received: by 2002:a62:e40a:0:b0:44d:a86:43ce with SMTP id r10-20020a62e40a000000b0044d0a8643cemr2361947pfh.69.1634169873434; Wed, 13 Oct 2021 17:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634169873; cv=none; d=google.com; s=arc-20160816; b=XBEnkFVJDWnxWcgdzkoClv++VA4mBpwl/jeTnEAiCU+B39F1+MgUaGboGRWALEf9yo w5/BrQoeT3+Jv8bu/I5I+DQdCPLwHX4WzfRrxI3I6BtJrQH4TtFIdN4wd0F0KG2sr+jP PpiLaC+9oXjGjYhvVdUDi0zOWGH8yFIC+LTYlqjeYRU6I5fxNO5FTGh1Tn1J2qsl6d9c uKn+p3TKz8Cf1gOiQAdb4vKVn7cs4VukXISBgOIZFwx78tUgfxaPq52vejSMbPwRYorU a2gYuZ3R5+wgvmCfC/dtn2tDKZxWuNj56GcKS8rug2gCoffulbdP526j4Iq+hkYn74Y9 dO7g== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=7O0DPPXN2gy3gKrIPdr9JpfelJbeF7bWIwp+Vsrcwt4=; b=P6yQi4Ka4iRooRLtycDZty3xjoE0T6ucdpD1SW6lHhLzpXUqC1Xrk0zb6FHpuKQ3K/ ZYMNNlukigWHtE7B6ldvyTda4M4Ukrn5cHPqsVCaf9GKkjTHuOYFD9uZK7Zo1s8FiomQ UWP3uwwDGCsy+7vLlgajSQGQUcrxrggKJpv8hIV3/EIZk4+zarCNaBijEhLmb/48a14i Wm8OoOtxQWBYrvUpEM3tfIwN1gHPO1MHAUEQdkVnUFyp65U675aaPU9hcnj9HmwbEVaY Q1QLN2dmkiHD6ptT9p6ui4NrIKbdO8cV0Q++xCsaLbGrh9Iz0fJLk88D0r/Xp1ksvg+W S59Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O/DF7k+1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j186si1186705pge.136.2021.10.13.17.04.20; Wed, 13 Oct 2021 17:04:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O/DF7k+1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229931AbhJNADJ (ORCPT + 99 others); Wed, 13 Oct 2021 20:03:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:34200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbhJNADI (ORCPT ); Wed, 13 Oct 2021 20:03:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 102CF61130; Thu, 14 Oct 2021 00:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634169665; bh=xQ9stP59+c3RrHPEyY/yaAiPg7w9ZkGXGwxSUoF2MVw=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=O/DF7k+1QM3CpeeavAORpDv+Hqz1sK1IiUF++fkBYOevSWBTLRxeKpTNlSSbOnFqJ v9SxsTLSfRqZqH+UfaZWpupsXZuZozXZwDIu20OOuFy8QG9nTPGNi7aZ2Wb8XNTmPI ImiIXG8CajWHoF0hTIsbxa+A2ev1O0b3XvtKatBNQQHgphF7Dkl/dcspIf6apn1s02 0mjD43ySwEW2SysU+w3U+X602Oj2dCe+nuGJcPI6rTtiHzKaZp83oobOwJIH+Z9eIo GujymaYUU3N4qyUXk0hww+iVJZ8tZ5Ah07z5PFCtLRmsC9/7UYsXK76gwG4h8fT6Wo W+0mGANd7TRCw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id CAC0C5C14F7; Wed, 13 Oct 2021 17:01:04 -0700 (PDT) Date: Wed, 13 Oct 2021 17:01:04 -0700 From: "Paul E. McKenney" To: Florian Weimer Cc: Linus Torvalds , Mathieu Desnoyers , Segher Boessenkool , Will Deacon , Peter Zijlstra , linux-kernel , Alan Stern , Andrea Parri , Boqun Feng , Nicholas Piggin , David Howells , j alglave , luc maranget , akiyks , linux-toolchains , linux-arch Subject: Re: [RFC PATCH] LKMM: Add ctrl_dep() macro for control dependency Message-ID: <20211014000104.GX880162@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20210928211507.20335-1-mathieu.desnoyers@efficios.com> <87lf3f7eh6.fsf@oldenburg.str.redhat.com> <20210929174146.GF22689@gate.crashing.org> <2088260319.47978.1633104808220.JavaMail.zimbra@efficios.com> <871r54ww2k.fsf@oldenburg.str.redhat.com> <87y271yo4l.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y271yo4l.fsf@mid.deneb.enyo.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 10, 2021 at 04:02:02PM +0200, Florian Weimer wrote: > * Linus Torvalds: > > > On Fri, Oct 1, 2021 at 9:26 AM Florian Weimer wrote: > >> > >> Will any conditional branch do, or is it necessary that it depends in > >> some way on the data read? > > > > The condition needs to be dependent on the read. > > > > (Easy way to see it: if the read isn't related to the conditional or > > write data/address, the read could just be delayed to after the > > condition and the store had been done). > > That entirely depends on how the hardware is specified to work. And > the hardware could recognize certain patterns as always producing the > same condition codes, e.g., AND with zero. Do such tests still count? > It depends on what the specification says. > > What I really dislike about this: Operators like & and < now have side > effects, and is no longer possible to reason about arithmetic > expressions in isolation. Is there a reasonable syntax that might help with these issues? Yes, I know, we for sure have conflicting constraints on "reasonable" on copy on this email. What else is new? ;-) I could imagine a tag of some sort on the load and store, linking the operations that needed to be ordered. You would also want that same tag on any conditional operators along the way? Or would the presence of the tags on the load and store suffice? Thanx, Paul