]> git.ipfire.org Git - thirdparty/linux.git/commit
x86/ftrace: Remove OBJECT_FILES_NON_STANDARD usage
authorJosh Poimboeuf <jpoimboe@kernel.org>
Fri, 3 Jun 2022 15:04:44 +0000 (08:04 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Mon, 6 Jun 2022 18:50:22 +0000 (11:50 -0700)
commit7b6c7a877cc616bc7dc9cd39646fe454acbed48b
treefc614303b78a6b3248369ddfa0c1f03c320def88
parentdcea997beed694cbd8705100ca1a6eb0d886de69
x86/ftrace: Remove OBJECT_FILES_NON_STANDARD usage

The file-wide OBJECT_FILES_NON_STANDARD annotation is used with
CONFIG_FRAME_POINTER to tell objtool to skip the entire file when frame
pointers are enabled.  However that annotation is now deprecated because
it doesn't work with IBT, where objtool runs on vmlinux.o instead of
individual translation units.

Instead, use more fine-grained function-specific annotations:

- The 'save_mcount_regs' macro does funny things with the frame pointer.
  Use STACK_FRAME_NON_STANDARD_FP to tell objtool to ignore the
  functions using it.

- The return_to_handler() "function" isn't actually a callable function.
  Instead of being called, it's returned to.  The real return address
  isn't on the stack, so unwinding is already doomed no matter which
  unwinder is used.  So just remove the STT_FUNC annotation, telling
  objtool to ignore it.  That also removes the implicit
  ANNOTATE_NOENDBR, which now needs to be made explicit.

Fixes the following warning:

  vmlinux.o: warning: objtool: __fentry__+0x16: return with modified stack frame

Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/b7a7a42fe306aca37826043dac89e113a1acdbac.1654268610.git.jpoimboe@kernel.org
arch/x86/kernel/Makefile
arch/x86/kernel/ftrace_64.S
include/linux/objtool.h
tools/include/linux/objtool.h