Skip to content

Commit 7a7621d

Browse files
author
Peter Zijlstra
committed
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
1 parent 3c6f390 commit 7a7621d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/objtool/arch/x86/decode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec
635635
*type = INSN_CONTEXT_SWITCH;
636636
break;
637637

638+
case 0xe0: /* loopne */
639+
case 0xe1: /* loope */
640+
case 0xe2: /* loop */
641+
*type = INSN_JUMP_CONDITIONAL;
642+
break;
643+
638644
case 0xe8:
639645
*type = INSN_CALL;
640646
/*

0 commit comments

Comments
 (0)