From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH v4 00/11] Rework READ_ONCE() to improve codegen Date: Fri, 24 Apr 2020 17:52:05 +0100 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 Return-path: 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 Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: 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 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