Re: [PATCH bpf-next] bpf: add ambient BPF runtime context stored in current

From: kernel test robot
Date: Fri Jul 09 2021 - 23:44:19 EST


Hi Andrii,

I love your patch! Yet something to improve:

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

url: https://github.com/0day-ci/linux/commits/Andrii-Nakryiko/bpf-add-ambient-BPF-runtime-context-stored-in-current/20210710-091156
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: nios2-randconfig-p001-20210710 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
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
# https://github.com/0day-ci/linux/commit/e66ab92194c9a54bde72690e56df1c2602b06ae4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andrii-Nakryiko/bpf-add-ambient-BPF-runtime-context-stored-in-current/20210710-091156
git checkout e66ab92194c9a54bde72690e56df1c2602b06ae4
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/iio/humidity/

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

All errors (new ones prefixed by >>):

In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from include/linux/regulator/consumer.h:35,
from drivers/iio/humidity/hts221.h:16,
from drivers/iio/humidity/hts221_core.c:19:
include/linux/bpf.h: In function 'bpf_set_run_ctx':
>> include/linux/bpf.h:1120:19: error: 'struct task_struct' has no member named 'bpf_ctx'
1120 | old_ctx = current->bpf_ctx;
| ^~
include/linux/bpf.h:1121:9: error: 'struct task_struct' has no member named 'bpf_ctx'
1121 | current->bpf_ctx = new_ctx;
| ^~
include/linux/bpf.h: In function 'bpf_reset_run_ctx':
include/linux/bpf.h:1127:9: error: 'struct task_struct' has no member named 'bpf_ctx'
1127 | current->bpf_ctx = old_ctx;
| ^~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from include/linux/regulator/consumer.h:35,
from drivers/iio/humidity/hts221.h:16,
from drivers/iio/humidity/hts221_i2c.c:17:
include/linux/bpf.h: In function 'bpf_set_run_ctx':
>> include/linux/bpf.h:1120:19: error: 'struct task_struct' has no member named 'bpf_ctx'
1120 | old_ctx = current->bpf_ctx;
| ^~
include/linux/bpf.h:1121:9: error: 'struct task_struct' has no member named 'bpf_ctx'
1121 | current->bpf_ctx = new_ctx;
| ^~
include/linux/bpf.h: In function 'bpf_reset_run_ctx':
include/linux/bpf.h:1127:9: error: 'struct task_struct' has no member named 'bpf_ctx'
1127 | current->bpf_ctx = old_ctx;
| ^~
At top level:
drivers/iio/humidity/hts221_i2c.c:44:36: warning: 'hts221_acpi_match' defined but not used [-Wunused-const-variable=]
44 | static const struct acpi_device_id hts221_acpi_match[] = {
| ^~~~~~~~~~~~~~~~~


vim +1120 include/linux/bpf.h

1115
1116 static inline struct bpf_run_ctx *bpf_set_run_ctx(struct bpf_run_ctx *new_ctx)
1117 {
1118 struct bpf_run_ctx *old_ctx;
1119
> 1120 old_ctx = current->bpf_ctx;
1121 current->bpf_ctx = new_ctx;
1122 return old_ctx;
1123 }
1124

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

Attachment: .config.gz
Description: application/gzip