aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-03-09 01:06:54 -0500
committerIngo Molnar <mingo@kernel.org>2016-03-09 04:48:08 -0500
commitd8d1b2cb58540b0cf572be4715167c473193888e (patch)
treeca57817439709d3607c8bc71e477ec438a123c81 /tools
parentd435fb5ef74c31909ca58f93aa87ad09b17bbe9a (diff)
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 <jpoimboe@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at> Cc: Borislav Petkov <bp@alien8.de> Cc: Chris J Arges <chris.j.arges@canonical.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michal Marek <mmarek@suse.cz> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Pedro Alves <palves@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/382de77ccaaa8cd79b27a155c3d109ebd4ce0219.1457502970.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/objtool/builtin-check.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index 51da270758f0..fe248044415b 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)
729 (insn->state & STATE_FP_SETUP); 729 (insn->state & STATE_FP_SETUP);
730} 730}
731 731
732static unsigned int frame_state(unsigned long state)
733{
734 return (state & (STATE_FP_SAVED | STATE_FP_SETUP));
735}
736
732/* 737/*
733 * Follow the branch starting at the given instruction, and recursively follow 738 * Follow the branch starting at the given instruction, and recursively follow
734 * any other branches (jumps). Meanwhile, track the frame pointer state at 739 * any other branches (jumps). Meanwhile, track the frame pointer state at
@@ -756,7 +761,7 @@ static int validate_branch(struct objtool_file *file,
756 761
757 while (1) { 762 while (1) {
758 if (insn->visited) { 763 if (insn->visited) {
759 if (insn->state != state) { 764 if (frame_state(insn->state) != frame_state(state)) {
760 WARN_FUNC("frame pointer state mismatch", 765 WARN_FUNC("frame pointer state mismatch",
761 sec, insn->offset); 766 sec, insn->offset);
762 warnings++; 767 warnings++;