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

From: kernel test robot
Date: Thu Feb 03 2022 - 01:56:01 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/fprobe
head: 1f4f90c86628a76e7eac24ab732db49fc3a961d6
commit: 806149decce8b0870024d2676b46bb3d295c38b3 [7/10] fprobe: Add exit_handler support
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220203/202202031451.vmQ3ciMx-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a73e4ce6a59b01f0e37037761c1e6889d539d233)
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=806149decce8b0870024d2676b46bb3d295c38b3
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 806149decce8b0870024d2676b46bb3d295c38b3
# 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=i386 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

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

:::::: The code at line 14 was first introduced by commit
:::::: 9de3b995c35eb68273cf462f30663340ee47f8d6 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