Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp827968ybz; Fri, 24 Apr 2020 09:56:09 -0700 (PDT) X-Google-Smtp-Source: APiQypKl7kYYVuYK1MBVeGPXk4RlWXN8PnomT3iM/C1MSwr50WUiw4rfH5F+aF/EUjnnXqwN1bP7 X-Received: by 2002:a17:906:29c4:: with SMTP id y4mr8031389eje.95.1587747368968; Fri, 24 Apr 2020 09:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587747368; cv=none; d=google.com; s=arc-20160816; b=vZ5Tt629XYtW3jm7r22LkefjmjlEO9rgWegvHmMWeiLi/K8sSI7jsC/Wrrc3x6q96F 8vMGVjj7wfgR0pF3dm3R6uuHHrKwBF2rUjo84SpQVkqxrSRP6InkIqynRr2dPyaGPNDW 8WtJ4nZtDoE1e43f5nTpdwf/ZLDLlqJxmfSXUtGNKis6ucT59btLhq3uAYcZ8rnMZDQ1 0Fq3xP3owZg/3KEwGIQPlSvIYBU1UVUAKqru6yufU6x0VN0ncEz+KClzZaUZJ2J3ptUP EDq8jJJyBZODMaS/S9bAZiPdgnYESFa2i1Qy/00PBAhiUqMIN8QtK8u7zwOn9v1H2i/J gajw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oxLAtBsuCjVjo2UZ30km3/UGCyGfCIlGpv6VQK+DzEs=; b=GeZqLkeLc4SyrLR5YfiFoOyOLDgbeW3qeA1413IdlSy8dVEk5SCJiXDyLIO0m0mc3G K2oiM0a0W+pWEjGqui4zjwyplNAFQwgmUfmx0KrEhpFI2aB7iUmyfJXu3ZXwR8nzB6bC A6XRm0mYyjxJLrmnNMxGB1/OSSBWbjYfizN7Y19robgVrVJ9TOL+ja2goR3THuaaO1TZ Ug8RmneOFcv+ysuLTX+wghACtQMazygpAyv2jI/bLqBavwLpRYQzfznHV0HgziOOvxOT Eq/AevIyoHI2Y7xJ/vMiadkHQozhruQtNusMqj8AFyRE0lhgsHV5AtIoEwAbciln3nff /jgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zwe6qKlD; 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 c22si3273958edr.408.2020.04.24.09.55.45; Fri, 24 Apr 2020 09:56:08 -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=default header.b=zwe6qKlD; 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 S1728602AbgDXQwM (ORCPT + 99 others); Fri, 24 Apr 2020 12:52:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:50280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728019AbgDXQwL (ORCPT ); Fri, 24 Apr 2020 12:52:11 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98F7620728; Fri, 24 Apr 2020 16:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587747131; bh=lQE9T5LzPof7nBKO8GPRqY/ZDhq/5vz9BEA3Xz2iqkY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zwe6qKlD9HGccAzrGsOmDRlLxNKacRmL5rd1qt5514PO1CKcnllydC8GICKjA88rV YrLEuwlJNm/UCVAvHoBWk/GNLWbaET2ahkD7U3XfIJ6OvRM/WwTJZ4usN1lTcKcUIh DtEFqVHcfwAufNmZI4o2tnHzwRv8I1VOzVHvJEio= Date: Fri, 24 Apr 2020 17:52:05 +0100 From: Will Deacon To: Marco Elver Cc: Peter Zijlstra , Dmitry Vyukov , Linus Torvalds , Linux Kernel Mailing List , linux-arch , Android Kernel Team , Mark Rutland , Michael Ellerman , Segher Boessenkool , Christian Borntraeger , Luc Van Oostenryck , Arnd Bergmann , Peter Oberparleiter , Masahiro Yamada , Nick Desaulniers Subject: Re: [PATCH v4 00/11] Rework READ_ONCE() to improve codegen Message-ID: <20200424165204.GG21141@willie-the-truck> References: <20200421151537.19241-1-will@kernel.org> <20200422081838.GA29541@willie-the-truck> <20200422113721.GA20730@hirez.programming.kicks-ass.net> <20200422122626.GA676@willie-the-truck> <20200424134238.GE21141@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 24, 2020 at 05:54:10PM +0200, Marco Elver wrote: > On Fri, 24 Apr 2020 at 15:42, Will Deacon wrote: > > On Wed, Apr 22, 2020 at 01:26:27PM +0100, Will Deacon wrote: > > > On Wed, Apr 22, 2020 at 01:37:21PM +0200, Peter Zijlstra wrote: > > > > So I'm obviously all for these patches; do note however that it collides > > > > most mighty with the KCSAN stuff, which I believe is still pending. > > > > > > That stuff has been pending for the last two releases afaict :/ > > > > > > Anyway, I'm happy to either provide a branch with this series on, or do > > > the merge myself, or send this again based on something else. What works > > > best for you? The only thing I'd obviously like to avoid is tightly > > > coupling this to KCSAN if there's a chance of it missing the merge window > > > again. > > > > FWIW, I had a go at rebasing onto linux-next, just to get an idea for how > > bad it is. It's fairly bad, and I don't think it's fair to inflict it on > > sfr. I've included the interesting part of the resulting compiler.h below > > for you and the KCSAN crowd to take a look at (yes, there's room for > > subsequent cleanup, but I was focussing on the conflict resolution for now). > > Thanks for the heads up. From what I can tell, your proposed change > may work fine for KCSAN. However, I've had trouble compiling this: > > 1. kcsan_disable_current() / kcsan_enable_current() do not work as-is, > because READ_ONCE/WRITE_ONCE seems to be used from compilation units > where the KCSAN runtime is not available (e.g. > arch/x86/entry/vdso/Makefile which had to set KCSAN_SANITIZE := n for > that reason). > 2. Some new uaccess whitelist entries were needed. > > I think this is what's needed: > https://lkml.kernel.org/r/20200424154730.190041-1-elver@google.com > > With that you can change the calls to __kcsan_disable_current() / > __kcsan_enable_current() for READ_ONCE() and WRITE_ONCE(). After that, > I was able to compile, and my test suite passed. Brill, thanks Marco! I'll take a look at your other patches, but I'm pretty stuck until we've figured out the merging plan for all of this. Will