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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A8E3C433F5 for ; Wed, 15 Dec 2021 13:49:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AEE676B0071; Wed, 15 Dec 2021 08:49:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A9E136B0073; Wed, 15 Dec 2021 08:49:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 965806B0074; Wed, 15 Dec 2021 08:49:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id 844D96B0071 for ; Wed, 15 Dec 2021 08:49:35 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 47F5D18030354 for ; Wed, 15 Dec 2021 13:49:25 +0000 (UTC) X-FDA: 78920160690.21.1E53703 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf22.hostedemail.com (Postfix) with ESMTP id 6FA61C000D for ; Wed, 15 Dec 2021 13:49:24 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0EFEE13A1; Wed, 15 Dec 2021 05:49:24 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.67.176]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 481863F774; Wed, 15 Dec 2021 05:49:19 -0800 (PST) Date: Wed, 15 Dec 2021 13:49:16 +0000 From: Mark Rutland To: Alexander Potapenko Cc: Alexander Viro , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 21/43] kmsan: mark noinstr as __no_sanitize_memory Message-ID: References: <20211214162050.660953-1-glider@google.com> <20211214162050.660953-22-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211214162050.660953-22-glider@google.com> Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf22.hostedemail.com: domain of mark.rutland@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=mark.rutland@arm.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6FA61C000D X-Stat-Signature: cjrbujti4b894jicjak1k4s9hdfo8pqq X-HE-Tag: 1639576164-557714 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Dec 14, 2021 at 05:20:28PM +0100, Alexander Potapenko wrote: > noinstr functions should never be instrumented, so make KMSAN skip them > by applying the __no_sanitize_memory attribute. To make this easier to review, it would be nice if this patch were moved earlier, grouped with patches: * 7: "compiler_attributes.h: add __disable_sanitizer_instrumentation" * 9: "kmsan: introduce __no_sanitize_memory and __no_kmsan_checks" ... since that way a reviewer will spot them all in one go, rather than having to jump around the series, and then any later patch in the series can rely on all of these attributes, including `noinstr`. Mark. > > Signed-off-by: Alexander Potapenko > --- > Link: https://linux-review.googlesource.com/id/I3c9abe860b97b49bc0c8026918b17a50448dec0d > --- > include/linux/compiler_types.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h > index 1d32f4c03c9ef..37b82564e93e5 100644 > --- a/include/linux/compiler_types.h > +++ b/include/linux/compiler_types.h > @@ -210,7 +210,8 @@ struct ftrace_likely_data { > /* Section for code which can't be instrumented at all */ > #define noinstr \ > noinline notrace __attribute((__section__(".noinstr.text"))) \ > - __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage > + __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage \ > + __no_sanitize_memory > > #endif /* __KERNEL__ */ > > -- > 2.34.1.173.g76aa8bc2d0-goog >