BPF List
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Puranjay Mohan <puranjay@kernel.org>, bpf@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
	Puranjay Mohan <puranjay@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	kernel-team@meta.com
Subject: Re: [PATCH bpf-next v2 3/4] bpf: arena: make arena kfuncs any context safe
Date: Sun, 16 Nov 2025 09:15:59 +0800	[thread overview]
Message-ID: <202511160836.5Ca6PimB-lkp@intel.com> (raw)
In-Reply-To: <20251114111700.43292-4-puranjay@kernel.org>

Hi Puranjay,

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/Puranjay-Mohan/bpf-arena-populate-vm_area-without-allocating-memory/20251114-192509
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20251114111700.43292-4-puranjay%40kernel.org
patch subject: [PATCH bpf-next v2 3/4] bpf: arena: make arena kfuncs any context safe
config: sh-randconfig-r071-20251115 (https://download.01.org/0day-ci/archive/20251116/202511160836.5Ca6PimB-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251116/202511160836.5Ca6PimB-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/202511160836.5Ca6PimB-lkp@intel.com/

All errors (new ones prefixed by >>):

   sh4-linux-ld: kernel/bpf/verifier.o: in function `fixup_kfunc_call':
>> kernel/bpf/verifier.c:22428:(.text+0x7748): undefined reference to `bpf_arena_free_pages_non_sleepable'
   sh4-linux-ld: drivers/net/phy/air_en8811h.o: in function `en8811h_resume':
   drivers/net/phy/air_en8811h.c:1178:(.text+0x544): undefined reference to `clk_restore_context'
   sh4-linux-ld: drivers/net/phy/air_en8811h.o: in function `en8811h_suspend':
   drivers/net/phy/air_en8811h.c:1185:(.text+0x56c): undefined reference to `clk_save_context'
   sh4-linux-ld: drivers/media/i2c/tc358746.o: in function `tc358746_probe':
   drivers/media/i2c/tc358746.c:1585:(.text+0x1408): undefined reference to `devm_clk_hw_register'

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for OF_GPIO
   Depends on [n]: GPIOLIB [=y] && OF [=n] && HAS_IOMEM [=y]
   Selected by [y]:
   - GPIO_TB10X [=y] && GPIOLIB [=y] && HAS_IOMEM [=y] && (ARC_PLAT_TB10X || COMPILE_TEST [=y])
   WARNING: unmet direct dependencies detected for GPIO_SYSCON
   Depends on [n]: GPIOLIB [=y] && HAS_IOMEM [=y] && MFD_SYSCON [=y] && OF [=n]
   Selected by [y]:
   - GPIO_SAMA5D2_PIOBU [=y] && GPIOLIB [=y] && HAS_IOMEM [=y] && MFD_SYSCON [=y] && OF_GPIO [=y] && (ARCH_AT91 || COMPILE_TEST [=y])
   WARNING: unmet direct dependencies detected for I2C_K1
   Depends on [n]: I2C [=y] && HAS_IOMEM [=y] && (ARCH_SPACEMIT || COMPILE_TEST [=y]) && OF [=n]
   Selected by [y]:
   - MFD_SPACEMIT_P1 [=y] && HAS_IOMEM [=y] && (ARCH_SPACEMIT || COMPILE_TEST [=y]) && I2C [=y]


vim +22428 kernel/bpf/verifier.c

d2dcc67df910dd Dave Marchevsky         2023-04-15  22392  
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22393  static int fixup_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22394  			    struct bpf_insn *insn_buf, int insn_idx, int *cnt)
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22395  {
d869d56ca84841 Mykyta Yatsenko         2025-10-26  22396  	struct bpf_kfunc_desc *desc;
d869d56ca84841 Mykyta Yatsenko         2025-10-26  22397  	int err;
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22398  
a5d8272752416e Kumar Kartikeya Dwivedi 2021-10-02  22399  	if (!insn->imm) {
a5d8272752416e Kumar Kartikeya Dwivedi 2021-10-02  22400  		verbose(env, "invalid kernel function call not eliminated in verifier pass\n");
a5d8272752416e Kumar Kartikeya Dwivedi 2021-10-02  22401  		return -EINVAL;
a5d8272752416e Kumar Kartikeya Dwivedi 2021-10-02  22402  	}
a5d8272752416e Kumar Kartikeya Dwivedi 2021-10-02  22403  
3d76a4d3d4e591 Stanislav Fomichev      2023-01-19  22404  	*cnt = 0;
3d76a4d3d4e591 Stanislav Fomichev      2023-01-19  22405  
1cf3bfc60f9836 Ilya Leoshkevich        2023-04-13  22406  	/* insn->imm has the btf func_id. Replace it with an offset relative to
1cf3bfc60f9836 Ilya Leoshkevich        2023-04-13  22407  	 * __bpf_call_base, unless the JIT needs to call functions that are
1cf3bfc60f9836 Ilya Leoshkevich        2023-04-13  22408  	 * further than 32 bits away (bpf_jit_supports_far_kfunc_call()).
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22409  	 */
2357672c54c3f7 Kumar Kartikeya Dwivedi 2021-10-02  22410  	desc = find_kfunc_desc(env->prog, insn->imm, insn->off);
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22411  	if (!desc) {
0df1a55afa832f Paul Chaignon           2025-07-01  22412  		verifier_bug(env, "kernel function descriptor not found for func_id %u",
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22413  			     insn->imm);
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22414  		return -EFAULT;
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22415  	}
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22416  
2c52e8943a437a Mykyta Yatsenko         2025-10-26  22417  	err = specialize_kfunc(env, desc, insn_idx);
d869d56ca84841 Mykyta Yatsenko         2025-10-26  22418  	if (err)
d869d56ca84841 Mykyta Yatsenko         2025-10-26  22419  		return err;
d869d56ca84841 Mykyta Yatsenko         2025-10-26  22420  
1cf3bfc60f9836 Ilya Leoshkevich        2023-04-13  22421  	if (!bpf_jit_supports_far_kfunc_call())
1cf3bfc60f9836 Ilya Leoshkevich        2023-04-13  22422  		insn->imm = BPF_CALL_IMM(desc->addr);
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22423  	if (insn->off)
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22424  		return 0;
36d8bdf75a9319 Yonghong Song           2023-08-27  22425  	if (desc->func_id == special_kfunc_list[KF_bpf_obj_new_impl] ||
36d8bdf75a9319 Yonghong Song           2023-08-27  22426  	    desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_new_impl]) {
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22427  		struct btf_struct_meta *kptr_struct_meta = env->insn_aux_data[insn_idx].kptr_struct_meta;
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18 @22428  		struct bpf_insn addr[2] = { BPF_LD_IMM64(BPF_REG_2, (long)kptr_struct_meta) };
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22429  		u64 obj_new_size = env->insn_aux_data[insn_idx].obj_new_size;
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22430  
36d8bdf75a9319 Yonghong Song           2023-08-27  22431  		if (desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_new_impl] && kptr_struct_meta) {
0df1a55afa832f Paul Chaignon           2025-07-01  22432  			verifier_bug(env, "NULL kptr_struct_meta expected at insn_idx %d",
36d8bdf75a9319 Yonghong Song           2023-08-27  22433  				     insn_idx);
36d8bdf75a9319 Yonghong Song           2023-08-27  22434  			return -EFAULT;
36d8bdf75a9319 Yonghong Song           2023-08-27  22435  		}
36d8bdf75a9319 Yonghong Song           2023-08-27  22436  
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22437  		insn_buf[0] = BPF_MOV64_IMM(BPF_REG_1, obj_new_size);
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22438  		insn_buf[1] = addr[0];
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22439  		insn_buf[2] = addr[1];
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22440  		insn_buf[3] = *insn;
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22441  		*cnt = 4;
7c50b1cb76aca4 Dave Marchevsky         2023-04-15  22442  	} else if (desc->func_id == special_kfunc_list[KF_bpf_obj_drop_impl] ||
36d8bdf75a9319 Yonghong Song           2023-08-27  22443  		   desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_drop_impl] ||
7c50b1cb76aca4 Dave Marchevsky         2023-04-15  22444  		   desc->func_id == special_kfunc_list[KF_bpf_refcount_acquire_impl]) {
ac9f06050a3580 Kumar Kartikeya Dwivedi 2022-11-18  22445  		struct btf_struct_meta *kptr_struct_meta = env->insn_aux_data[insn_idx].kptr_struct_meta;
ac9f06050a3580 Kumar Kartikeya Dwivedi 2022-11-18  22446  		struct bpf_insn addr[2] = { BPF_LD_IMM64(BPF_REG_2, (long)kptr_struct_meta) };
ac9f06050a3580 Kumar Kartikeya Dwivedi 2022-11-18  22447  
36d8bdf75a9319 Yonghong Song           2023-08-27  22448  		if (desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_drop_impl] && kptr_struct_meta) {
0df1a55afa832f Paul Chaignon           2025-07-01  22449  			verifier_bug(env, "NULL kptr_struct_meta expected at insn_idx %d",
36d8bdf75a9319 Yonghong Song           2023-08-27  22450  				     insn_idx);
36d8bdf75a9319 Yonghong Song           2023-08-27  22451  			return -EFAULT;
36d8bdf75a9319 Yonghong Song           2023-08-27  22452  		}
36d8bdf75a9319 Yonghong Song           2023-08-27  22453  
f0d991a070750a Dave Marchevsky         2023-08-21  22454  		if (desc->func_id == special_kfunc_list[KF_bpf_refcount_acquire_impl] &&
f0d991a070750a Dave Marchevsky         2023-08-21  22455  		    !kptr_struct_meta) {
0df1a55afa832f Paul Chaignon           2025-07-01  22456  			verifier_bug(env, "kptr_struct_meta expected at insn_idx %d",
f0d991a070750a Dave Marchevsky         2023-08-21  22457  				     insn_idx);
f0d991a070750a Dave Marchevsky         2023-08-21  22458  			return -EFAULT;
f0d991a070750a Dave Marchevsky         2023-08-21  22459  		}
f0d991a070750a Dave Marchevsky         2023-08-21  22460  
ac9f06050a3580 Kumar Kartikeya Dwivedi 2022-11-18  22461  		insn_buf[0] = addr[0];
ac9f06050a3580 Kumar Kartikeya Dwivedi 2022-11-18  22462  		insn_buf[1] = addr[1];
ac9f06050a3580 Kumar Kartikeya Dwivedi 2022-11-18  22463  		insn_buf[2] = *insn;
ac9f06050a3580 Kumar Kartikeya Dwivedi 2022-11-18  22464  		*cnt = 3;
d2dcc67df910dd Dave Marchevsky         2023-04-15  22465  	} else if (desc->func_id == special_kfunc_list[KF_bpf_list_push_back_impl] ||
d2dcc67df910dd Dave Marchevsky         2023-04-15  22466  		   desc->func_id == special_kfunc_list[KF_bpf_list_push_front_impl] ||
d2dcc67df910dd Dave Marchevsky         2023-04-15  22467  		   desc->func_id == special_kfunc_list[KF_bpf_rbtree_add_impl]) {
f0d991a070750a Dave Marchevsky         2023-08-21  22468  		struct btf_struct_meta *kptr_struct_meta = env->insn_aux_data[insn_idx].kptr_struct_meta;
d2dcc67df910dd Dave Marchevsky         2023-04-15  22469  		int struct_meta_reg = BPF_REG_3;
d2dcc67df910dd Dave Marchevsky         2023-04-15  22470  		int node_offset_reg = BPF_REG_4;
d2dcc67df910dd Dave Marchevsky         2023-04-15  22471  
d2dcc67df910dd Dave Marchevsky         2023-04-15  22472  		/* rbtree_add has extra 'less' arg, so args-to-fixup are in diff regs */
d2dcc67df910dd Dave Marchevsky         2023-04-15  22473  		if (desc->func_id == special_kfunc_list[KF_bpf_rbtree_add_impl]) {
d2dcc67df910dd Dave Marchevsky         2023-04-15  22474  			struct_meta_reg = BPF_REG_4;
d2dcc67df910dd Dave Marchevsky         2023-04-15  22475  			node_offset_reg = BPF_REG_5;
d2dcc67df910dd Dave Marchevsky         2023-04-15  22476  		}
d2dcc67df910dd Dave Marchevsky         2023-04-15  22477  
f0d991a070750a Dave Marchevsky         2023-08-21  22478  		if (!kptr_struct_meta) {
0df1a55afa832f Paul Chaignon           2025-07-01  22479  			verifier_bug(env, "kptr_struct_meta expected at insn_idx %d",
f0d991a070750a Dave Marchevsky         2023-08-21  22480  				     insn_idx);
f0d991a070750a Dave Marchevsky         2023-08-21  22481  			return -EFAULT;
f0d991a070750a Dave Marchevsky         2023-08-21  22482  		}
f0d991a070750a Dave Marchevsky         2023-08-21  22483  
d2dcc67df910dd Dave Marchevsky         2023-04-15  22484  		__fixup_collection_insert_kfunc(&env->insn_aux_data[insn_idx], struct_meta_reg,
d2dcc67df910dd Dave Marchevsky         2023-04-15  22485  						node_offset_reg, insn, insn_buf, cnt);
a35b9af4ec2c7f Yonghong Song           2022-11-20  22486  	} else if (desc->func_id == special_kfunc_list[KF_bpf_cast_to_kern_ctx] ||
a35b9af4ec2c7f Yonghong Song           2022-11-20  22487  		   desc->func_id == special_kfunc_list[KF_bpf_rdonly_cast]) {
fd264ca020948a Yonghong Song           2022-11-20  22488  		insn_buf[0] = BPF_MOV64_REG(BPF_REG_0, BPF_REG_1);
fd264ca020948a Yonghong Song           2022-11-20  22489  		*cnt = 1;
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22490  	}
81f1d7a583fa1f Benjamin Tissoires      2024-04-20  22491  
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22492  	if (env->insn_aux_data[insn_idx].arg_prog) {
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22493  		u32 regno = env->insn_aux_data[insn_idx].arg_prog;
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22494  		struct bpf_insn ld_addrs[2] = { BPF_LD_IMM64(regno, (long)env->prog->aux) };
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22495  		int idx = *cnt;
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22496  
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22497  		insn_buf[idx++] = ld_addrs[0];
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22498  		insn_buf[idx++] = ld_addrs[1];
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22499  		insn_buf[idx++] = *insn;
bc049387b41f41 Kumar Kartikeya Dwivedi 2025-05-13  22500  		*cnt = idx;
958cf2e273f092 Kumar Kartikeya Dwivedi 2022-11-18  22501  	}
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22502  	return 0;
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22503  }
e6ac2450d6dee3 Martin KaFai Lau        2021-03-24  22504  

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

  parent reply	other threads:[~2025-11-16  1:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 11:16 [PATCH bpf-next v2 0/4] Remove KF_SLEEPABLE from arena kfuncs Puranjay Mohan
2025-11-14 11:16 ` [PATCH bpf-next v2 1/4] bpf: arena: populate vm_area without allocating memory Puranjay Mohan
2025-11-14 11:47   ` bot+bpf-ci
2025-11-14 14:57     ` Puranjay Mohan
2025-11-14 21:21       ` Alexei Starovoitov
2025-11-15  0:52         ` Puranjay Mohan
2025-11-15  1:26           ` Alexei Starovoitov
2025-11-14 11:16 ` [PATCH bpf-next v2 2/4] bpf: arena: use kmalloc_nolock() in place of kvcalloc() Puranjay Mohan
2025-11-14 11:39   ` bot+bpf-ci
2025-11-14 15:13     ` Puranjay Mohan
2025-11-14 21:25   ` Alexei Starovoitov
2025-11-14 11:16 ` [PATCH bpf-next v2 3/4] bpf: arena: make arena kfuncs any context safe Puranjay Mohan
2025-11-14 11:47   ` bot+bpf-ci
2025-11-14 15:28     ` Puranjay Mohan
2025-11-14 21:27   ` Alexei Starovoitov
2025-11-15  0:56     ` Puranjay Mohan
2025-11-15  1:28       ` Alexei Starovoitov
2025-11-15  8:18   ` kernel test robot
2025-11-16  1:15   ` kernel test robot [this message]
2025-11-14 11:16 ` [PATCH bpf-next v2 4/4] selftests: bpf: test non-sleepable arena allocations Puranjay Mohan
2025-11-14 22:18   ` Alexei Starovoitov
2025-11-15  0:58     ` Puranjay Mohan

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=202511160836.5Ca6PimB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=memxor@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=puranjay@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox