Re: [PATCHv5 bpf-next 9/9] bpf,x86: Use single ftrace_ops for direct calls

kernel test robot
2025-12-20T19:38:45Z

Hi Jiri,

kernel test robot noticed the following build errors:

[auto build test ERROR on bpf-next/master]

url: https://github.com/intel-lab-lkp/linux/commits/Jiri-Olsa/ftrace-bpf-Remove-FTRACE_OPS_FL_JMP-ftrace_ops-flag/20251216-052916
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20251215211402.353056-10-jolsa%40kernel.org
patch subject: [PATCHv5 bpf-next 9/9] bpf,x86: Use single ftrace_ops for direct calls
config: riscv-allmodconfig (https://download.01.org/0day-ci/archive/20251221/202512210241.4wuAmCHu-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project b324c9f4fa112d61a553bf489b5f4f7ceea05ea8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/202512210241.4wuAmCHu-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512210241.4wuAmCHu-lkp@intel.com/

All errors (new ones prefixed by >>):

>> kernel/bpf/trampoline.c:367:9: error: call to undeclared function 'direct_ops_del'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
367 | ret = direct_ops_del(tr, old_addr);
| ^
kernel/bpf/trampoline.c:367:9: note: did you mean 'direct_ops_free'?
kernel/bpf/trampoline.c:298:13: note: 'direct_ops_free' declared here
298 | static void direct_ops_free(struct bpf_trampoline *tr) { }
| ^
>> kernel/bpf/trampoline.c:381:9: error: call to undeclared function 'direct_ops_mod'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
381 | ret = direct_ops_mod(tr, new_addr, lock_direct_mutex);
| ^
kernel/bpf/trampoline.c:381:9: note: did you mean 'direct_ops_free'?
kernel/bpf/trampoline.c:298:13: note: 'direct_ops_free' declared here
298 | static void direct_ops_free(struct bpf_trampoline *tr) { }
| ^
>> kernel/bpf/trampoline.c:404:9: error: call to undeclared function 'direct_ops_add'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
404 | ret = direct_ops_add(tr, new_addr);
| ^
kernel/bpf/trampoline.c:404:9: note: did you mean 'direct_ops_free'?
kernel/bpf/trampoline.c:298:13: note: 'direct_ops_free' declared here
298 | static void direct_ops_free(struct bpf_trampoline *tr) { }
| ^
3 errors generated.

vim +/direct_ops_del +367 kernel/bpf/trampoline.c

360
361 static int unregister_fentry(struct bpf_trampoline *tr, u32 orig_flags,
362 void *old_addr)
363 {
364 int ret;
365
366 if (tr->func.ftrace_managed)
> 367 ret = direct_ops_del(tr, old_addr);
368 else
369 ret = bpf_trampoline_update_fentry(tr, orig_flags, old_addr, NULL);
370
371 return ret;
372 }
373
374 static int modify_fentry(struct bpf_trampoline *tr, u32 orig_flags,
375 void *old_addr, void *new_addr,
376 bool lock_direct_mutex)
377 {
378 int ret;
379
380 if (tr->func.ftrace_managed) {
> 381 ret = direct_ops_mod(tr, new_addr, lock_direct_mutex);
382 } else {
383 ret = bpf_trampoline_update_fentry(tr, orig_flags, old_addr,
384 new_addr);
385 }
386 return ret;
387 }
388
389 /* first time registering */
390 static int register_fentry(struct bpf_trampoline *tr, void *new_addr)
391 {
392 void *ip = tr->func.addr;
393 unsigned long faddr;
394 int ret;
395
396 faddr = ftrace_location((unsigned long)ip);
397 if (faddr) {
398 if (!tr->fops)
399 return -ENOTSUPP;
400 tr->func.ftrace_managed = true;
401 }
402
403 if (tr->func.ftrace_managed) {
> 404 ret = direct_ops_add(tr, new_addr);
405 } else {
406 ret = bpf_trampoline_update_fentry(tr, 0, NULL, new_addr);
407 }
408
409 return ret;
410 }
411

--
0-DAY CI Kernel Test Service