Re: [RFC PATCH 14/14] khwasan: default the instrumentation mode to inline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 09, 2018 at 07:06:59PM +0100, Andrey Konovalov wrote:
> On Mon, Mar 5, 2018 at 3:54 PM, Mark Rutland <mark.rutland@xxxxxxx> 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.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux