From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [peterz-queue:perf/kprobes 1/2] arch/riscv/kernel/probes/kprobes.c:284:12: error: no member named 'fault_handler' in 'struct kprobe'
Date: Tue, 09 Mar 2021 05:05:59 +0800 [thread overview]
Message-ID: <202103090554.VHQhnVHM-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 9874 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/kprobes
head: 9282e5b609d58d5022da44fc9ee2f26ccd3007d0
commit: a7d8b461a8940743676660716e5a11aa16fe77ea [1/2] kprobes: Remove kprobe::fault_handler
config: riscv-randconfig-r003-20210309 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 3a11a41795bec548e91621caaa4cc00fc31b2212)
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://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=a7d8b461a8940743676660716e5a11aa16fe77ea
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue perf/kprobes
git checkout a7d8b461a8940743676660716e5a11aa16fe77ea
# 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@intel.com>
All errors (new ones prefixed by >>):
>> arch/riscv/kernel/probes/kprobes.c:284:12: error: no member named 'fault_handler' in 'struct kprobe'
if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
~~~ ^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
arch/riscv/kernel/probes/kprobes.c:284:34: error: no member named 'fault_handler' in 'struct kprobe'
if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
~~~ ^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> arch/riscv/kernel/probes/kprobes.c:284:12: error: no member named 'fault_handler' in 'struct kprobe'
if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
~~~ ^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~
include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
arch/riscv/kernel/probes/kprobes.c:284:34: error: no member named 'fault_handler' in 'struct kprobe'
if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
~~~ ^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~
include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> arch/riscv/kernel/probes/kprobes.c:284:12: error: no member named 'fault_handler' in 'struct kprobe'
if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
~~~ ^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
arch/riscv/kernel/probes/kprobes.c:284:34: error: no member named 'fault_handler' in 'struct kprobe'
if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
~~~ ^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
6 errors generated.
vim +284 arch/riscv/kernel/probes/kprobes.c
c22b0bcb1dd024 Guo Ren 2020-12-17 242
c22b0bcb1dd024 Guo Ren 2020-12-17 243 int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int trapnr)
c22b0bcb1dd024 Guo Ren 2020-12-17 244 {
c22b0bcb1dd024 Guo Ren 2020-12-17 245 struct kprobe *cur = kprobe_running();
c22b0bcb1dd024 Guo Ren 2020-12-17 246 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
c22b0bcb1dd024 Guo Ren 2020-12-17 247
c22b0bcb1dd024 Guo Ren 2020-12-17 248 switch (kcb->kprobe_status) {
c22b0bcb1dd024 Guo Ren 2020-12-17 249 case KPROBE_HIT_SS:
c22b0bcb1dd024 Guo Ren 2020-12-17 250 case KPROBE_REENTER:
c22b0bcb1dd024 Guo Ren 2020-12-17 251 /*
c22b0bcb1dd024 Guo Ren 2020-12-17 252 * We are here because the instruction being single
c22b0bcb1dd024 Guo Ren 2020-12-17 253 * stepped caused a page fault. We reset the current
c22b0bcb1dd024 Guo Ren 2020-12-17 254 * kprobe and the ip points back to the probe address
c22b0bcb1dd024 Guo Ren 2020-12-17 255 * and allow the page fault handler to continue as a
c22b0bcb1dd024 Guo Ren 2020-12-17 256 * normal page fault.
c22b0bcb1dd024 Guo Ren 2020-12-17 257 */
c22b0bcb1dd024 Guo Ren 2020-12-17 258 regs->epc = (unsigned long) cur->addr;
c22b0bcb1dd024 Guo Ren 2020-12-17 259 if (!instruction_pointer(regs))
c22b0bcb1dd024 Guo Ren 2020-12-17 260 BUG();
c22b0bcb1dd024 Guo Ren 2020-12-17 261
c22b0bcb1dd024 Guo Ren 2020-12-17 262 if (kcb->kprobe_status == KPROBE_REENTER)
c22b0bcb1dd024 Guo Ren 2020-12-17 263 restore_previous_kprobe(kcb);
c22b0bcb1dd024 Guo Ren 2020-12-17 264 else
c22b0bcb1dd024 Guo Ren 2020-12-17 265 reset_current_kprobe();
c22b0bcb1dd024 Guo Ren 2020-12-17 266
c22b0bcb1dd024 Guo Ren 2020-12-17 267 break;
c22b0bcb1dd024 Guo Ren 2020-12-17 268 case KPROBE_HIT_ACTIVE:
c22b0bcb1dd024 Guo Ren 2020-12-17 269 case KPROBE_HIT_SSDONE:
c22b0bcb1dd024 Guo Ren 2020-12-17 270 /*
c22b0bcb1dd024 Guo Ren 2020-12-17 271 * We increment the nmissed count for accounting,
c22b0bcb1dd024 Guo Ren 2020-12-17 272 * we can also use npre/npostfault count for accounting
c22b0bcb1dd024 Guo Ren 2020-12-17 273 * these specific fault cases.
c22b0bcb1dd024 Guo Ren 2020-12-17 274 */
c22b0bcb1dd024 Guo Ren 2020-12-17 275 kprobes_inc_nmissed_count(cur);
c22b0bcb1dd024 Guo Ren 2020-12-17 276
c22b0bcb1dd024 Guo Ren 2020-12-17 277 /*
c22b0bcb1dd024 Guo Ren 2020-12-17 278 * We come here because instructions in the pre/post
c22b0bcb1dd024 Guo Ren 2020-12-17 279 * handler caused the page_fault, this could happen
c22b0bcb1dd024 Guo Ren 2020-12-17 280 * if handler tries to access user space by
c22b0bcb1dd024 Guo Ren 2020-12-17 281 * copy_from_user(), get_user() etc. Let the
c22b0bcb1dd024 Guo Ren 2020-12-17 282 * user-specified handler try to fix it first.
c22b0bcb1dd024 Guo Ren 2020-12-17 283 */
c22b0bcb1dd024 Guo Ren 2020-12-17 @284 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
c22b0bcb1dd024 Guo Ren 2020-12-17 285 return 1;
c22b0bcb1dd024 Guo Ren 2020-12-17 286
c22b0bcb1dd024 Guo Ren 2020-12-17 287 /*
c22b0bcb1dd024 Guo Ren 2020-12-17 288 * In case the user-specified fault handler returned
c22b0bcb1dd024 Guo Ren 2020-12-17 289 * zero, try to fix up.
c22b0bcb1dd024 Guo Ren 2020-12-17 290 */
c22b0bcb1dd024 Guo Ren 2020-12-17 291 if (fixup_exception(regs))
c22b0bcb1dd024 Guo Ren 2020-12-17 292 return 1;
c22b0bcb1dd024 Guo Ren 2020-12-17 293 }
c22b0bcb1dd024 Guo Ren 2020-12-17 294 return 0;
c22b0bcb1dd024 Guo Ren 2020-12-17 295 }
c22b0bcb1dd024 Guo Ren 2020-12-17 296
:::::: The code at line 284 was first introduced by commit
:::::: c22b0bcb1dd024cb9caad9230e3a387d8b061df5 riscv: Add kprobes supported
:::::: TO: Guo Ren <guoren@linux.alibaba.com>
:::::: CC: Palmer Dabbelt <palmerdabbelt@google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31466 bytes --]
next reply other threads:[~2021-03-08 21:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 21:05 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-03-03 21:17 [peterz-queue:perf/kprobes 1/2] arch/riscv/kernel/probes/kprobes.c:284:12: error: no member named 'fault_handler' in 'struct kprobe' kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202103090554.VHQhnVHM-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.