Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-04-11 Thread James Hogan
On Wed, Apr 11, 2018 at 12:08:51PM +0200, Arnd Bergmann wrote: > On Wed, Apr 11, 2018 at 11:54 AM, James Hogan wrote: > > On Wed, Apr 11, 2018 at 09:30:56AM +0200, Arnd Bergmann wrote: > >> On Wed, Apr 11, 2018 at 12:48 AM, James Hogan wrote: > >> > Before I

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-04-11 Thread Arnd Bergmann
On Wed, Apr 11, 2018 at 11:54 AM, James Hogan wrote: > On Wed, Apr 11, 2018 at 09:30:56AM +0200, Arnd Bergmann wrote: >> On Wed, Apr 11, 2018 at 12:48 AM, James Hogan wrote: >> > Before I forward port those patches to add .insn for MIPS, is that sort >> > of

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-04-11 Thread James Hogan
On Wed, Apr 11, 2018 at 09:30:56AM +0200, Arnd Bergmann wrote: > On Wed, Apr 11, 2018 at 12:48 AM, James Hogan wrote: > > Before I forward port those patches to add .insn for MIPS, is that sort > > of approach (an arch specific asm/compiler-gcc.h to allow MIPS to > > override

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-04-11 Thread Arnd Bergmann
On Wed, Apr 11, 2018 at 12:48 AM, James Hogan wrote: > Hi Arnd, > > On Tue, Dec 19, 2017 at 12:39:33PM +0100, Arnd Bergmann wrote: >> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h >> index 5d595cfdb2c4..66cfdad68f7e 100644 >> ---

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-04-10 Thread James Hogan
Hi Arnd, On Tue, Dec 19, 2017 at 12:39:33PM +0100, Arnd Bergmann wrote: > diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h > index 5d595cfdb2c4..66cfdad68f7e 100644 > --- a/include/linux/compiler-gcc.h > +++ b/include/linux/compiler-gcc.h > @@ -205,6 +205,15 @@ > #endif >

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-02-07 Thread Vineet Gupta
On 02/07/2018 04:01 PM, Andrew Morton wrote: On Wed, 20 Dec 2017 12:29:02 -0800 Vineet Gupta wrote: On 12/20/2017 12:12 PM, Arnd Bergmann wrote: Sorry, I didn't realize we are missing the stack trace now which you removed from the patch - why ? Did u intend to

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-02-07 Thread Vineet Gupta
On 02/07/2018 04:01 PM, Andrew Morton wrote: On Wed, 20 Dec 2017 12:29:02 -0800 Vineet Gupta wrote: On 12/20/2017 12:12 PM, Arnd Bergmann wrote: Sorry, I didn't realize we are missing the stack trace now which you removed from the patch - why ? Did u intend to

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2017-12-20 Thread Vineet Gupta
On 12/20/2017 12:12 PM, Arnd Bergmann wrote: Sorry, I didn't realize we are missing the stack trace now which you removed from the patch - why ? Did u intend to reduce inline generated code for the stack dump calls - which sounds like a great idea. But it would only work for the synchronous

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2017-12-20 Thread Arnd Bergmann
On Wed, Dec 20, 2017 at 7:52 PM, Vineet Gupta wrote: > On 12/20/2017 01:01 AM, Arnd Bergmann wrote: >> >> On Tue, Dec 19, 2017 at 11:38 PM, Vineet Gupta >> wrote: >>> >>> On 12/19/2017 12:13 PM, Arnd Bergmann wrote: > I

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2017-12-20 Thread Vineet Gupta
On 12/20/2017 01:01 AM, Arnd Bergmann wrote: On Tue, Dec 19, 2017 at 11:38 PM, Vineet Gupta wrote: On 12/19/2017 12:13 PM, Arnd Bergmann wrote: I suppose BUG() implies "dead end" like semantics - which ARC was lacking before ? Correct. Using __builtin_trap()

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2017-12-20 Thread Arnd Bergmann
On Tue, Dec 19, 2017 at 11:38 PM, Vineet Gupta wrote: > On 12/19/2017 12:13 PM, Arnd Bergmann wrote: >> >> >>> I suppose BUG() implies "dead end" like semantics - which ARC was lacking >>> before ? >> >> Correct. Using __builtin_trap() here avoids the 'control reaches

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2017-12-19 Thread Vineet Gupta
On 12/19/2017 12:13 PM, Arnd Bergmann wrote: I suppose BUG() implies "dead end" like semantics - which ARC was lacking before ? Correct. Using __builtin_trap() here avoids the 'control reaches end of non-void function' warnings, but then makes us run into the stack size problem that I work

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2017-12-19 Thread Arnd Bergmann
On Tue, Dec 19, 2017 at 5:57 PM, Vineet Gupta wrote: > On 12/19/2017 03:41 AM, Arnd Bergmann wrote: >> In case of ARC and CRIS, it turns out that the BUG() implementation >> actually does return (or at least the compiler thinks it does), resulting >> in lots of

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2017-12-19 Thread Vineet Gupta
On 12/19/2017 03:41 AM, Arnd Bergmann wrote: Looking at functions with large stack frames across all architectures led me discovering that BUG() suffers from the same problem as fortify_panic(), which I've added a workaround for already. In short, variables that go out of scope by calling a

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2017-12-19 Thread Geert Uytterhoeven
Hi Arnd, On Tue, Dec 19, 2017 at 12:39 PM, Arnd Bergmann wrote: > The name barrier_before_unreachable() is a bit suboptimal here, > as it fails to describe the fact that it is needed for both > __builtin_unreachable() and for calling noreturn functions. Any other > suggestions