Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2852502pxj; Sun, 6 Jun 2021 16:50:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwql0GYUPgq0vaARdNyAwc9va3eCl6ySsmmKePJAZ72wnxh4mp3ESaH9vsxMhobfpMVV/yd X-Received: by 2002:a05:6402:cb4:: with SMTP id cn20mr16885072edb.334.1623023424628; Sun, 06 Jun 2021 16:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623023424; cv=none; d=google.com; s=arc-20160816; b=NKsgYJoVhKqXMUaa3B5v+jef9gLmsrUgw6ktUh9CDipHVeIwMug7I/DdBHKv1e0R/D sSVMkiDoA+a4oYBTJEodhMV86wy+92ZOhp7XP/no2xfg4RM8s5W6RQjFe0YOilH2T06a rnaXtPI2/fFb5HvS+g6XJL2+c86frQnZPjnw+W/7jBAtxXYzwNzbxiIxAYGdEWIP4wfT 49yvscfKww0he7o6YxsCgd6lLG3utEM52j99iSyOt9vXyuH1W9eHCtHd1fKjn4S5HuuZ FnQdpzPNCEjofCrMTvD+QS93TG6IxkZu+BW5C6SyxfXPZP0xtSq50/jAI5dYWZi17UGS cS+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=Uu/Sy+/+5gdn1LkuXnr8FX4KpSViz81yPU6cQOIlizA=; b=Zuq4aSpHpMNcf/PJmGno5zKeL4I91MfB58l/+Pw/oSR3RnLVr6sTreGXY33XpvTSrg /9KLRge9GcVRjcgsd7LC3kF+LAmLB41jjQ4+4juuYmEAG5SRQyck2ZDhqzpe9XRE89rD ElTxGtcZudUhc4Ck4J4Lfs0eJv1tmlNhGlo0rHd7Ks5GZTh74yeAi7s4+D/xrJuMVPZS 1WTa1Olzw1UbUEgC4T25rdpcJUG6yP+tKuWIyqjz5UAnbsnxKJ19rLKrVJowgwVxDWLY AyUfNWXGYwcGCyu1wISN55PXESCgbIed+1YVtp84qglFHJakiB+r1waM/ejoYWqCuxLj NWSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=HSOFWCYa; 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 b3si10708367edh.532.2021.06.06.16.50.02; Sun, 06 Jun 2021 16:50:24 -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=@rasmusvillemoes.dk header.s=google header.b=HSOFWCYa; 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 S230097AbhFFXsB (ORCPT + 99 others); Sun, 6 Jun 2021 19:48:01 -0400 Received: from mail-lj1-f170.google.com ([209.85.208.170]:34683 "EHLO mail-lj1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbhFFXsB (ORCPT ); Sun, 6 Jun 2021 19:48:01 -0400 Received: by mail-lj1-f170.google.com with SMTP id bn21so19646429ljb.1 for ; Sun, 06 Jun 2021 16:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Uu/Sy+/+5gdn1LkuXnr8FX4KpSViz81yPU6cQOIlizA=; b=HSOFWCYaI4JplGo9PNU8Bbt0H04vfi4A8D71uHnmXedCnIPRXbvEu7QZL5Kfsp2DdB GidNETequ5xm/f7hshUSXwVIbVerCUNNb+kZ4sNwu+M9BpRkS7WFpDAntvD1YfeqZFSd zxowt78Mgw/V1HxA4xvQfdXdxrScPi3XPIblk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Uu/Sy+/+5gdn1LkuXnr8FX4KpSViz81yPU6cQOIlizA=; b=NSw5tLWt9rUO3o4qKiQtOKAAaq27oH0nqFMV0gLDBqTL5CrQpLJWrwEtBx4GvXSTfS 0OUNiAy8VuERe2ZdRjzpbkl/MN8wuFk504lv7lUuSLFDhwZ0EuxVqWw1Uv1pcrCCmrNp MK7PuNrSSkVaj+ZgNoJPD84tC0nmKrd5QLprRlV4EuNZ1hWN2/2NUSpwqLE7ug6YWaeF wAvb53OuzT4nr6RuI3FUUq8l8z0EMFB4qVucd8UvvYXyvXbMaGVFJLW3wC26BH3iSruf phM5sVY5uupEjRbYO11JdXgO7F06idSK3HAKfzxIOtFsJjx/1mdQ2eCBuJQv57jWZZ9e FFMA== X-Gm-Message-State: AOAM533KgTOx0ziwcmxUJVm6Rbo6b/LdGaB4B+mpYmocWKx+BUzIZaxp MgnIJLGjvONwbpAq0J6TO1nH/g== X-Received: by 2002:a2e:8009:: with SMTP id j9mr12870582ljg.172.1623023101380; Sun, 06 Jun 2021 16:45:01 -0700 (PDT) Received: from [172.17.20.50] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id x3sm448542ljd.12.2021.06.06.16.45.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Jun 2021 16:45:00 -0700 (PDT) Subject: Re: [RFC] LKMM: Add volatile_if() From: Rasmus Villemoes To: Linus Torvalds , Alexander Monakov Cc: Jakub Jelinek , Alan Stern , Segher Boessenkool , "Paul E. McKenney" , 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 References: <20210604205600.GB4397@paulmck-ThinkPad-P17-Gen-1> <20210604214010.GD4397@paulmck-ThinkPad-P17-Gen-1> <20210605145739.GB1712909@rowland.harvard.edu> <20210606001418.GH4397@paulmck-ThinkPad-P17-Gen-1> <20210606012903.GA1723421@rowland.harvard.edu> <20210606185922.GF7746@tucnak> Message-ID: <193ca8cf-cf2c-9372-c0ab-16714ec37f57@rasmusvillemoes.dk> Date: Mon, 7 Jun 2021 01:44:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/06/2021 01.39, Rasmus Villemoes wrote: > memory". Replacing with a call to an extern function marked pure does > indeed cause gcc to cache the value of y*z, so in theory this should be > possible, if one could convince gcc to "trust me, this really is a pure > function". Don't know why I didn't think to check before sending, but FWIW clang doesn't need convincing, it already takes the __pure at face value and caches y*z. Rasmus