From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f200.google.com (mail-ot0-f200.google.com [74.125.82.200]) by kanga.kvack.org (Postfix) with ESMTP id 1540C6B0005 for ; Fri, 9 Mar 2018 14:18:37 -0500 (EST) Received: by mail-ot0-f200.google.com with SMTP id w23so723854otj.6 for ; Fri, 09 Mar 2018 11:18:37 -0800 (PST) Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id a25si498483otj.335.2018.03.09.11.18.35 for ; Fri, 09 Mar 2018 11:18:36 -0800 (PST) Date: Fri, 9 Mar 2018 19:18:24 +0000 From: Mark Rutland Subject: Re: [RFC PATCH 14/14] khwasan: default the instrumentation mode to inline Message-ID: <20180309191823.p6r7f5dlxhifxokh@lakrids.cambridge.arm.com> References: <1943a345f4fb7e8e8f19b4ece2457bccd772f0dc.1520017438.git.andreyknvl@google.com> <20180305145435.tfaldb334lp4obhi@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Andrey Konovalov Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Jonathan Corbet , Catalin Marinas , Will Deacon , Theodore Ts'o , Jan Kara , Christopher Li , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Masahiro Yamada , Michal Marek , Ard Biesheuvel , Yury Norov , Nick Desaulniers , Marc Zyngier , Bob Picco , Suzuki K Poulose , Kristina Martsenko , Punit Agrawal , Dave Martin , James Morse , Julien Thierry , Michael Weiser , Steve Capper , Ingo Molnar , Thomas Gleixner , Sandipan Das , Paul Lawrence , David Woodhouse , Kees Cook , Geert Uytterhoeven , Josh Poimboeuf , Arnd Bergmann , kasan-dev , linux-doc@vger.kernel.org, LKML , Linux ARM , linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org, Linux Memory Management List , Linux Kbuild mailing list , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Kees Cook , Jann Horn , Mark Brand On Fri, Mar 09, 2018 at 07:06:59PM +0100, Andrey Konovalov wrote: > On Mon, Mar 5, 2018 at 3:54 PM, Mark Rutland wrote: > > On Fri, Mar 02, 2018 at 08:44:33PM +0100, Andrey Konovalov wrote: > >> There are two reasons to use outline instrumentation: > >> 1. Outline instrumentation reduces the size of the kernel text, and should > >> be used where this size matters. > >> 2. Outline instrumentation is less invasive and can be used for debugging > >> for KASAN developers, when it's not clear whether some issue is caused > >> by KASAN or by something else. > >> > >> For the rest cases inline instrumentation is preferrable, since it's > >> faster. > >> > >> This patch changes the default instrumentation mode to inline. > >> --- > >> lib/Kconfig.kasan | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan > >> index ab34e7d7d3a7..8ea6ae26b4a3 100644 > >> --- a/lib/Kconfig.kasan > >> +++ b/lib/Kconfig.kasan > >> @@ -70,7 +70,7 @@ config KASAN_EXTRA > >> choice > >> prompt "Instrumentation type" > >> depends on KASAN > >> - default KASAN_OUTLINE > >> + default KASAN_INLINE > > > > Some compilers don't support KASAN_INLINE, but do support KASAN_OUTLINE. > > IIRC that includes the latest clang release, but I could be wrong. > > > > If that's the case, changing the default here does not seem ideal. > > > > Hi Mark! > > GCC before 5.0 doesn't support KASAN_INLINE, but AFAIU will fallback > to outline instrumentation in this case. > > Latest Clang Release doesn't support KASAN_INLINE (although current > trunk does) and falls back to outline instrumentation. > > So nothing should break, but people with newer compilers should get > the benefits of using the inline instrumentation by default. Ah, ok. I had assumed that they were separate compiler options, and this would result in a build failure. I have no strong feelings either way as to the default. I typically use inline today unless I'm trying to debug particularly weird cases and want to hack the shadow accesses. Thanks, Mark.