Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp658633pxb; Sun, 10 Oct 2021 07:57:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIWu99xYeGD173IRvhROLQziIlwjbF+a4ieCtwRaCLl2VTevjSbYJC5njg+TL83YPDRYRi X-Received: by 2002:a17:90b:1bce:: with SMTP id oa14mr23757811pjb.191.1633877825425; Sun, 10 Oct 2021 07:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633877825; cv=none; d=google.com; s=arc-20160816; b=xSIulc4cYRo0KnDoJBaKRI4w7zUVZpDzNdui2LY6cyyPX/O6rMOLcPXsRWfG/2pvSS j5EhJNvRh4/InJwQSjbGWvMh+NUTiF4Rs9sRXF1gAqVSdxiT/9Ka0CxmSZMuvstO8BTD 2X+kFq0hCrC6qEPEfS6KPqA4CP8pGieK4gQprbv6rmE1EDU30dlDwlL/67wjrOwHWNAR 9MouXuc9D0ZUIyzQIM4iLGhda+SDVhcCNliTVD8rhhlRregLwXRY5BbirRY4w+vJN9L9 hFgdrtRLNk/6sGdnOI8j+D9+JjqSDtXwI8KIcuUMgB+7B98tHhRTDhd1uDmyYEbMxUvh pDfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date :references:subject:cc:to:from; bh=g0gqcf/asOqICmfg5rJ4AW1RoxbETT6XRm05pPR3/30=; b=XNJTr/DKjN/8AloIx3vAeQGg7eSPTGZGw6fngevIAEi4cP9PqgKn9ccYuU8PEv6KxG 6sjRBAsXfe/N2t7g8KcY0sd6Bh3tiD9kIZyWI21blyK2YIhgjD5Grq2TuRvbGCUiAnvr O3bQOS2HVO1rGeKIDpUrz3OyBJAQNAVfCrbR8WCV+SH/Y5HzYCicqG8TeMKSYkDZ0Tz4 gsIQd0HJV12P0gbVHdqZObmbX9TdDtPdR72+0q3cwEAwl1MqtVQuMxK/NeJn7XGYVfEp L3mzn83gJmOueqGlI4rAvDkymv0hfJll0dj39aYq6ESMDEHEBngohzV2x3lsorNljzfn 6LLg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si6707595plm.457.2021.10.10.07.56.52; Sun, 10 Oct 2021 07:57:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232865AbhJJOKD (ORCPT + 99 others); Sun, 10 Oct 2021 10:10:03 -0400 Received: from albireo.enyo.de ([37.24.231.21]:55352 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232494AbhJJOKC (ORCPT ); Sun, 10 Oct 2021 10:10:02 -0400 X-Greylist: delayed 332 seconds by postgrey-1.27 at vger.kernel.org; Sun, 10 Oct 2021 10:10:01 EDT Received: from [172.17.203.2] (port=53125 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1mZZOs-0005i0-H2; Sun, 10 Oct 2021 14:02:02 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1mZZOs-0006bz-4t; Sun, 10 Oct 2021 16:02:02 +0200 From: Florian Weimer To: Linus Torvalds Cc: Mathieu Desnoyers , Segher Boessenkool , Will Deacon , paulmck , 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 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> Date: Sun, 10 Oct 2021 16:02:02 +0200 In-Reply-To: (Linus Torvalds's message of "Fri, 1 Oct 2021 09:35:47 -0700") Message-ID: <87y271yo4l.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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.