]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: Introduce ftrace_need_init_nop()
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 28 Jul 2021 21:25:45 +0000 (23:25 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 3 Aug 2021 12:31:40 +0000 (14:31 +0200)
commitf1e3e5b798ecea204a9cd7c4c768aad1d567fcbd
treecbc130b1c3c4da92e7c87b8cd5c70942e697ab60
parentabe398b7ed6611cb8d079f2722aa9cddd5920cd1
ftrace: Introduce ftrace_need_init_nop()

Implementing live patching on s390 requires each function's prologue to
contain a very special kind of nop, which gcc and clang don't generate.
However, the current code assumes that if CC_USING_NOP_MCOUNT is
defined, then whatever the compiler generates is good enough.

Move the CC_USING_NOP_MCOUNT check into the new ftrace_need_init_nop()
macro, that the architectures can override.

An alternative solution is to disable using -mnop-mcount in the
Makefile, however, this makes the build logic (even) more complicated
and forces the arch-specific code to deal with the useless __fentry__
symbol.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20210728212546.128248-2-iii@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
include/linux/ftrace.h
kernel/trace/ftrace.c