[PATCH] rethook: add riscv rethook implementation.

kernel test robot lkp at intel.com
Thu Sep 22 01:40:33 PDT 2022


Hi Binglei,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on rostedt-trace/for-next]
[also build test ERROR on linus/master v6.0-rc6 next-20220921]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Binglei-Wang/rethook-add-riscv-rethook-implementation/20220922-120748
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
config: arc-defconfig (https://download.01.org/0day-ci/archive/20220922/202209221624.rWsWQbRt-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 12.1.0
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://github.com/intel-lab-lkp/linux/commit/3f86f610d114317cd7f7a7a1c9116fa0b916667a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Binglei-Wang/rethook-add-riscv-rethook-implementation/20220922-120748
        git checkout 3f86f610d114317cd7f7a7a1c9116fa0b916667a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

   In file included from arch/arc/kernel/kprobes.c:7:
   include/linux/kprobes.h: In function 'arch_prepare_kretprobe':
   include/linux/kprobes.h:225:49: error: 'struct pt_regs' has no member named 'ra'; did you mean 'r0'?
     225 |         ri->ret_addr = (kprobe_opcode_t *)regs->ra;
         |                                                 ^~
         |                                                 r0
   include/linux/kprobes.h:227:15: error: 'struct pt_regs' has no member named 'ra'; did you mean 'r0'?
     227 |         regs->ra = (unsigned long) &__kretprobe_trampoline;
         |               ^~
         |               r0
   arch/arc/kernel/kprobes.c: At top level:
   arch/arc/kernel/kprobes.c:193:15: warning: no previous prototype for 'arc_kprobe_handler' [-Wmissing-prototypes]
     193 | int __kprobes arc_kprobe_handler(unsigned long addr, struct pt_regs *regs)
         |               ^~~~~~~~~~~~~~~~~~
>> arch/arc/kernel/kprobes.c:371:16: error: redefinition of 'arch_prepare_kretprobe'
     371 | void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
         |                ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/kprobes.h:222:29: note: previous definition of 'arch_prepare_kretprobe' with type 'void(struct kretprobe_instance *, struct pt_regs *)'
     222 | static nokprobe_inline void arch_prepare_kretprobe(struct kretprobe_instance *ri,
         |                             ^~~~~~~~~~~~~~~~~~~~~~


vim +/arch_prepare_kretprobe +371 arch/arc/kernel/kprobes.c

4d86dfbbda09b3 Vineet Gupta     2013-01-22  370  
4d86dfbbda09b3 Vineet Gupta     2013-01-22 @371  void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
4d86dfbbda09b3 Vineet Gupta     2013-01-22  372  				      struct pt_regs *regs)
4d86dfbbda09b3 Vineet Gupta     2013-01-22  373  {
4d86dfbbda09b3 Vineet Gupta     2013-01-22  374  
4d86dfbbda09b3 Vineet Gupta     2013-01-22  375  	ri->ret_addr = (kprobe_opcode_t *) regs->blink;
f75dd136b65ccc Masami Hiramatsu 2020-08-29  376  	ri->fp = NULL;
4d86dfbbda09b3 Vineet Gupta     2013-01-22  377  
4d86dfbbda09b3 Vineet Gupta     2013-01-22  378  	/* Replace the return addr with trampoline addr */
adf8a61a940c49 Masami Hiramatsu 2021-09-14  379  	regs->blink = (unsigned long)&__kretprobe_trampoline;
4d86dfbbda09b3 Vineet Gupta     2013-01-22  380  }
4d86dfbbda09b3 Vineet Gupta     2013-01-22  381  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



More information about the linux-riscv mailing list