Skip to content

Commit

Permalink
objtool: Treat .text.__x86.* as noinstr
Browse files Browse the repository at this point in the history
Needed because zen_untrain_ret() will be called from noinstr code.

Also makes sense since the thunks MUST NOT contain instrumentation nor
be poked with dynamic instrumentation.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
  • Loading branch information
Peter Zijlstra authored and Borislav Petkov committed Jun 27, 2022
1 parent 7c81c0c commit 951ddec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/objtool/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ static int decode_instructions(struct objtool_file *file)
sec->text = true;

if (!strcmp(sec->name, ".noinstr.text") ||
!strcmp(sec->name, ".entry.text"))
!strcmp(sec->name, ".entry.text") ||
!strncmp(sec->name, ".text.__x86.", 12))
sec->noinstr = true;

for (offset = 0; offset < sec->sh.sh_size; offset += insn->len) {
Expand Down

0 comments on commit 951ddec

Please sign in to comment.