From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09B66C54FD0 for ; Fri, 24 Apr 2020 16:52:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D70AF20774 for ; Fri, 24 Apr 2020 16:52:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587747132; bh=lQE9T5LzPof7nBKO8GPRqY/ZDhq/5vz9BEA3Xz2iqkY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=JJxpy0dr51fL9VIFsIspkzWgMPvfJ9OX+FMrb41CgiCRVAQVFP7FMCnpuKFfwD6b1 ygy+VBLp4LEMNw+O5enm84o8arIQmqL/zDqb2E9vFDRX4xFeRaJoVE/EuJRjxggtrS UBDOsvnb41YOl5jfutu0OtE2j36pFOWl9ZAKPRH8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728640AbgDXQwM (ORCPT ); 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