[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160908183313.ads52kiswgrfrtdz@pd.tnic>
Date: Thu, 8 Sep 2016 20:33:13 +0200
From: Borislav Petkov <bp@...en8.de>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] lockdep: Quiet gcc about dangerous
__builtin_return_address() operations
On Thu, Sep 08, 2016 at 12:34:33PM -0400, Steven Rostedt wrote:
> [
> Boris, does this quiet gcc for you?
> I haven't fully tested this yet, as I still don't have a compiler
> that does the warning.
gcc 6.x should be available in your distro...
> Gcc's new warnings about __builtin_return_address(n) operations with
> n > 0 is popping up around the kernel. The operation is dangerous, and
> the warning is "good to know". But there's instances that we use
> __builtin_return_address(n) with n > 0 and are aware of the issues,
> and work around them. And its used mostly for tracing and debugging. In
> these cases, the warning becomes a distraction and is not helpful.
>
> To get better lock issue traces, a function like get_lock_parent_ip()
> uses __builtin_return_address() to find the caller of the lock, and
> skip over the internal callers of the lock itself. Currently it is only
> used in the kernel/ directory and only if certain configs are enabled.
>
> Create a new config called CONFIG_USING_GET_LOCK_PARENT_IP that gets
> selected when another config relies on get_lock_parent_ip(), and this
> will now enable the function get_lock_parent_ip(), otherwise it wont be
> defined. It will also disable the frame-address warnings from gcc in
> the kernel directory.
>
> Reported-by: Borislav Petkov <bp@...en8.de>
-and-tested-by: me
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
Thanks Steve!
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
Powered by blists - more mailing lists