Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Andrew Murray
On Tue, Sep 10, 2019 at 08:46:07AM +0100, Will Deacon wrote: > On Mon, Sep 09, 2019 at 10:21:35PM +0200, Arnd Bergmann wrote: > > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > > when CONFIG_OPTIMIZE_INLINING is set. > > Hmm. Given that CONFIG_OPTIMIZE_INLINING has also bee

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Arnd Bergmann
On Tue, Sep 10, 2019 at 3:24 PM Will Deacon wrote: > On Tue, Sep 10, 2019 at 10:04:24AM +0200, Arnd Bergmann wrote: > > On Tue, Sep 10, 2019 at 9:46 AM Will Deacon wrote: > > - In theory, CONFIG_OPTIMIZE_INLINING is the right thing to do -- the > > compilers > > also make some particularly bad

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Will Deacon
On Tue, Sep 10, 2019 at 10:04:24AM +0200, Arnd Bergmann wrote: > On Tue, Sep 10, 2019 at 9:46 AM Will Deacon wrote: > > > > On Mon, Sep 09, 2019 at 10:21:35PM +0200, Arnd Bergmann wrote: > > > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > > > when CONFIG_OPTIMIZE_INLINING

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Andrew Murray
On Tue, Sep 10, 2019 at 11:38:37AM +0200, Arnd Bergmann wrote: > On Tue, Sep 10, 2019 at 11:23 AM Andrew Murray wrote: > > > > > > arch/arm64/include/asm/cmpxchg.h | 15 --- > > > 1 file changed, 8 insertions(+), 7 deletions(-) > > > > > > diff --git a/arch/arm64/include/asm/cmpxchg.

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Masahiro Yamada
On Tue, Sep 10, 2019 at 6:38 PM Arnd Bergmann wrote: > > On Tue, Sep 10, 2019 at 11:23 AM Andrew Murray wrote: > > > > > > arch/arm64/include/asm/cmpxchg.h | 15 --- > > > 1 file changed, 8 insertions(+), 7 deletions(-) > > > > > > diff --git a/arch/arm64/include/asm/cmpxchg.h > > >

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Arnd Bergmann
On Tue, Sep 10, 2019 at 11:23 AM Andrew Murray wrote: > > > arch/arm64/include/asm/cmpxchg.h | 15 --- > > 1 file changed, 8 insertions(+), 7 deletions(-) > > > > diff --git a/arch/arm64/include/asm/cmpxchg.h > > b/arch/arm64/include/asm/cmpxchg.h > > index a1398f2f9994..fd64dc8a235

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Andrew Murray
On Mon, Sep 09, 2019 at 10:21:35PM +0200, Arnd Bergmann wrote: > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > when CONFIG_OPTIMIZE_INLINING is set. > Clang then fails a compile-time assertion, because it cannot tell at > compile time what the size of the argument is: > >

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Arnd Bergmann
On Tue, Sep 10, 2019 at 9:46 AM Will Deacon wrote: > > On Mon, Sep 09, 2019 at 10:21:35PM +0200, Arnd Bergmann wrote: > > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > > when CONFIG_OPTIMIZE_INLINING is set. > > Hmm. Given that CONFIG_OPTIMIZE_INLINING has also been shown

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-10 Thread Will Deacon
On Mon, Sep 09, 2019 at 10:21:35PM +0200, Arnd Bergmann wrote: > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > when CONFIG_OPTIMIZE_INLINING is set. Hmm. Given that CONFIG_OPTIMIZE_INLINING has also been shown to break assignment of local 'register' variables on GCC, perha

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-09 Thread Nathan Chancellor
On Mon, Sep 09, 2019 at 10:21:35PM +0200, Arnd Bergmann wrote: > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > when CONFIG_OPTIMIZE_INLINING is set. > Clang then fails a compile-time assertion, because it cannot tell at > compile time what the size of the argument is: > >

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-09 Thread Nick Desaulniers
On Mon, Sep 9, 2019 at 2:06 PM Nick Desaulniers wrote: > > On Mon, Sep 9, 2019 at 1:21 PM Arnd Bergmann wrote: > > > > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > > when CONFIG_OPTIMIZE_INLINING is set. > > Clang then fails a compile-time assertion, because it cannot te

Re: [PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-09 Thread Nick Desaulniers
On Mon, Sep 9, 2019 at 1:21 PM Arnd Bergmann wrote: > > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > when CONFIG_OPTIMIZE_INLINING is set. > Clang then fails a compile-time assertion, because it cannot tell at > compile time what the size of the argument is: > > mm/memcon

[PATCH] arm64: fix unreachable code issue with cmpxchg

2019-09-09 Thread Arnd Bergmann
On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined when CONFIG_OPTIMIZE_INLINING is set. Clang then fails a compile-time assertion, because it cannot tell at compile time what the size of the argument is: mm/memcontrol.o: In function `__cmpxchg_mb': memcontrol.c:(.text+0x1a4c): u