[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250716235751.119a1273@gandalf.local.home>
Date: Wed, 16 Jul 2025 23:57:51 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Jens Remus <jremus@...ux.ibm.com>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, bpf@...r.kernel.org, x86@...nel.org,
Steven Rostedt <rostedt@...nel.org>, Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>, Ilya Leoshkevich <iii@...ux.ibm.com>,
Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...nel.org>, Namhyung Kim
<namhyung@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, Andrii
Nakryiko <andrii@...nel.org>, Indu Bhagat <indu.bhagat@...cle.com>, "Jose
E. Marchesi" <jemarch@....org>, Beau Belgrave <beaub@...ux.microsoft.com>,
Linus Torvalds <torvalds@...ux-foundation.org>, Andrew Morton
<akpm@...ux-foundation.org>, Jens Axboe <axboe@...nel.dk>, Florian Weimer
<fweimer@...hat.com>, Sam James <sam@...too.org>
Subject: Re: [RFC PATCH v1 08/16] unwind_user: Enable archs that save RA/FP
in other registers
On Wed, 16 Jul 2025 19:01:06 -0700
Josh Poimboeuf <jpoimboe@...nel.org> wrote:
> > + if (unwind_user_get_reg(&ra, frame->ra.regnum))
> > + goto done;
> > + break;
> > + default:
> > + WARN_ON_ONCE(1);
> > + goto done;
>
> The default case will never happen, can we make it a BUG()?
Is this really serious enough to crash the system? WARN_ON_ONCE() *is* for
things that will never happen.
The only time I ever use BUG() is if it's too dangerous to continue (like a
function graph trampoline that gets corrupted and has no place to return
to). In general, usage of BUG() should be avoided.
-- Steve
Powered by blists - more mailing lists