aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2017-06-30 10:09:34 -0400
committerIngo Molnar <mingo@kernel.org>2017-06-30 13:43:50 -0400
commit2513cbf9d622d85268655bfd787d4f004342cfc9 (patch)
treec66479a517139bf82bd27a5dcc46e31c1ba71814
parentbaa41469a7b992c1e3db2a39854219cc7442e48f (diff)
objtool: Silence warnings for functions which use IRET
Previously, objtool ignored functions which have the IRET instruction in them. That's because it assumed that such functions know what they're doing with respect to frame pointers. With the new "objtool 2.0" changes, it stopped ignoring such functions, and started complaining about them: arch/x86/kernel/alternative.o: warning: objtool: do_sync_core()+0x1b: unsupported instruction in callable function arch/x86/kernel/alternative.o: warning: objtool: text_poke()+0x1a8: unsupported instruction in callable function arch/x86/kernel/ftrace.o: warning: objtool: do_sync_core()+0x16: unsupported instruction in callable function arch/x86/kernel/cpu/mcheck/mce.o: warning: objtool: machine_check_poll()+0x166: unsupported instruction in callable function arch/x86/kernel/cpu/mcheck/mce.o: warning: objtool: do_machine_check()+0x147: unsupported instruction in callable function Silence those warnings for now. They can be re-enabled later, once we have unwind hints which will allow the code to annotate the IRET usages. Reported-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: live-patching@vger.kernel.org Fixes: baa41469a7b9 ("objtool: Implement stack validation 2.0") Link: http://lkml.kernel.org/r/20170630140934.mmwtpockvpupahro@treble Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--tools/objtool/check.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 2f80aa511243..fea222192c57 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -100,6 +100,7 @@ static bool gcov_enabled(struct objtool_file *file)
100static bool ignore_func(struct objtool_file *file, struct symbol *func) 100static bool ignore_func(struct objtool_file *file, struct symbol *func)
101{ 101{
102 struct rela *rela; 102 struct rela *rela;
103 struct instruction *insn;
103 104
104 /* check for STACK_FRAME_NON_STANDARD */ 105 /* check for STACK_FRAME_NON_STANDARD */
105 if (file->whitelist && file->whitelist->rela) 106 if (file->whitelist && file->whitelist->rela)
@@ -112,6 +113,11 @@ static bool ignore_func(struct objtool_file *file, struct symbol *func)
112 return true; 113 return true;
113 } 114 }
114 115
116 /* check if it has a context switching instruction */
117 func_for_each_insn(file, func, insn)
118 if (insn->type == INSN_CONTEXT_SWITCH)
119 return true;
120
115 return false; 121 return false;
116} 122}
117 123
@@ -1446,14 +1452,6 @@ static int validate_branch(struct objtool_file *file, struct instruction *first,
1446 1452
1447 return 0; 1453 return 0;
1448 1454
1449 case INSN_CONTEXT_SWITCH:
1450 if (func) {
1451 WARN_FUNC("unsupported instruction in callable function",
1452 sec, insn->offset);
1453 return 1;
1454 }
1455 return 0;
1456
1457 case INSN_STACK: 1455 case INSN_STACK:
1458 if (update_insn_state(insn, &state)) 1456 if (update_insn_state(insn, &state))
1459 return -1; 1457 return -1;