From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932377AbcCILpU (ORCPT ); Wed, 9 Mar 2016 06:45:20 -0500 Received: from torg.zytor.com ([198.137.202.12]:37762 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932312AbcCILo7 (ORCPT ); Wed, 9 Mar 2016 06:44:59 -0500 Date: Wed, 9 Mar 2016 03:43:55 -0800 From: tip-bot for Josh Poimboeuf Message-ID: Cc: akpm@linux-foundation.org, tglx@linutronix.de, jslaby@suse.cz, mingo@kernel.org, mmarek@suse.cz, palves@redhat.com, linux-kernel@vger.kernel.org, bp@alien8.de, bernd@petrovitsch.priv.at, acme@infradead.org, luto@kernel.org, namhyung@gmail.com, hpa@zytor.com, jpoimboe@redhat.com, peterz@infradead.org, acme@kernel.org, torvalds@linux-foundation.org, chris.j.arges@canonical.com Reply-To: tglx@linutronix.de, akpm@linux-foundation.org, palves@redhat.com, mmarek@suse.cz, bernd@petrovitsch.priv.at, bp@alien8.de, linux-kernel@vger.kernel.org, jslaby@suse.cz, mingo@kernel.org, acme@infradead.org, torvalds@linux-foundation.org, chris.j.arges@canonical.com, luto@kernel.org, namhyung@gmail.com, peterz@infradead.org, jpoimboe@redhat.com, acme@kernel.org, hpa@zytor.com In-Reply-To: <382de77ccaaa8cd79b27a155c3d109ebd4ce0219.1457502970.git.jpoimboe@redhat.com> References: <382de77ccaaa8cd79b27a155c3d109ebd4ce0219.1457502970.git.jpoimboe@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/objtool] objtool: Fix false positive warnings related to sibling calls Git-Commit-ID: d8d1b2cb58540b0cf572be4715167c473193888e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d8d1b2cb58540b0cf572be4715167c473193888e Gitweb: http://git.kernel.org/tip/d8d1b2cb58540b0cf572be4715167c473193888e Author: Josh Poimboeuf AuthorDate: Wed, 9 Mar 2016 00:06:54 -0600 Committer: Ingo Molnar CommitDate: Wed, 9 Mar 2016 10:48:08 +0100 objtool: Fix false positive warnings related to sibling calls With some configs [1], objtool prints a bunch of false positive warnings like: arch/x86/events/core.o: warning: objtool: x86_del_exclusive()+0x0: frame pointer state mismatch For some reason this config has a bunch of sibling calls. When objtool follows a sibling call jump, it attempts to compare the frame pointer state. But it also accidentally compares the FENTRY state, resulting in a false positive warning. [1] https://lkml.kernel.org/r/20160308154909.GA20956@gmail.com Signed-off-by: Josh Poimboeuf Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Chris J Arges Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/382de77ccaaa8cd79b27a155c3d109ebd4ce0219.1457502970.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- tools/objtool/builtin-check.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 51da270..fe24804 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -729,6 +729,11 @@ static bool has_valid_stack_frame(struct instruction *insn) (insn->state & STATE_FP_SETUP); } +static unsigned int frame_state(unsigned long state) +{ + return (state & (STATE_FP_SAVED | STATE_FP_SETUP)); +} + /* * Follow the branch starting at the given instruction, and recursively follow * any other branches (jumps). Meanwhile, track the frame pointer state at @@ -756,7 +761,7 @@ static int validate_branch(struct objtool_file *file, while (1) { if (insn->visited) { - if (insn->state != state) { + if (frame_state(insn->state) != frame_state(state)) { WARN_FUNC("frame pointer state mismatch", sec, insn->offset); warnings++;