Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1241275
| From | Andrey Ryabinin <aryabinin@virtuozzo.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() |
| Date | 2015-10-07 11:20 +0200 |
| Message-ID | <qgT3e-st-63@gated-at.bofh.it> (permalink) |
| References | (4 earlier) <qggXT-4mO-3@gated-at.bofh.it> <qghhf-4Jy-9@gated-at.bofh.it> <qguRd-7Jr-37@gated-at.bofh.it> <qgF0e-5vZ-27@gated-at.bofh.it> <qgSJQ-8ht-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 10/07/2015 11:54 AM, Andrey Ryabinin wrote: > On 10/06/2015 09:11 PM, Andy Lutomirski wrote: >> >> But what's wrong with the GCC attribute mechanism? Surely GCC ought >> to be able to generate the code, at least in the simple cases, and the >> attribute already exists. The attribute and READ_ONCE_NOCHECK seem >> like the least messy in the C code. > > The problem with 'no_sanitize_address' attribute is incompatibility with inlining. > GCC can't inline function with that attribute into function without it. > And the contrary is also true - GCC can't inline function without attribute into function with such attribute. > > Failure to inline always_inline function leads to build failure. > And under CONFIG_OPTIMIZE=n 'inline' means 'always_inline'. > > include/linux/compiler-gcc.h: > > #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ > !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) > #define inline inline __attribute__((always_inline)) notrace > Huh, 'inline' effectively means 'always_inline' on every arch, except x86. This looks like a bug IMO. Allowing gcc to uninline functions marked 'inline' could be beneficial for some arches/configs. $ git grep ARCH_SUPPORTS_OPTIMIZED_INLINING arch/tile/Kconfig:config ARCH_SUPPORTS_OPTIMIZED_INLINING arch/x86/Kconfig:config ARCH_SUPPORTS_OPTIMIZED_INLINING include/linux/compiler-gcc.h:#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ $ git grep OPTIMIZE_INLINING arch/x86/Kconfig.debug:config OPTIMIZE_INLINING arch/x86/configs/i386_defconfig:CONFIG_OPTIMIZE_INLINING=y arch/x86/configs/x86_64_defconfig:CONFIG_OPTIMIZE_INLINING=y arch/x86/entry/vdso/vdso32/vclock_gettime.c:#undef CONFIG_OPTIMIZE_INLINING include/linux/compiler-gcc.h: !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) kernel/configs/tiny.config:CONFIG_OPTIMIZE_INLINING=y -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Ingo Molnar <mingo@kernel.org> - 2015-10-06 09:30 +0200
Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-06 09:40 +0200
Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andy Lutomirski <luto@amacapital.net> - 2015-10-06 20:20 +0200
Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Ingo Molnar <mingo@kernel.org> - 2015-10-07 09:30 +0200
Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-07 11:00 +0200
Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-07 11:20 +0200
Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andi Kleen <ak@linux.intel.com> - 2015-10-07 18:30 +0200
Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-10-07 20:50 +0200
csiph-web