From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759021AbcIHSdT (ORCPT ); Thu, 8 Sep 2016 14:33:19 -0400 Received: from mail.skyhub.de ([78.46.96.112]:59743 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757683AbcIHSdR (ORCPT ); Thu, 8 Sep 2016 14:33:17 -0400 Date: Thu, 8 Sep 2016 20:33:13 +0200 From: Borislav Petkov To: Steven Rostedt Cc: LKML , Sebastian Andrzej Siewior , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Peter Zijlstra Subject: Re: [PATCH] lockdep: Quiet gcc about dangerous __builtin_return_address() operations Message-ID: <20160908183313.ads52kiswgrfrtdz@pd.tnic> References: <20160908123433.2cf93b96@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160908123433.2cf93b96@gandalf.local.home> User-Agent: NeoMutt/ (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -and-tested-by: me > Signed-off-by: Steven Rostedt Thanks Steve! -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.