summaryrefslogtreecommitdiff
path: root/tools/objtool
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-09-07 11:01:20 +0200
committerPeter Zijlstra <peterz@infradead.org>2022-09-15 16:13:55 +0200
commit7a7621dfa417aa3715d2a3bd1bdd6cf5018274d0 (patch)
treedbdcab15e010dd846a7c8504838392f4a71b2111 /tools/objtool
parent3c6f3900808c483b0bbb2c351f995c7b880dae14 (diff)
downloadlinux-7a7621dfa417aa3715d2a3bd1bdd6cf5018274d0.tar.gz
objtool,x86: Teach decode about LOOP* instructions
When 'discussing' control flow Masami mentioned the LOOP* instructions and I realized objtool doesn't decode them properly. As it turns out, these instructions are somewhat inefficient and as such unlikely to be emitted by the compiler (a few vmlinux.o checks can't find a single one) so this isn't critical, but still, best to decode them properly. Reported-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/Yxhd4EMKyoFoH9y4@hirez.programming.kicks-ass.net
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/arch/x86/decode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index c260006106be..1c253b4b7ce0 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -635,6 +635,12 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec
*type = INSN_CONTEXT_SWITCH;
break;
+ case 0xe0: /* loopne */
+ case 0xe1: /* loope */
+ case 0xe2: /* loop */
+ *type = INSN_JUMP_CONDITIONAL;
+ break;
+
case 0xe8:
*type = INSN_CALL;
/*