Skip to content

Commit

Permalink
Merge tag 'objtool-core-2022-10-07' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/tip/tip

Pull objtool updates from Ingo Molnar:

 - Remove the "ANNOTATE_NOENDBR on ENDBR" warning: it's not really
   useful and only found a non-bug false positive so far.

 - Properly decode LOOP/LOOPE/LOOPNE, which were missing from the x86
   decoder. Because these instructions are rather ineffective, they
   never showed up in compiler output, but they are simple enough to
   support, so add them for completeness.

 - A bit more cross-arch preparatory work.

* tag 'objtool-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  objtool,x86: Teach decode about LOOP* instructions
  objtool: Remove "ANNOTATE_NOENDBR on ENDBR" warning
  objtool: Use arch_jump_destination() in read_intra_function_calls()
  • Loading branch information
torvalds committed Oct 10, 2022
2 parents 3e71f01 + 7a7621d commit 65f109e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions tools/objtool/arch/x86/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/*
Expand Down
5 changes: 1 addition & 4 deletions tools/objtool/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -2107,9 +2107,6 @@ static int read_noendbr_hints(struct objtool_file *file)
return -1;
}

if (insn->type == INSN_ENDBR)
WARN_FUNC("ANNOTATE_NOENDBR on ENDBR", insn->sec, insn->offset);

insn->noendbr = 1;
}

Expand Down Expand Up @@ -2238,7 +2235,7 @@ static int read_intra_function_calls(struct objtool_file *file)
*/
insn->type = INSN_JUMP_UNCONDITIONAL;

dest_off = insn->offset + insn->len + insn->immediate;
dest_off = arch_jump_destination(insn);
insn->jump_dest = find_insn(file, insn->sec, dest_off);
if (!insn->jump_dest) {
WARN_FUNC("can't find call dest at %s+0x%lx",
Expand Down

0 comments on commit 65f109e

Please sign in to comment.