Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp490975ybk; Wed, 13 May 2020 05:34:59 -0700 (PDT) X-Google-Smtp-Source: APiQypLEzRpms3TB1q+wXoxLxkY+wUD/jtd2T+DP5Wya11M2GMmal46L9cBZ28VIjedG/CcIumae X-Received: by 2002:aa7:d918:: with SMTP id a24mr19133701edr.32.1589373299127; Wed, 13 May 2020 05:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589373299; cv=none; d=google.com; s=arc-20160816; b=LSnSN3ia8xbyxBZt60O0yMmj62qmG2Te1g2PhT0trPskQof1EvzhYsKl/F8zdup+kc eaQxJ6BSbzgvXBfHsuMB3gjCMAcjV2rFKEQWE5M05xbK+dZwDP/gtmAJgQUU34NBtTBr p6FfDsImjLQGY/yZxCw+lvmdKpeJIFjykepP39O/bahPBxWVcHtwZ1dz/SwVGRLcXwoN AqlYwY1pbGUPdV3C8y952ZVe1BV9OvXc5QKwu6dHf7F7RrHvqQes3n09P59JoIruRjIB l2zPXBp2QMVrytDjXrFay9pTLhEme7aITYBdLrDne2e5HsaIBOy1MRNr4j+0FWzSKmrs B7rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8qAIPx0yq1s4hAQzWeQ2C8PF/tM8uCNWN0DULkuw3Dw=; b=pgX1LyF33PquKz8OJnlfuWYK1Lwv6kosAQPDi2U/UisP3jUtGU3C25zgfBO8jyOT7s GzJsW/UlEvB2yApQkRZJyiGoOVA1xrPvLDSYCyV4veGmJQ+FlOH9prQJkSnQWxS/FyP/ 9sAF9k48E2IM7H4xE9YJ/JzwkZXzhCXslhicRNrQrKJzOrxwCD/HcAFL4+3J3oBnZpAi 97U1JgjbFS3rIgJZ7Euq0vBVTqkyn09rK5GTNa1eD+KJTYpiQcq2XkNzBxChR/J+anka DvrywCe+JYnkNcshkqcX7OGc2QpJ3TMZCSDDgfxy15ih+YvqyfYuUu1Vv9jqUv4IvMAo lGHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=iN2AVnlo; 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 d21si7122514eja.353.2020.05.13.05.34.35; Wed, 13 May 2020 05:34:59 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=iN2AVnlo; 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 S1731150AbgEMMdG (ORCPT + 99 others); Wed, 13 May 2020 08:33:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729688AbgEMMdG (ORCPT ); Wed, 13 May 2020 08:33:06 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEBE3C061A0C for ; Wed, 13 May 2020 05:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8qAIPx0yq1s4hAQzWeQ2C8PF/tM8uCNWN0DULkuw3Dw=; b=iN2AVnloTiAQR3hd9qByGDp9/b qCX6cfYHAvUfSdAewyg0JjMtVdbsUx15BS2DvgYdEFmU3W8RjhahNqjyWZUHAJATt0hNeFQABbAo6 yrfhUISMyukWI+zb2jxJazCDS5pDdMhpV5Y+WxQBEOHdMFvd+bbXYKYBVVTq4qf9ZITvtkOFhangw EiXmU7M55a5ZSenG33GE5I3U4KCNY8LxNg7K6rRGgIN44uWIsHXRcvJ//OQL64GCLRFrufxlPOGp1 gLEPKkYqCjGnNa2GWO6drs3DsKWSvmr8pJn9T6PuG/XpyvybzwUZg3WqlUsEatEHbo/FhiRla9p9l hifHly9g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYqZ3-0006nX-Ov; Wed, 13 May 2020 12:32:45 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 24FC4301205; Wed, 13 May 2020 14:32:43 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 11AEC24C0C64E; Wed, 13 May 2020 14:32:43 +0200 (CEST) Date: Wed, 13 May 2020 14:32:43 +0200 From: Peter Zijlstra To: Marco Elver Cc: Will Deacon , LKML , Thomas Gleixner , "Paul E. McKenney" , Ingo Molnar , Dmitry Vyukov Subject: Re: [PATCH v5 00/18] Rework READ_ONCE() to improve codegen Message-ID: <20200513123243.GO2957@hirez.programming.kicks-ass.net> References: <20200511204150.27858-1-will@kernel.org> <20200512081826.GE2978@hirez.programming.kicks-ass.net> <20200512190755.GL2957@hirez.programming.kicks-ass.net> <20200513111057.GN2957@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 01:48:41PM +0200, Marco Elver wrote: > Disabling most instrumentation for arch/x86 is reasonable. Also fine > with the __READ_ONCE/__WRITE_ONCE changes (your improved > compiler-friendlier version). > > We likely can't have both: still instrument __READ_ONCE/__WRITE_ONCE > (as Will suggested) *and* avoid double-instrumentation in arch_atomic. > If most use-cases of __READ_ONCE/__WRITE_ONCE are likely to use > data_race() or KCSAN_SANITIZE := n anyway, I'd say it's reasonable for > now. Right, if/when people want sanitize crud enabled for x86 I need something that: - can mark a function 'no_sanitize' and all code that gets inlined into that function must automagically also not get sanitized. ie. make inline work like macros (again). And optionally: - can mark a function explicitly 'sanitize', and only when an explicit sanitize and no_sanitize mix in inlining give the current incompatible attribute splat. That way we can have the noinstr function attribute imply no_sanitize and frob the DEFINE_IDTENTRY*() macros to use (a new) sanitize_or_inline helper instead of __always_inline for __##func().