All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Raj Sahu <rjsu26@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC bpf-next 4/4] bpf: Runtime part of fast-path termination approach
Date: Sun, 20 Apr 2025 22:15:05 +0800	[thread overview]
Message-ID: <202504202116.gfxIZI0c-lkp@intel.com> (raw)
In-Reply-To: <20250420105524.2115690-5-rjsu26@gmail.com>

Hi Raj,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

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

url:    https://github.com/intel-lab-lkp/linux/commits/Raj-Sahu/bpf-Introduce-new-structs-and-struct-fields/20250420-185825
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20250420105524.2115690-5-rjsu26%40gmail.com
patch subject: [RFC bpf-next 4/4] bpf: Runtime part of fast-path termination approach
config: arc-randconfig-002-20250420 (https://download.01.org/0day-ci/archive/20250420/202504202116.gfxIZI0c-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250420/202504202116.gfxIZI0c-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/202504202116.gfxIZI0c-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/bpf/syscall.c: In function 'bpf_prog_load':
   kernel/bpf/syscall.c:2981:14: warning: variable 'have_termination_prog' set but not used [-Wunused-but-set-variable]
    2981 |         bool have_termination_prog = false;
         |              ^~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c: In function 'bpf_die':
   kernel/bpf/syscall.c:6077:29: error: storage size of 'state' isn't known
    6077 |         struct unwind_state state;
         |                             ^~~~~
   kernel/bpf/syscall.c:6094:9: error: implicit declaration of function 'unwind_start' [-Werror=implicit-function-declaration]
    6094 |         unwind_start(&state, current, regs, NULL);
         |         ^~~~~~~~~~~~
   kernel/bpf/syscall.c:6095:16: error: implicit declaration of function 'unwind_get_return_address'; did you mean 'ftrace_return_address'? [-Werror=implicit-function-declaration]
    6095 |         addr = unwind_get_return_address(&state);
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~
         |                ftrace_return_address
   kernel/bpf/syscall.c:6104:23: error: 'struct pt_regs' has no member named 'ip'; did you mean 'fp'?
    6104 |                 regs->ip = new_addr;
         |                       ^~
         |                       fp
   kernel/bpf/syscall.c:6132:17: error: implicit declaration of function 'unwind_next_frame' [-Werror=implicit-function-declaration]
    6132 |                 unwind_next_frame(&state);
         |                 ^~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:6077:29: warning: unused variable 'state' [-Wunused-variable]
    6077 |         struct unwind_state state;
         |                             ^~~~~
   cc1: some warnings being treated as errors


vim +/state +6077 kernel/bpf/syscall.c

  6073	
  6074	
  6075	void bpf_die(void *data)
  6076	{
> 6077		struct unwind_state state;
  6078		struct bpf_prog *prog, *patch_prog;
  6079		struct pt_regs *regs;
  6080		char str[KSYM_SYMBOL_LEN];
  6081		unsigned long addr, new_addr, bpf_loop_addr, bpf_loop_term_addr;
  6082		int cpu_id = raw_smp_processor_id();
  6083	
  6084		prog = (struct bpf_prog *)data;
  6085		patch_prog = prog->termination_states->patch_prog;
  6086	
  6087		if(!per_cpu_flag_is_true(prog->termination_states, cpu_id))
  6088			return;
  6089	
  6090		regs = &prog->termination_states->pre_execution_state[cpu_id];
  6091		bpf_loop_addr = (unsigned long)bpf_loop_proto.func;
  6092		bpf_loop_term_addr = (unsigned long)bpf_loop_termination_proto.func;
  6093	
  6094		unwind_start(&state, current, regs, NULL);
  6095		addr = unwind_get_return_address(&state);
  6096	
  6097		/* BPF programs RIP is in bpf program context when termination
  6098		 * signal raises an IPI
  6099		 */
  6100		if (is_bpf_address(prog, addr)) {
  6101			new_addr = find_offset_in_patch_prog(patch_prog, prog, addr);
  6102			if (new_addr < 0)
  6103				return;
  6104			regs->ip = new_addr;
  6105		}
  6106	
  6107		unsigned long stack_addr = regs->sp;
  6108		while (addr) {
  6109			if (is_bpf_address(prog, addr)) {
  6110				while (*(unsigned long *)stack_addr != addr) {
  6111					stack_addr += 1;
  6112				}
  6113				new_addr = find_offset_in_patch_prog(patch_prog, prog, addr);
  6114				if (new_addr < 0)
  6115					return;
  6116				*(unsigned long *)stack_addr = new_addr;
  6117			} else {
  6118				/* Handles termination non-inline bpf_loop scenario.
  6119				 * Could be modular and later extended to other iterators.
  6120				 */
  6121				const char *name = kallsyms_lookup(addr, NULL, NULL, NULL, str);
  6122				if (name) {
  6123					unsigned long lookup_addr = kallsyms_lookup_name(name);
  6124					if (lookup_addr && lookup_addr == bpf_loop_addr) {
  6125						while (*(unsigned long *)stack_addr != addr) {
  6126							stack_addr += 1;
  6127						}
  6128						*(unsigned long *)stack_addr = bpf_loop_term_addr;
  6129					}
  6130				}
  6131			}
  6132			unwind_next_frame(&state);
  6133			addr = unwind_get_return_address(&state);
  6134		}
  6135	
  6136		atomic64_dec(&prog->aux->refcnt);
  6137	
  6138		return;
  6139	}
  6140	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2025-04-20 14:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-20 10:55 [RFC bpf-next 0/4] bpf: Fast-Path approach for BPF program Termination Raj Sahu
2025-04-20 10:55 ` [RFC bpf-next 1/4] bpf: Introduce new structs and struct fields Raj Sahu
2025-05-13  0:04   ` Eduard Zingerman
2025-04-20 10:55 ` [RFC bpf-next 2/4] bpftool/libbpf : Introduce bpf_prog_termination to trigger termination signal Raj Sahu
2025-04-20 10:55 ` [RFC bpf-next 3/4] bpf: Generating a stubbed version of BPF program for termination Raj Sahu
2025-04-20 13:01   ` kernel test robot
2025-04-20 13:01   ` kernel test robot
2025-04-20 13:01   ` kernel test robot
2025-05-13  0:07   ` Eduard Zingerman
2025-05-13  0:20     ` Alexei Starovoitov
2025-05-13  4:40       ` Eduard Zingerman
2025-05-13  5:16       ` Siddharth Chintamaneni
2025-05-15  1:59         ` Alexei Starovoitov
2025-05-15 17:43           ` Andrii Nakryiko
2025-05-17  5:01           ` Raj Sahu
2025-05-19  1:20             ` Alexei Starovoitov
2025-05-28  7:10               ` Raj Sahu
2025-06-04 23:02                 ` Alexei Starovoitov
2025-06-10 22:06                   ` Siddharth Chintamaneni
2025-06-11 15:59                     ` Alexei Starovoitov
2025-04-20 10:55 ` [RFC bpf-next 4/4] bpf: Runtime part of fast-path termination approach Raj Sahu
2025-04-20 12:50   ` kernel test robot
2025-04-20 13:12   ` kernel test robot
2025-04-20 14:15   ` kernel test robot [this message]
2025-05-05 20:13 ` [RFC bpf-next 0/4] bpf: Fast-Path approach for BPF program Termination Kumar Kartikeya Dwivedi
2025-05-06  5:55   ` Raj Sahu
2025-05-06 22:45     ` Alexei Starovoitov
2025-05-06 22:59       ` Kumar Kartikeya Dwivedi
2025-05-07  0:32         ` Alexei Starovoitov
2025-05-07  0:38           ` Kumar Kartikeya Dwivedi
2025-05-07  1:15             ` Alexei Starovoitov
2025-05-07  2:10               ` Kumar Kartikeya Dwivedi
2025-05-07  3:36                 ` Alexei Starovoitov
2025-05-07  5:04                   ` Kumar Kartikeya Dwivedi
2025-05-07 18:15 ` Zvi Effron
2025-05-07 20:01   ` Alexei Starovoitov

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=202504202116.gfxIZI0c-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rjsu26@gmail.com \
    /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.