Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5185010pxj; Wed, 9 Jun 2021 11:06:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhlleS+EJfvvoXRJXC5r5yEzxb2pgZrEbmoIOva8Hf30dXRW6ujp2BpPYcTdBHkWcOuaRx X-Received: by 2002:a50:a413:: with SMTP id u19mr636195edb.251.1623262004751; Wed, 09 Jun 2021 11:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623262004; cv=none; d=google.com; s=arc-20160816; b=Jkl8hZLaOlSJkW7KA5F6rF8aHRzHF++hBEJoKhiOlOQSXT57xmeHKE9ZNIZaIPc4iK ZipffctlFsbIEa0J4a51xuUZ3MSqzPGLNU9PcTttGaLF7PAtrQUpHxC8jZZk04LxbZnR lV6GgJaxrKO8HWZC7c8ImA/bfBY92BwkRWa+UcO7VUdzxI5+CRkAhPN1PyWGVjboRIYn OjcpNHZ5qIcDsQRfhdIOvLVw9aoiFR/H45TqIPd6yCNeXm+rizoBS6/ZnwkVpgX4TNSn fFujGHG7bXXYHjeZmgmC2IWi8Ps2oMgMq4N2TK8YjuuwVFP7WIFXxb4UbsOZAFcOsZH2 7FrA== 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=n2uZGOvUV5OfWeX9lQKYmgK5Rpx0SU6xRw5GtcRQTwo=; b=e/oIeIpTs0RiKk42Mxc5+C+yHsPfHqe/64AfDZ0pdZFdu8+oHrEVSR4DVfI2Wk8UNy PB3UvnUdiRidq+xInqpeRxAsb0NlXMCMYImUCeMpIJfNwjK5W2nwwmfmfmfuafTbOLZr LKUmi/chhmhUSZ/Of3HUSfuAOQ+PAG3msWXjf4/NpgFQ9Ab4PtK8phanpYFfbl9Rhqe/ EaiuucpTOdMHPdug376PKLENvuw7E3dktN///h+nVWl5rY16POORt0B7FTRkRr1vZ2KH ec9i5/6pfDFI7+xDWLXPiIr3Zg4CD3yaEoYEq7cZeHNX04IAZOC4MoQX3jjJsX+lkexy iWrg== 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 b15si265812eds.298.2021.06.09.11.06.07; Wed, 09 Jun 2021 11:06:44 -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 S233850AbhFIPje (ORCPT + 99 others); Wed, 9 Jun 2021 11:39:34 -0400 Received: from gate.crashing.org ([63.228.1.57]:47811 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234049AbhFIPjF (ORCPT ); Wed, 9 Jun 2021 11:39:05 -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 159FVcVo029586; Wed, 9 Jun 2021 10:31:38 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 159FVXoX029584; Wed, 9 Jun 2021 10:31:33 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 9 Jun 2021 10:31:33 -0500 From: Segher Boessenkool To: Marco Elver Cc: Peter Zijlstra , "Paul E. McKenney" , Alexander Monakov , Linus Torvalds , Jakub Jelinek , Alan Stern , 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: <20210609153133.GF18427@gate.crashing.org> References: <20210607152806.GS4397@paulmck-ThinkPad-P17-Gen-1> <20210608152851.GX18427@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 02:44:08PM +0200, Marco Elver wrote: > On Tue, 8 Jun 2021 at 17:30, Segher Boessenkool > wrote: > > This needs some work. > > There is a valid concern that something at the level of the memory > model requires very precise specification in terms of language > semantics and not generated code. Yup, exactly. Especially because the meaning of generated code is hard to describe, and even much more so if you do not limit yourself to a single machine architecture. > Otherwise it seems difficult to get > compiler folks onboard. It isn't just difficult to get us on board without it, we know it just is impossible to do anything sensible without it. > And coming up with such a specification may > take a while, Yes. > especially if we have to venture in the realm of the > C11/C++11 memory model while still trying to somehow make it work for > the LKMM. That seems like a very tricky maze we may want to avoid. Well, you only need to use the saner parts of the memory model (not the full thing), and extensions are fine as well of course. > An alternative design would be to use a statement attribute to only > enforce (C) ("__attribute__((mustcontrol))" ?). Statement attributes only exist for empty statements. It is unclear how (and if!) we could support it for general statements. Some new builtin seems to fit the requirements better? I haven't looked too closely though. Segher