[atishp04:sbi_pmu_v3 10/17] kernel/events/core.c:9905:11: error: incompatible pointer types assigning to 'bpf_user_pt_regs_t *' (aka 'struct user_regs_struct *') from 'struct pt_regs *'

From: kernel test robot
Date: Sat Aug 28 2021 - 07:14:32 EST


tree: https://github.com/atishp04/linux sbi_pmu_v3
head: 46a46e7fc0526fc679e7dee8a17153b1c26cf1f5
commit: b0cdf4b96d9aca44661e92e56904f32e48303e6c [10/17] RISC-V: Remove the current perf implementation
config: riscv-randconfig-r005-20210827 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4e1a164d7bd53653f79decc121afe784d2fde0a7)
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
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/atishp04/linux/commit/b0cdf4b96d9aca44661e92e56904f32e48303e6c
git remote add atishp04 https://github.com/atishp04/linux
git fetch --no-tags atishp04 sbi_pmu_v3
git checkout b0cdf4b96d9aca44661e92e56904f32e48303e6c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv

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

All errors (new ones prefixed by >>):

kernel/events/core.c:6670:6: warning: no previous prototype for function 'perf_pmu_snapshot_aux' [-Wmissing-prototypes]
long perf_pmu_snapshot_aux(struct perf_buffer *rb,
^
kernel/events/core.c:6670:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
long perf_pmu_snapshot_aux(struct perf_buffer *rb,
^
static
>> kernel/events/core.c:9905:11: error: incompatible pointer types assigning to 'bpf_user_pt_regs_t *' (aka 'struct user_regs_struct *') from 'struct pt_regs *' [-Werror,-Wincompatible-pointer-types]
ctx.regs = perf_arch_bpf_user_pt_regs(regs);
^ ~~~~
1 warning and 1 error generated.


vim +9905 kernel/events/core.c

6fb2915df7f074 kernel/perf_event.c Li Zefan 2009-10-15 9893
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9894 #ifdef CONFIG_BPF_SYSCALL
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9895 static void bpf_overflow_handler(struct perf_event *event,
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9896 struct perf_sample_data *data,
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9897 struct pt_regs *regs)
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9898 {
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9899 struct bpf_perf_event_data_kern ctx = {
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9900 .data = data,
7d9285e82db5de kernel/events/core.c Yonghong Song 2017-10-05 9901 .event = event,
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9902 };
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9903 int ret = 0;
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9904
c895f6f703ad7d kernel/events/core.c Hendrik Brueckner 2017-12-04 @9905 ctx.regs = perf_arch_bpf_user_pt_regs(regs);
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9906 if (unlikely(__this_cpu_inc_return(bpf_prog_active) != 1))
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9907 goto out;
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9908 rcu_read_lock();
88575199cc65de kernel/events/core.c Daniel Borkmann 2016-11-26 9909 ret = BPF_PROG_RUN(event->prog, &ctx);
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9910 rcu_read_unlock();
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9911 out:
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9912 __this_cpu_dec(bpf_prog_active);
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9913 if (!ret)
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9914 return;
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9915
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9916 event->orig_overflow_handler(event, data, regs);
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9917 }
aa6a5f3cb2b2ed kernel/events/core.c Alexei Starovoitov 2016-09-01 9918

:::::: The code at line 9905 was first introduced by commit
:::::: c895f6f703ad7dd2f99e751d9884b0aa5d0eea25 bpf: correct broken uapi for BPF_PROG_TYPE_PERF_EVENT program type

:::::: TO: Hendrik Brueckner <brueckner@xxxxxxxxxxxxxxxxxx>
:::::: CC: Daniel Borkmann <daniel@xxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip