[mhiramat:kprobes/fprobe 8/12] arch/x86/kernel/rethook.c:14:23: warning: no previous prototype for function 'arch_rethook_trampoline_callback'

From: kernel test robot
Date: Tue Mar 08 2022 - 15:37:17 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/fprobe
head: 0bd36e652ac2be74b19f414d0b20aaef6521ac82
commit: 23f61cf25dd4c1cf50adce7ebe0e2ae65bef5b78 [8/12] fprobe: Add exit_handler support
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220309/202203090445.eMw6Gp37-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 4e115b7d881136947c083e12f62010bc6b1d3f00)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/commit/?id=23f61cf25dd4c1cf50adce7ebe0e2ae65bef5b78
git remote add mhiramat https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
git fetch --no-tags mhiramat kprobes/fprobe
git checkout 23f61cf25dd4c1cf50adce7ebe0e2ae65bef5b78
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kernel/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/rethook.c:14:23: warning: no previous prototype for function 'arch_rethook_trampoline_callback' [-Wmissing-prototypes]
__used __visible void arch_rethook_trampoline_callback(struct pt_regs *regs)
^
arch/x86/kernel/rethook.c:14:18: note: declare 'static' if the function is not intended to be used outside of this translation unit
__used __visible void arch_rethook_trampoline_callback(struct pt_regs *regs)
^
static
1 warning generated.


vim +/arch_rethook_trampoline_callback +14 arch/x86/kernel/rethook.c

31ffbcef413de8 Masami Hiramatsu 2022-02-09 10
31ffbcef413de8 Masami Hiramatsu 2022-02-09 11 /*
31ffbcef413de8 Masami Hiramatsu 2022-02-09 12 * Called from arch_rethook_trampoline
31ffbcef413de8 Masami Hiramatsu 2022-02-09 13 */
31ffbcef413de8 Masami Hiramatsu 2022-02-09 @14 __used __visible void arch_rethook_trampoline_callback(struct pt_regs *regs)
31ffbcef413de8 Masami Hiramatsu 2022-02-09 15 {
31ffbcef413de8 Masami Hiramatsu 2022-02-09 16 unsigned long *frame_pointer;
31ffbcef413de8 Masami Hiramatsu 2022-02-09 17
31ffbcef413de8 Masami Hiramatsu 2022-02-09 18 /* fixup registers */
31ffbcef413de8 Masami Hiramatsu 2022-02-09 19 regs->cs = __KERNEL_CS;
31ffbcef413de8 Masami Hiramatsu 2022-02-09 20 #ifdef CONFIG_X86_32
31ffbcef413de8 Masami Hiramatsu 2022-02-09 21 regs->gs = 0;
31ffbcef413de8 Masami Hiramatsu 2022-02-09 22 #endif
31ffbcef413de8 Masami Hiramatsu 2022-02-09 23 regs->ip = (unsigned long)&arch_rethook_trampoline;
31ffbcef413de8 Masami Hiramatsu 2022-02-09 24 regs->orig_ax = ~0UL;
31ffbcef413de8 Masami Hiramatsu 2022-02-09 25 regs->sp += sizeof(long);
31ffbcef413de8 Masami Hiramatsu 2022-02-09 26 frame_pointer = &regs->sp + 1;
31ffbcef413de8 Masami Hiramatsu 2022-02-09 27
31ffbcef413de8 Masami Hiramatsu 2022-02-09 28 /*
31ffbcef413de8 Masami Hiramatsu 2022-02-09 29 * The return address at 'frame_pointer' is recovered by the
31ffbcef413de8 Masami Hiramatsu 2022-02-09 30 * arch_rethook_fixup_return() which called from this
31ffbcef413de8 Masami Hiramatsu 2022-02-09 31 * rethook_trampoline_handler().
31ffbcef413de8 Masami Hiramatsu 2022-02-09 32 */
31ffbcef413de8 Masami Hiramatsu 2022-02-09 33 rethook_trampoline_handler(regs, (unsigned long)frame_pointer);
31ffbcef413de8 Masami Hiramatsu 2022-02-09 34
31ffbcef413de8 Masami Hiramatsu 2022-02-09 35 /*
31ffbcef413de8 Masami Hiramatsu 2022-02-09 36 * Copy FLAGS to 'pt_regs::sp' so that arch_rethook_trapmoline()
31ffbcef413de8 Masami Hiramatsu 2022-02-09 37 * can do RET right after POPF.
31ffbcef413de8 Masami Hiramatsu 2022-02-09 38 */
31ffbcef413de8 Masami Hiramatsu 2022-02-09 39 regs->sp = regs->flags;
31ffbcef413de8 Masami Hiramatsu 2022-02-09 40 }
31ffbcef413de8 Masami Hiramatsu 2022-02-09 41 NOKPROBE_SYMBOL(arch_rethook_trampoline_callback);
31ffbcef413de8 Masami Hiramatsu 2022-02-09 42

:::::: The code at line 14 was first introduced by commit
:::::: 31ffbcef413de82a1b0afc177b5d85364495f0cd rethook: x86: Add rethook x86 implementation

:::::: TO: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
:::::: CC: Masami Hiramatsu <mhiramat@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx