Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1461457ybk; Thu, 21 May 2020 07:26:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZiZ00U+E5+/3Ce6xEhf5c3FyTmIzZdHjupBYC8XrxWhFnaiuAm1PJgFXPv+MpaLQphOTz X-Received: by 2002:a05:6402:68f:: with SMTP id f15mr8153793edy.89.1590071208251; Thu, 21 May 2020 07:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590071208; cv=none; d=google.com; s=arc-20160816; b=sxmCDAT/bkob75IZ5gp1zNOyUpQ2wFj4GLiVX3OE2q3Q/t4V1RhBQb9MKu4EEVfGx6 Zk3I/VAPvzA8XbBlJWTs5KCZfxQgpJfkj46oQkFK+fRF20RyfWLK/m3AEMhOvuohZFm7 EhRDbHG5vSoRJSqP2KnJMeKSIcpijWuutbyCjNyuoPQRqLWcYQEeUMFsrpH0ADrUI9Sn iEbGYghunY42dsrWQLfFvPlQdg9RG7vfW+aoztchqn9psgZvJMv8nhixHCA5RX+sxiA5 G9p5nXq2fxD8qCpwMj3NtvnRmZd7LK77kVuYxkVH9kiztw32UDHJk9EnkYIq4jCfaeag X07Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=H2uRSUohXbn7nWhU1m6/8O/OIPFFeT1jA5i34XsZ7o0=; b=RjcdwvWO/pHynVYOH7lprY3KpM50Bcpwfvm3NfDcMTqXX87xQgNkcurzHe0iEpookn lGV0lOvm39al2UB2CY+k4/idXKWwy5aJjb0DElBVaofryZ6CbHxH3t5Q0v4Zl7kR9CAt 33A9sWUHXoJ721SJjTXeO/8LlxW8YDu594mwaGEtAoKCi+4kix5BNdjV0hVbnjlTEYbn bvfOHIjfY0xhBpEWaIG+yBb0xf7TVrvYQrVXKfx0N1q3rgh/ZkJblb8NkhrgNO1al3GO uShQjLGTxZRr855EEG3IzTQkzKgn4uHb4qg2NRG/gyVTJ2i/4HRlVtaobQ7Ev9Jp10gi FeAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="axxi3Qx/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si3684183ejj.92.2020.05.21.07.26.25; Thu, 21 May 2020 07:26:48 -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=@google.com header.s=20161025 header.b="axxi3Qx/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729619AbgEUOWh (ORCPT + 99 others); Thu, 21 May 2020 10:22:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726965AbgEUOWc (ORCPT ); Thu, 21 May 2020 10:22:32 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9306DC061A0E for ; Thu, 21 May 2020 07:22:32 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id y8so5467869ybn.20 for ; Thu, 21 May 2020 07:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=H2uRSUohXbn7nWhU1m6/8O/OIPFFeT1jA5i34XsZ7o0=; b=axxi3Qx/8vKlKRkFvuD31M8fwf7LrlOkxHIrZdlDjzY38oPfn+O2cNDswnD+BhSupD JlwQ51nDCg7UbeW4wdTiT/dp8lH9WhF+0iqP4AHedX+6ef9TtcCRnFfIlDuLbBk0qzKM 70ee6zQUY7I1EQ+xKnkJvn0nhAk3B3aw2SZZir69jsEY5hlKh8INutX42YZXmaGVTxMf 51YAOYXfi+yz3ZWZv91OaGVrLBgXT4wG/fwE6HXc8GKccSTt6UD5bALGltQ/1/UKN0SY Jt3x1z8fGTWLhHGQxAqVOI+xfiSEBSaZqQ2q4ko7JORQ3LCAkNAc+G8NkxXyp/cXoAH5 wLlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=H2uRSUohXbn7nWhU1m6/8O/OIPFFeT1jA5i34XsZ7o0=; b=agJCYFgmsU2+0HDfmrDcIi4gzBrJvTRmS3NuNyfIzQ2r2aKT1eA/Zl8l+Qgtq8eJFe j/VRycoUHLjHyQjmOE6L/e9zINW0/lfqSo3hSmEu34hZyIGehPNOPNSGBSbTUG++H/aF CrdR4bc3BCP/cpcmfjCdOGuoMrBDSiNMVuYc9849Cr2ofX4JHObMT94Gy/UKVt5se+of srNLXzcwr9WNjzJ2hYNOm/osYdCcZYC9H/hYGOLioF7XAqr9+/ZJtpFOKJfX/Dx3XDnJ Od3M4QtG6SEfQbumIEXn3GlF4HKmdYrQuszQo3X3filcCIm3oUPGGF0yMxF9W5GoF/AE i/ow== X-Gm-Message-State: AOAM533bnSKaN7RalubNlUJegaG5UyYfApipT/n7M/JOTvAiu9uLNFJX Um/ZBO2L1IY3v5LQ/RyCDsEAc0uKHQ== X-Received: by 2002:a25:3610:: with SMTP id d16mr15626055yba.222.1590070951790; Thu, 21 May 2020 07:22:31 -0700 (PDT) Date: Thu, 21 May 2020 16:20:41 +0200 In-Reply-To: <20200521142047.169334-1-elver@google.com> Message-Id: <20200521142047.169334-6-elver@google.com> Mime-Version: 1.0 References: <20200521142047.169334-1-elver@google.com> X-Mailer: git-send-email 2.26.2.761.g0e0b3e54be-goog Subject: [PATCH -tip v3 05/11] kcsan: Remove 'noinline' from __no_kcsan_or_inline From: Marco Elver To: elver@google.com Cc: paulmck@kernel.org, dvyukov@google.com, glider@google.com, andreyknvl@google.com, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org, will@kernel.org, clang-built-linux@googlegroups.com, bp@alien8.de Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some compilers incorrectly inline small __no_kcsan functions, which then results in instrumenting the accesses. For this reason, the 'noinline' attribute was added to __no_kcsan_or_inline. All known versions of GCC are affected by this. Supported version of Clang are unaffected, and never inlines a no_sanitize function. However, the attribute 'noinline' in __no_kcsan_or_inline causes unexpected code generation in functions that are __no_kcsan and call a __no_kcsan_or_inline function. In certain situations it is expected that the __no_kcsan_or_inline function is actually inlined by the __no_kcsan function, and *no* calls are emitted. By removing the 'noinline' attribute we give the compiler the ability to inline and generate the expected code in __no_kcsan functions. Link: https://lkml.kernel.org/r/CANpmjNNOpJk0tprXKB_deiNAv_UmmORf1-2uajLhnLWQQ1hvoA@mail.gmail.com Acked-by: Will Deacon Signed-off-by: Marco Elver --- include/linux/compiler.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index e24cc3a2bc3e..17c98b215572 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -276,11 +276,9 @@ do { \ #ifdef __SANITIZE_THREAD__ /* * Rely on __SANITIZE_THREAD__ instead of CONFIG_KCSAN, to avoid not inlining in - * compilation units where instrumentation is disabled. The attribute 'noinline' - * is required for older compilers, where implicit inlining of very small - * functions renders __no_sanitize_thread ineffective. + * compilation units where instrumentation is disabled. */ -# define __no_kcsan_or_inline __no_kcsan noinline notrace __maybe_unused +# define __no_kcsan_or_inline __no_kcsan notrace __maybe_unused # define __no_sanitize_or_inline __no_kcsan_or_inline #else # define __no_kcsan_or_inline __always_inline -- 2.26.2.761.g0e0b3e54be-goog