From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH] bug.h: Work around GCC PR82365 in BUG() Date: Wed, 20 Dec 2017 12:29:02 -0800 Message-ID: <861992dd-a28d-0f8c-572f-4194d15238df@synopsys.com> References: <20171219114112.939391-1-arnd@arndb.de> <8e42a1de-f619-7a4e-6d58-f90f53f5f38f@synopsys.com> <27bfdc23-1774-cf07-dab4-ab253a41d2f7@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kbuild-owner@vger.kernel.org To: Arnd Bergmann Cc: "linux-arch@vger.kernel.org" , Andrew Morton , "linux-kbuild@vger.kernel.org" , Mikael Starvik , Jesper Nilsson , Tony Luck , Fenghua Yu , Geert Uytterhoeven , "David S. Miller" , Christopher Li , Thomas Gleixner , Peter Zijlstra , Kees Cook , Ingo Molnar , Josh Poimboeuf , Will Deacon , "Steven Rostedt (VMware)" , Mark Rutland arcml List-Id: linux-arch.vger.kernel.org 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 abort() but not when builtin translates to actual trap >> inducing instruction. > > I assumed that the trap instruction would trigger the register and > stack dump, as it does on all other architectures. Only if __builtin_trap() translated to that instruction. Otherwise we need to do this inside abort() > The most common > way this is handled is to have one instruction that is known to trap, > and use that to trigger a BUG(), and have __builtin_trap() issue > that instruction as well. Good point. So we'll need ARC specific abort anyways. > You might also want to implement CONFIG_DEBUG_BUGVERBOSE > support to attach further data to it. OK I'll take a look ! > How about overriding abort() with the same instruction that > __builtin_trap() inserts on newer compilers then? That should > make the behavior consistent. Yeah this is a great point ! Will do thx, -Vineet From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtprelay.synopsys.com ([198.182.60.111]:45274 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754428AbdLTU3S (ORCPT ); Wed, 20 Dec 2017 15:29:18 -0500 Subject: Re: [PATCH] bug.h: Work around GCC PR82365 in BUG() References: <20171219114112.939391-1-arnd@arndb.de> <8e42a1de-f619-7a4e-6d58-f90f53f5f38f@synopsys.com> <27bfdc23-1774-cf07-dab4-ab253a41d2f7@synopsys.com> From: Vineet Gupta Message-ID: <861992dd-a28d-0f8c-572f-4194d15238df@synopsys.com> Date: Wed, 20 Dec 2017 12:29:02 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Arnd Bergmann Cc: "linux-arch@vger.kernel.org" , Andrew Morton , "linux-kbuild@vger.kernel.org" , Mikael Starvik , Jesper Nilsson , Tony Luck , Fenghua Yu , Geert Uytterhoeven , "David S. Miller" , Christopher Li , Thomas Gleixner , Peter Zijlstra , Kees Cook , Ingo Molnar , Josh Poimboeuf , Will Deacon , "Steven Rostedt (VMware)" , Mark Rutland , arcml Message-ID: <20171220202902.IJ6NY7mk6NPgzlA4zYiq4xgYxtDV8jimFu0CuwGpTGo@z> 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 abort() but not when builtin translates to actual trap >> inducing instruction. > > I assumed that the trap instruction would trigger the register and > stack dump, as it does on all other architectures. Only if __builtin_trap() translated to that instruction. Otherwise we need to do this inside abort() > The most common > way this is handled is to have one instruction that is known to trap, > and use that to trigger a BUG(), and have __builtin_trap() issue > that instruction as well. Good point. So we'll need ARC specific abort anyways. > You might also want to implement CONFIG_DEBUG_BUGVERBOSE > support to attach further data to it. OK I'll take a look ! > How about overriding abort() with the same instruction that > __builtin_trap() inserts on newer compilers then? That should > make the behavior consistent. Yeah this is a great point ! Will do thx, -Vineet