summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2022-06-03 18:04:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-22 15:28:03 +0300
commitead1da2bba23a02728befae0d3c44322ae21c50c (patch)
tree2b9c40589365af0f18aa6e010b1ee51a4aa7a6be /include/linux
parent745897a359b4d44ba4866b768abc522409805cdc (diff)
downloadlinux-ead1da2bba23a02728befae0d3c44322ae21c50c.tar.xz
x86/ftrace: Remove OBJECT_FILES_NON_STANDARD usage
[ Upstream commit 7b6c7a877cc616bc7dc9cd39646fe454acbed48b ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/objtool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/objtool.h b/include/linux/objtool.h
index 586d35720f13..c81ea2264ad8 100644
--- a/include/linux/objtool.h
+++ b/include/linux/objtool.h
@@ -141,6 +141,12 @@ struct unwind_hint {
.popsection
.endm
+.macro STACK_FRAME_NON_STANDARD_FP func:req
+#ifdef CONFIG_FRAME_POINTER
+ STACK_FRAME_NON_STANDARD \func
+#endif
+.endm
+
.macro ANNOTATE_NOENDBR
.Lhere_\@:
.pushsection .discard.noendbr