Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3473711pxj; Mon, 7 Jun 2021 11:29:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL8ZVHv3Q1GZ74rLnoyKwkWUxPcEsxosfOBWrnArCLEbgzWf561cqaMm/bmKiADITvjaNr X-Received: by 2002:a17:906:a890:: with SMTP id ha16mr18504467ejb.159.1623090573701; Mon, 07 Jun 2021 11:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623090573; cv=none; d=google.com; s=arc-20160816; b=OAVN/7bYzS+Kmt8nK28Ys/lP8bqiV+/C3IS0txsSZKyE7tjPJwG988k5ipqVTQnKZ3 kMtH1bOh7ByBdLjEaFigR9D5NuWxcdv0JhGqc9VuJuc0uI8xlJpPfaPlkYeiuIhWW91V aZUe2h2Ad/SJ+amPq42BSe/A7/GorrN+rheZU21Urv7CnOw9TRoDNPPTMCZZcQIzDq2r wkVS4Uk0KYxQ5TA+SYSA0eNnVXdhBqwRJdjOHciPrUgzphGRFb4aD7MkPi14NGGP1dFh cOgDsoQt9Mp/tblSCIVH1N8TTRJNUgoMI79BI0dvrCznQMfG3YhxBnoW7E0cBCVHWyGy bhEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=C/wbcVx9u/g9h49eJjoQXi1N3+GXq2Ts3mWH+3HFQOQ=; b=XzhPFvlWF8R85UKWNkDtmNu8wAlDjEv9TXpLroVRkA3hdWEzq4t93hhQ7sNeJeY5+B oE4O5SmwpWnWNH8tbBqXWHc5pDhfnDiZWgwmMrpWUG4gjIZyYk6UU4Y2YZVpbVy3lSe2 ++nhsRDjXXwuVDq94aAlXAuyttHQGiSv+hy8cO77kP6oWGPguMoIJrM9poKU5x3SoIla 8MhWyqFNG9LI3Tf67aM2jUQ7pCYXAjThfkMjmkJM55+MsV80JG/qDT9Lv6XIKYAKna7X i6DLKil7xRhMh4w3U5phN8vB3J39uscM7PHt080pzgHyIk4ecmPGGXRdJQ0zDY0edFAr IDbQ== 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 y15si10873865eju.51.2021.06.07.11.29.09; Mon, 07 Jun 2021 11:29: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; 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 S231177AbhFGS3o (ORCPT + 99 others); Mon, 7 Jun 2021 14:29:44 -0400 Received: from gate.crashing.org ([63.228.1.57]:40897 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbhFGS3m (ORCPT ); Mon, 7 Jun 2021 14:29:42 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 157INap3017668; Mon, 7 Jun 2021 13:23:36 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 157INZNS017666; Mon, 7 Jun 2021 13:23:35 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 7 Jun 2021 13:23:35 -0500 From: Segher Boessenkool To: "Paul E. McKenney" Cc: Linus Torvalds , Alan Stern , Peter Zijlstra , Will Deacon , Andrea Parri , Boqun Feng , Nick Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Linux Kernel Mailing List , linux-toolchains@vger.kernel.org, linux-arch Subject: Re: [RFC] LKMM: Add volatile_if() Message-ID: <20210607182335.GI18427@gate.crashing.org> References: <20210606115336.GS18427@gate.crashing.org> <20210606184021.GY18427@gate.crashing.org> <20210606195242.GA18427@gate.crashing.org> <20210606202616.GC18427@gate.crashing.org> <20210606233729.GN4397@paulmck-ThinkPad-P17-Gen-1> <20210607141242.GD18427@gate.crashing.org> <20210607152712.GR4397@paulmck-ThinkPad-P17-Gen-1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210607152712.GR4397@paulmck-ThinkPad-P17-Gen-1> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 08:27:12AM -0700, Paul E. McKenney wrote: > > > > > The barrier() thing can work - all we need to do is to simply make it > > > > > impossible for gcc to validly create anything but a conditional > > > > > branch. > > > What would you suggest as a way of instructing the compiler to emit the > > > conditional branch that we are looking for? > > > > You write it in the assembler code. > > > > Yes, it sucks. But it is the only way to get a branch if you really > > want one. Now, you do not really need one here anyway, so there may be > > some other way to satisfy the actual requirements. > > Hmmm... What do you see Peter asking for that is different than what > I am asking for? ;-) I don't know what you are referring to, sorry? I know what you asked for: literally some way to tell the compiler to emit a conditional branch. If that is what you want, the only way to make sure that is what you get is by writing exactly that in assembler. Segher