Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Vineet Gupta <Vineet.Gupta1@xxxxxxxxxxxx>
- Subject: Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()
- From: Arnd Bergmann <arnd@xxxxxxxx>
- Date: Wed, 20 Dec 2017 10:01:27 +0100
- Cc: "linux-arch@xxxxxxxxxxxxxxx" <linux-arch@xxxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, "linux-kbuild@xxxxxxxxxxxxxxx" <linux-kbuild@xxxxxxxxxxxxxxx>, Mikael Starvik <starvik@xxxxxxxx>, Jesper Nilsson <jesper.nilsson@xxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Christopher Li <sparse@xxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Josh Poimboeuf <jpoimboe@xxxxxxxxxx>, Will Deacon <will.deacon@xxxxxxx>, "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, "linux-snps-arc@xxxxxxxxxxxxxxxxxxx" <linux-snps-arc@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "linux-cris-kernel@xxxxxxxx" <linux-cris-kernel@xxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>, "linux-m68k@xxxxxxxxxxxxxxxxxxxx" <linux-m68k@xxxxxxxxxxxxxxx>, "sparclinux@xxxxxxxxxxxxxxx" <sparclinux@xxxxxxxxxxxxxxx>, "linux-sparse@xxxxxxxxxxxxxxx" <linux-sparse@xxxxxxxxxxxxxxx>
- In-reply-to: <f31caa9b-89f0-4168-04bf-14a98595865e@synopsys.com>
- References: <20171219114112.939391-1-arnd@arndb.de> <8e42a1de-f619-7a4e-6d58-f90f53f5f38f@synopsys.com> <CAK8P3a2fXQHCN7gqNL9j7AeZqy7NXAMW1bqyFJs3G1M_M4BQ4A@mail.gmail.com> <f31caa9b-89f0-4168-04bf-14a98595865e@synopsys.com>
On Tue, Dec 19, 2017 at 11:38 PM, Vineet Gupta
<Vineet.Gupta1@xxxxxxxxxxxx> 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 end of
>> non-void
>> function' warnings, but then makes us run into the stack size problem that
>> I work around with the barrier_before_unreachable().
>>
>> It would be good if you could give this a quick test to see if you get
>> sensible
>> output from the __builtin_trap();
>
>
> It does, added a BUG() arbit, hits an abort()
>
> ...
> ISA Extn : atomic ll64 unalign (not used)
> : mpy[opt 9] div_rem norm barrel-shift swap minmax swape
> BPU : partial match, cache:2048, Predict Table:16384
> BUG: failure at ../arch/arc/mm/tlb.c:827/arc_mmu_init()!
>
>
> Tested-by: Vineet Gupta <vgupta@xxxxxxxxxxxx>
I meant whether it prints the right registers and stack trace, but I
assume you tested that and just did not list it above.
> FWIW newer ARC gcc actually implements the builtin so we get a trap 5
> instruction now, vs., abort() calls before.
>
> BTW I missed reading the hunk of your changelog where this addresses the
> long standing mystery with ARC builds and numerous -Wreturn-type warnings. I
> always wondered why they were not fixed upstream already, being too lazy to
> investigate myself, and turns out this was due to this BUG() thingy. phew !
Hmm, so with the new definition of abort(),
+__weak void abort(void)
+{
+ BUG();
+
+ /* if that doesn't kill us, halt */
+ panic("Oops failed to kill thread");
+}
won't that run into an endless recursion? Or do you then override abort()
for ARC?
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]