[jolsa-perf:bpf/batch 18/29] kernel/bpf/syscall.c:2904:2: error: implicit declaration of function 'bpf_tramp_id_put'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/batch
head: 5f1f613266bf58f8424a93e1f8b99c4ac8fa6c2b
commit: e1bb5d3bd5e9d47950dc214099a56a5efead24fd [18/29] bpf: Add refcount_t to struct bpf_tramp_id
config: hexagon-randconfig-r035-20211118 (attached as .config)
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://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id...
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf bpf/batch
git checkout e1bb5d3bd5e9d47950dc214099a56a5efead24fd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel/bpf/syscall.c:2668:15: error: implicit declaration of function 'bpf_tramp_attach_unlink' [-Werror,-Wimplicit-function-declaration]
WARN_ON_ONCE(bpf_tramp_attach_unlink(attach));
^
kernel/bpf/syscall.c:2672:2: error: implicit declaration of function 'bpf_tramp_detach' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_detach(attach);
^
kernel/bpf/syscall.c:2776:8: error: implicit declaration of function 'bpf_tramp_id_single' [-Werror,-Wimplicit-function-declaration]
id = bpf_tramp_id_single(tgt_prog, prog, btf_id, NULL);
^
kernel/bpf/syscall.c:2776:6: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_id *' from 'int' [-Wint-conversion]
id = bpf_tramp_id_single(tgt_prog, prog, btf_id, NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c:2831:8: error: implicit declaration of function 'bpf_tramp_id_single' [-Werror,-Wimplicit-function-declaration]
id = bpf_tramp_id_single(NULL, prog, btf_id, NULL);
^
kernel/bpf/syscall.c:2831:6: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_id *' from 'int' [-Wint-conversion]
id = bpf_tramp_id_single(NULL, prog, btf_id, NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c:2839:8: error: implicit declaration of function 'bpf_tramp_id_is_empty' [-Werror,-Wimplicit-function-declaration]
(!bpf_tramp_id_is_empty(id) &&
^
kernel/bpf/syscall.c:2840:8: error: implicit declaration of function 'bpf_tramp_id_is_equal' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_id_is_equal(id, prog->aux->dst_attach->id))) {
^
kernel/bpf/syscall.c:2840:8: note: did you mean 'bpf_tramp_id_is_empty'?
kernel/bpf/syscall.c:2839:8: note: 'bpf_tramp_id_is_empty' declared here
(!bpf_tramp_id_is_empty(id) &&
^
kernel/bpf/syscall.c:2845:12: error: implicit declaration of function 'bpf_tramp_attach' [-Werror,-Wimplicit-function-declaration]
attach = bpf_tramp_attach(id, tgt_prog, prog);
^
kernel/bpf/syscall.c:2845:10: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_attach *' from 'int' [-Wint-conversion]
attach = bpf_tramp_attach(id, tgt_prog, prog);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c:2866:8: error: implicit declaration of function 'bpf_tramp_attach_link' [-Werror,-Wimplicit-function-declaration]
err = bpf_tramp_attach_link(attach);
^
kernel/bpf/syscall.c:2889:3: error: implicit declaration of function 'bpf_tramp_detach' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_detach(prog->aux->dst_attach);
^
>> kernel/bpf/syscall.c:2904:2: error: implicit declaration of function 'bpf_tramp_id_put' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_id_put(id);
^
kernel/bpf/syscall.c:2904:2: note: did you mean 'bpf_trampoline_put'?
include/linux/bpf.h:834:20: note: 'bpf_trampoline_put' declared here
static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}
^
3 warnings and 10 errors generated.
--
kernel/bpf/verifier.c:13998:7: error: implicit declaration of function 'bpf_tramp_id_single' [-Werror,-Wimplicit-function-declaration]
id = bpf_tramp_id_single(tgt_prog, prog, btf_id, &tgt_info);
^
kernel/bpf/verifier.c:13998:5: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_id *' from 'int' [-Wint-conversion]
id = bpf_tramp_id_single(tgt_prog, prog, btf_id, &tgt_info);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/verifier.c:14002:11: error: implicit declaration of function 'bpf_tramp_attach' [-Werror,-Wimplicit-function-declaration]
attach = bpf_tramp_attach(id, tgt_prog, prog);
^
kernel/bpf/verifier.c:14002:9: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_attach *' from 'int' [-Wint-conversion]
attach = bpf_tramp_attach(id, tgt_prog, prog);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/verifier.c:14004:3: error: implicit declaration of function 'bpf_tramp_id_put' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_id_put(id);
^
kernel/bpf/verifier.c:14004:3: note: did you mean 'bpf_trampoline_put'?
include/linux/bpf.h:834:20: note: 'bpf_trampoline_put' declared here
static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}
^
2 warnings and 3 errors generated.
vim +/bpf_tramp_id_put +2904 kernel/bpf/syscall.c
2718
2719 static int bpf_tracing_prog_attach(struct bpf_prog *prog,
2720 int tgt_prog_fd,
2721 u32 btf_id)
2722 {
2723 bool prog_extension = prog->type == BPF_PROG_TYPE_EXT;
2724 struct bpf_tramp_attach *attach = NULL;
2725 struct bpf_link_primer link_primer;
2726 struct bpf_prog *tgt_prog = NULL;
2727 struct bpf_tracing_link *link;
2728 struct bpf_tramp_id *id = NULL;
2729 int err;
2730
2731 switch (prog->type) {
2732 case BPF_PROG_TYPE_TRACING:
2733 if (prog->expected_attach_type != BPF_TRACE_FENTRY &&
2734 prog->expected_attach_type != BPF_TRACE_FEXIT &&
2735 prog->expected_attach_type != BPF_MODIFY_RETURN) {
2736 err = -EINVAL;
2737 goto out_put_prog;
2738 }
2739 break;
2740 case BPF_PROG_TYPE_EXT:
2741 if (prog->expected_attach_type != 0) {
2742 err = -EINVAL;
2743 goto out_put_prog;
2744 }
2745 break;
2746 case BPF_PROG_TYPE_LSM:
2747 if (prog->expected_attach_type != BPF_LSM_MAC) {
2748 err = -EINVAL;
2749 goto out_put_prog;
2750 }
2751 break;
2752 default:
2753 err = -EINVAL;
2754 goto out_put_prog;
2755 }
2756
2757 if (!!tgt_prog_fd != !!btf_id) {
2758 err = -EINVAL;
2759 goto out_put_prog;
2760 }
2761
2762 if (tgt_prog_fd) {
2763 /* For now we only allow new targets for BPF_PROG_TYPE_EXT */
2764 if (prog->type != BPF_PROG_TYPE_EXT) {
2765 err = -EINVAL;
2766 goto out_put_prog;
2767 }
2768
2769 tgt_prog = bpf_prog_get(tgt_prog_fd);
2770 if (IS_ERR(tgt_prog)) {
2771 err = PTR_ERR(tgt_prog);
2772 tgt_prog = NULL;
2773 goto out_put_prog;
2774 }
2775
2776 id = bpf_tramp_id_single(tgt_prog, prog, btf_id, NULL);
2777 if (IS_ERR(id)) {
2778 err = PTR_ERR(id);
2779 goto out_put_prog;
2780 }
2781 }
2782
2783 link = kzalloc(sizeof(*link), GFP_USER);
2784 if (!link) {
2785 err = -ENOMEM;
2786 goto out_put_prog;
2787 }
2788 bpf_link_init(&link->link, BPF_LINK_TYPE_TRACING,
2789 &bpf_tracing_link_lops, prog);
2790 link->attach_type = prog->expected_attach_type;
2791
2792 mutex_lock(&prog->aux->dst_mutex);
2793
2794 if (!prog_extension && prog->aux->attach) {
2795 err = -EBUSY;
2796 goto out_unlock;
2797 }
2798
2799 /* There are a few possible cases here:
2800 *
2801 * - if prog->aux->dst_trampoline is set, the program was just loaded
2802 * and not yet attached to anything, so we can use the values stored
2803 * in prog->aux
2804 *
2805 * - if prog->aux->dst_trampoline is NULL, the program has already been
2806 * attached to a target and its initial target was cleared (below)
2807 *
2808 * - if tgt_prog != NULL, the caller specified tgt_prog_fd +
2809 * target_btf_id using the link_create API.
2810 *
2811 * - if tgt_prog == NULL when this function was called using the old
2812 * raw_tracepoint_open API, and we need a target from prog->aux
2813 *
2814 * - if prog->aux->dst_trampoline and tgt_prog is NULL, the program
2815 * was detached and is going for re-attachment.
2816 */
2817 if (!prog->aux->dst_attach && !tgt_prog) {
2818 /*
2819 * Allow re-attach for TRACING and LSM programs. If it's
2820 * currently linked, bpf_trampoline_link_prog will fail.
2821 * EXT programs need to specify tgt_prog_fd, so they
2822 * re-attach in separate code path.
2823 */
2824 if (prog->type != BPF_PROG_TYPE_TRACING &&
2825 prog->type != BPF_PROG_TYPE_LSM) {
2826 err = -EINVAL;
2827 goto out_unlock;
2828 }
2829
2830 btf_id = prog->aux->attach_btf_id;
2831 id = bpf_tramp_id_single(NULL, prog, btf_id, NULL);
2832 if (IS_ERR(id)) {
2833 err = PTR_ERR(id);
2834 goto out_unlock;
2835 }
2836 }
2837
2838 if (!prog->aux->dst_attach ||
2839 (!bpf_tramp_id_is_empty(id) &&
2840 bpf_tramp_id_is_equal(id, prog->aux->dst_attach->id))) {
2841 /* If there is no saved target, or the specified target is
2842 * different from the destination specified at load time, we
2843 * need a new trampoline and a check for compatibility
2844 */
2845 attach = bpf_tramp_attach(id, tgt_prog, prog);
2846 if (IS_ERR(attach)) {
2847 err = PTR_ERR(attach);
2848 goto out_unlock;
2849 }
2850 } else {
2851 /* The caller didn't specify a target, or the target was the
2852 * same as the destination supplied during program load. This
2853 * means we can reuse the trampoline and reference from program
2854 * load time, and there is no need to allocate a new one. This
2855 * can only happen once for any program, as the saved values in
2856 * prog->aux are cleared below.
2857 */
2858 attach = prog->aux->dst_attach;
2859 tgt_prog = prog->aux->dst_prog;
2860 }
2861
2862 err = bpf_link_prime(&link->link, &link_primer);
2863 if (err)
2864 goto out_unlock;
2865
2866 err = bpf_tramp_attach_link(attach);
2867 if (err) {
2868 bpf_link_cleanup(&link_primer);
2869 link = NULL;
2870 goto out_unlock;
2871 }
2872
2873 link->tgt_prog = tgt_prog;
2874 if (prog_extension)
2875 link->attach = attach;
2876 else
2877 prog->aux->attach = attach;
2878
2879 /* Always clear the trampoline and target prog from prog->aux to make
2880 * sure the original attach destination is not kept alive after a
2881 * program is (re-)attached to another target.
2882 */
2883 if (prog->aux->dst_prog &&
2884 (tgt_prog_fd || attach != prog->aux->dst_attach))
2885 /* got extra prog ref from syscall, or attaching to different prog */
2886 bpf_prog_put(prog->aux->dst_prog);
2887 if (prog->aux->dst_attach && attach != prog->aux->dst_attach)
2888 /* we allocated a new trampoline, so free the old one */
2889 bpf_tramp_detach(prog->aux->dst_attach);
2890
2891 prog->aux->dst_prog = NULL;
2892 prog->aux->dst_attach = NULL;
2893 mutex_unlock(&prog->aux->dst_mutex);
2894
2895 return bpf_link_settle(&link_primer);
2896 out_unlock:
2897 if (attach && attach != prog->aux->dst_attach)
2898 bpf_tramp_detach(attach);
2899 mutex_unlock(&prog->aux->dst_mutex);
2900 kfree(link);
2901 out_put_prog:
2902 if (tgt_prog_fd && tgt_prog)
2903 bpf_prog_put(tgt_prog);
> 2904 bpf_tramp_id_put(id);
2905 return err;
2906 }
2907
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH] iio: expose shared parameter in IIO_ENUM_AVAILABLE
by kernel test robot
Hi Antoniu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on jic23-iio/togreg]
[also build test ERROR on linux/master linus/master v5.16-rc1 next-20211118]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Antoniu-Miclaus/iio-expose-share...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: hexagon-randconfig-r041-20211118 (attached as .config)
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/b69668f743ac0c4d62a59f1bd9b8adf42...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Antoniu-Miclaus/iio-expose-shared-parameter-in-IIO_ENUM_AVAILABLE/20211118-221902
git checkout b69668f743ac0c4d62a59f1bd9b8adf42df3518c
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/iio/magnetometer/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/iio/magnetometer/hmc5843_core.c:263:57: error: too few arguments provided to function-like macro invocation
IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
^
include/linux/iio/iio.h:112:9: note: macro 'IIO_ENUM_AVAILABLE' defined here
#define IIO_ENUM_AVAILABLE(_name, _shared, _e) \
^
>> drivers/iio/magnetometer/hmc5843_core.c:263:2: error: use of undeclared identifier 'IIO_ENUM_AVAILABLE'
IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
^
>> drivers/iio/magnetometer/hmc5843_core.c:264:58: error: too many arguments provided to function-like macro invocation
IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, IIO_SHARED_BY_TYPE, hmc5843_get_mount_matrix),
^
include/linux/iio/iio.h:142:9: note: macro 'IIO_MOUNT_MATRIX' defined here
#define IIO_MOUNT_MATRIX(_shared, _get) \
^
>> drivers/iio/magnetometer/hmc5843_core.c:264:2: error: use of undeclared identifier 'IIO_MOUNT_MATRIX'
IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, IIO_SHARED_BY_TYPE, hmc5843_get_mount_matrix),
^
4 errors generated.
vim +263 drivers/iio/magnetometer/hmc5843_core.c
1c7be4c260e52d drivers/staging/iio/magnetometer/hmc5843_core.c Cristina Moraru 2016-02-15 260
1c7be4c260e52d drivers/staging/iio/magnetometer/hmc5843_core.c Cristina Moraru 2016-02-15 261 static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
e8a26c5b767b5f drivers/iio/magnetometer/hmc5843_core.c Jonathan Cameron 2020-09-13 262 IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5983_meas_conf_enum),
1c7be4c260e52d drivers/staging/iio/magnetometer/hmc5843_core.c Cristina Moraru 2016-02-15 @263 IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
b69668f743ac0c drivers/iio/magnetometer/hmc5843_core.c Antoniu Miclaus 2021-11-18 @264 IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, IIO_SHARED_BY_TYPE, hmc5843_get_mount_matrix),
8d7ea73814b4ed drivers/iio/magnetometer/hmc5843_core.c H. Nikolaus Schaller 2019-02-21 265 { }
1c7be4c260e52d drivers/staging/iio/magnetometer/hmc5843_core.c Cristina Moraru 2016-02-15 266 };
b4e178224cfdc8 drivers/staging/iio/magnetometer/hmc5843.c Shubhrajyoti D 2010-07-17 267
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [RFC PATCH bpf-next 2/3] bpf: reject program if a __user tagged memory accessed in kernel way
by kernel test robot
Hi Yonghong,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Yonghong-Song/compiler-attribute...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: arc-randconfig-r043-20211117 (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.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/07b1ca82a3a2c8779b7451e66b9cd37eb...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yonghong-Song/compiler-attribute-define-__user-as-__attribute__-btf_type_tag-user/20211118-044124
git checkout 07b1ca82a3a2c8779b7451e66b9cd37eb2886c48
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash kernel/bpf/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel/bpf/verifier.c: In function 'check_mem_access':
>> kernel/bpf/verifier.c:4386:96: error: 'is_user' undeclared (first use in this function); did you mean 'in_userns'?
4386 | err = check_ctx_access(env, insn_idx, off, size, t, ®_type, &btf, &btf_id, &is_user);
| ^~~~~~~
| in_userns
kernel/bpf/verifier.c:4386:96: note: each undeclared identifier is reported only once for each function it appears in
In file included from include/linux/perf_event.h:25,
from kernel/bpf/verifier.c:20:
At top level:
arch/arc/include/asm/perf_event.h:126:27: warning: 'arc_pmu_cache_map' defined but not used [-Wunused-const-variable=]
126 | static const unsigned int arc_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
| ^~~~~~~~~~~~~~~~~
arch/arc/include/asm/perf_event.h:91:27: warning: 'arc_pmu_ev_hw_map' defined but not used [-Wunused-const-variable=]
91 | static const char * const arc_pmu_ev_hw_map[] = {
| ^~~~~~~~~~~~~~~~~
vim +4386 kernel/bpf/verifier.c
4290
4291 /* check whether memory at (regno + off) is accessible for t = (read | write)
4292 * if t==write, value_regno is a register which value is stored into memory
4293 * if t==read, value_regno is a register which will receive the value from memory
4294 * if t==write && value_regno==-1, some unknown value is stored into memory
4295 * if t==read && value_regno==-1, don't care what we read from memory
4296 */
4297 static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno,
4298 int off, int bpf_size, enum bpf_access_type t,
4299 int value_regno, bool strict_alignment_once)
4300 {
4301 struct bpf_reg_state *regs = cur_regs(env);
4302 struct bpf_reg_state *reg = regs + regno;
4303 struct bpf_func_state *state;
4304 int size, err = 0;
4305
4306 size = bpf_size_to_bytes(bpf_size);
4307 if (size < 0)
4308 return size;
4309
4310 /* alignment checks will add in reg->off themselves */
4311 err = check_ptr_alignment(env, reg, off, size, strict_alignment_once);
4312 if (err)
4313 return err;
4314
4315 /* for access checks, reg->off is just part of off */
4316 off += reg->off;
4317
4318 if (reg->type == PTR_TO_MAP_KEY) {
4319 if (t == BPF_WRITE) {
4320 verbose(env, "write to change key R%d not allowed\n", regno);
4321 return -EACCES;
4322 }
4323
4324 err = check_mem_region_access(env, regno, off, size,
4325 reg->map_ptr->key_size, false);
4326 if (err)
4327 return err;
4328 if (value_regno >= 0)
4329 mark_reg_unknown(env, regs, value_regno);
4330 } else if (reg->type == PTR_TO_MAP_VALUE) {
4331 if (t == BPF_WRITE && value_regno >= 0 &&
4332 is_pointer_value(env, value_regno)) {
4333 verbose(env, "R%d leaks addr into map\n", value_regno);
4334 return -EACCES;
4335 }
4336 err = check_map_access_type(env, regno, off, size, t);
4337 if (err)
4338 return err;
4339 err = check_map_access(env, regno, off, size, false);
4340 if (!err && t == BPF_READ && value_regno >= 0) {
4341 struct bpf_map *map = reg->map_ptr;
4342
4343 /* if map is read-only, track its contents as scalars */
4344 if (tnum_is_const(reg->var_off) &&
4345 bpf_map_is_rdonly(map) &&
4346 map->ops->map_direct_value_addr) {
4347 int map_off = off + reg->var_off.value;
4348 u64 val = 0;
4349
4350 err = bpf_map_direct_read(map, map_off, size,
4351 &val);
4352 if (err)
4353 return err;
4354
4355 regs[value_regno].type = SCALAR_VALUE;
4356 __mark_reg_known(®s[value_regno], val);
4357 } else {
4358 mark_reg_unknown(env, regs, value_regno);
4359 }
4360 }
4361 } else if (reg->type == PTR_TO_MEM) {
4362 if (t == BPF_WRITE && value_regno >= 0 &&
4363 is_pointer_value(env, value_regno)) {
4364 verbose(env, "R%d leaks addr into mem\n", value_regno);
4365 return -EACCES;
4366 }
4367 err = check_mem_region_access(env, regno, off, size,
4368 reg->mem_size, false);
4369 if (!err && t == BPF_READ && value_regno >= 0)
4370 mark_reg_unknown(env, regs, value_regno);
4371 } else if (reg->type == PTR_TO_CTX) {
4372 enum bpf_reg_type reg_type = SCALAR_VALUE;
4373 struct btf *btf = NULL;
4374 u32 btf_id = 0;
4375
4376 if (t == BPF_WRITE && value_regno >= 0 &&
4377 is_pointer_value(env, value_regno)) {
4378 verbose(env, "R%d leaks addr into ctx\n", value_regno);
4379 return -EACCES;
4380 }
4381
4382 err = check_ctx_reg(env, reg, regno);
4383 if (err < 0)
4384 return err;
4385
> 4386 err = check_ctx_access(env, insn_idx, off, size, t, ®_type, &btf, &btf_id, &is_user);
4387 if (err)
4388 verbose_linfo(env, insn_idx, "; ");
4389 if (!err && t == BPF_READ && value_regno >= 0) {
4390 /* ctx access returns either a scalar, or a
4391 * PTR_TO_PACKET[_META,_END]. In the latter
4392 * case, we know the offset is zero.
4393 */
4394 if (reg_type == SCALAR_VALUE) {
4395 mark_reg_unknown(env, regs, value_regno);
4396 } else {
4397 mark_reg_known_zero(env, regs,
4398 value_regno);
4399 if (reg_type_may_be_null(reg_type))
4400 regs[value_regno].id = ++env->id_gen;
4401 /* A load of ctx field could have different
4402 * actual load size with the one encoded in the
4403 * insn. When the dst is PTR, it is for sure not
4404 * a sub-register.
4405 */
4406 regs[value_regno].subreg_def = DEF_NOT_SUBREG;
4407 if (reg_type == PTR_TO_BTF_ID ||
4408 reg_type == PTR_TO_BTF_ID_OR_NULL) {
4409 regs[value_regno].btf = btf;
4410 regs[value_regno].btf_id = btf_id;
4411 regs[value_regno].is_user = is_user;
4412 }
4413 }
4414 regs[value_regno].type = reg_type;
4415 }
4416
4417 } else if (reg->type == PTR_TO_STACK) {
4418 /* Basic bounds checks. */
4419 err = check_stack_access_within_bounds(env, regno, off, size, ACCESS_DIRECT, t);
4420 if (err)
4421 return err;
4422
4423 state = func(env, reg);
4424 err = update_stack_depth(env, state, off);
4425 if (err)
4426 return err;
4427
4428 if (t == BPF_READ)
4429 err = check_stack_read(env, regno, off, size,
4430 value_regno);
4431 else
4432 err = check_stack_write(env, regno, off, size,
4433 value_regno, insn_idx);
4434 } else if (reg_is_pkt_pointer(reg)) {
4435 if (t == BPF_WRITE && !may_access_direct_pkt_data(env, NULL, t)) {
4436 verbose(env, "cannot write into packet\n");
4437 return -EACCES;
4438 }
4439 if (t == BPF_WRITE && value_regno >= 0 &&
4440 is_pointer_value(env, value_regno)) {
4441 verbose(env, "R%d leaks addr into packet\n",
4442 value_regno);
4443 return -EACCES;
4444 }
4445 err = check_packet_access(env, regno, off, size, false);
4446 if (!err && t == BPF_READ && value_regno >= 0)
4447 mark_reg_unknown(env, regs, value_regno);
4448 } else if (reg->type == PTR_TO_FLOW_KEYS) {
4449 if (t == BPF_WRITE && value_regno >= 0 &&
4450 is_pointer_value(env, value_regno)) {
4451 verbose(env, "R%d leaks addr into flow keys\n",
4452 value_regno);
4453 return -EACCES;
4454 }
4455
4456 err = check_flow_keys_access(env, off, size);
4457 if (!err && t == BPF_READ && value_regno >= 0)
4458 mark_reg_unknown(env, regs, value_regno);
4459 } else if (type_is_sk_pointer(reg->type)) {
4460 if (t == BPF_WRITE) {
4461 verbose(env, "R%d cannot write into %s\n",
4462 regno, reg_type_str[reg->type]);
4463 return -EACCES;
4464 }
4465 err = check_sock_access(env, insn_idx, regno, off, size, t);
4466 if (!err && value_regno >= 0)
4467 mark_reg_unknown(env, regs, value_regno);
4468 } else if (reg->type == PTR_TO_TP_BUFFER) {
4469 err = check_tp_buffer_access(env, reg, regno, off, size);
4470 if (!err && t == BPF_READ && value_regno >= 0)
4471 mark_reg_unknown(env, regs, value_regno);
4472 } else if (reg->type == PTR_TO_BTF_ID) {
4473 err = check_ptr_to_btf_access(env, regs, regno, off, size, t,
4474 value_regno);
4475 } else if (reg->type == CONST_PTR_TO_MAP) {
4476 err = check_ptr_to_map_access(env, regs, regno, off, size, t,
4477 value_regno);
4478 } else if (reg->type == PTR_TO_RDONLY_BUF) {
4479 if (t == BPF_WRITE) {
4480 verbose(env, "R%d cannot write into %s\n",
4481 regno, reg_type_str[reg->type]);
4482 return -EACCES;
4483 }
4484 err = check_buffer_access(env, reg, regno, off, size, false,
4485 "rdonly",
4486 &env->prog->aux->max_rdonly_access);
4487 if (!err && value_regno >= 0)
4488 mark_reg_unknown(env, regs, value_regno);
4489 } else if (reg->type == PTR_TO_RDWR_BUF) {
4490 err = check_buffer_access(env, reg, regno, off, size, false,
4491 "rdwr",
4492 &env->prog->aux->max_rdwr_access);
4493 if (!err && t == BPF_READ && value_regno >= 0)
4494 mark_reg_unknown(env, regs, value_regno);
4495 } else {
4496 verbose(env, "R%d invalid mem access '%s'\n", regno,
4497 reg_type_str[reg->type]);
4498 return -EACCES;
4499 }
4500
4501 if (!err && size < BPF_REG_SIZE && value_regno >= 0 && t == BPF_READ &&
4502 regs[value_regno].type == SCALAR_VALUE) {
4503 /* b/h/w load zero-extends, mark upper bits as known 0 */
4504 coerce_reg_to_size(®s[value_regno], size);
4505 }
4506 return err;
4507 }
4508
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH 11/12] riscv: extable: add a dedicated uaccess handler
by kernel test robot
Hi Jisheng,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
[also build test ERROR on bpf/master linus/master v5.16-rc1 next-20211118]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Jisheng-Zhang/riscv-switch-to-re...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: riscv-rv32_defconfig (attached as .config)
compiler: riscv32-linux-gcc (GCC) 11.2.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/011a843af8007bfb9ff01a537e46e2ab6...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jisheng-Zhang/riscv-switch-to-relative-extable-and-other-improvements/20211118-193905
git checkout 011a843af8007bfb9ff01a537e46e2ab6967dd23
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/uaccess.h:11,
from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
from include/linux/tty.h:5,
from init/do_mounts.c:6:
include/asm-generic/termios.h: In function 'user_termio_to_kernel_termios':
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:25:13: note: in expansion of macro 'get_user'
25 | if (get_user(tmp, &termio->c_iflag) < 0)
| ^~~~~~~~
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:29:13: note: in expansion of macro 'get_user'
29 | if (get_user(tmp, &termio->c_oflag) < 0)
| ^~~~~~~~
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:33:13: note: in expansion of macro 'get_user'
33 | if (get_user(tmp, &termio->c_cflag) < 0)
| ^~~~~~~~
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:37:13: note: in expansion of macro 'get_user'
37 | if (get_user(tmp, &termio->c_lflag) < 0)
| ^~~~~~~~
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:41:13: note: in expansion of macro 'get_user'
41 | if (get_user(termios->c_line, &termio->c_line) < 0)
| ^~~~~~~~
include/asm-generic/termios.h: In function 'kernel_termios_to_user_termio':
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:59:13: note: in expansion of macro 'put_user'
59 | if (put_user(termios->c_iflag, &termio->c_iflag) < 0 ||
| ^~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:60:13: note: in expansion of macro 'put_user'
60 | put_user(termios->c_oflag, &termio->c_oflag) < 0 ||
| ^~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:61:13: note: in expansion of macro 'put_user'
61 | put_user(termios->c_cflag, &termio->c_cflag) < 0 ||
| ^~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:62:13: note: in expansion of macro 'put_user'
62 | put_user(termios->c_lflag, &termio->c_lflag) < 0 ||
| ^~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:63:13: note: in expansion of macro 'put_user'
63 | put_user(termios->c_line, &termio->c_line) < 0 ||
| ^~~~~~~~
--
In file included from include/linux/uaccess.h:11,
from arch/riscv/kernel/signal.c:10:
arch/riscv/kernel/signal.c: In function 'restore_fp_state':
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/kernel/signal.c:50:23: note: in expansion of macro '__get_user'
50 | err = __get_user(value, &sc_fpregs->q.reserved[i]);
| ^~~~~~~~~~
arch/riscv/kernel/signal.c: In function 'save_fp_state':
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/kernel/signal.c:74:23: note: in expansion of macro '__put_user'
74 | err = __put_user(0, &sc_fpregs->q.reserved[i]);
| ^~~~~~~~~~
arch/riscv/kernel/signal.c: In function 'setup_rt_frame':
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/kernel/signal.c:187:16: note: in expansion of macro '__put_user'
187 | err |= __put_user(0, &frame->uc.uc_flags);
| ^~~~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/kernel/signal.c:188:16: note: in expansion of macro '__put_user'
188 | err |= __put_user(NULL, &frame->uc.uc_link);
| ^~~~~~~~~~
arch/riscv/kernel/signal.c: At top level:
arch/riscv/kernel/signal.c:309:27: warning: no previous prototype for 'do_notify_resume' [-Wmissing-prototypes]
309 | asmlinkage __visible void do_notify_resume(struct pt_regs *regs,
| ^~~~~~~~~~~~~~~~
--
In file included from include/linux/uaccess.h:11,
from include/linux/sched/task.h:11,
from kernel/fork.c:23:
include/asm-generic/termios.h: In function 'user_termio_to_kernel_termios':
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:25:13: note: in expansion of macro 'get_user'
25 | if (get_user(tmp, &termio->c_iflag) < 0)
| ^~~~~~~~
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:29:13: note: in expansion of macro 'get_user'
29 | if (get_user(tmp, &termio->c_oflag) < 0)
| ^~~~~~~~
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:33:13: note: in expansion of macro 'get_user'
33 | if (get_user(tmp, &termio->c_cflag) < 0)
| ^~~~~~~~
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:37:13: note: in expansion of macro 'get_user'
37 | if (get_user(tmp, &termio->c_lflag) < 0)
| ^~~~~~~~
>> arch/riscv/include/asm/uaccess.h:113:9: error: expected ';' before 'if'
113 | if (err) \
| ^~
arch/riscv/include/asm/uaccess.h:133:17: note: in expansion of macro '__get_user_8'
133 | __get_user_8((x), __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:168:9: note: in expansion of macro '__get_user_nocheck'
168 | __get_user_nocheck(x, __gu_ptr, __gu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:196:17: note: in expansion of macro '__get_user'
196 | __get_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:41:13: note: in expansion of macro 'get_user'
41 | if (get_user(termios->c_line, &termio->c_line) < 0)
| ^~~~~~~~
include/asm-generic/termios.h: In function 'kernel_termios_to_user_termio':
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:59:13: note: in expansion of macro 'put_user'
59 | if (put_user(termios->c_iflag, &termio->c_iflag) < 0 ||
| ^~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:60:13: note: in expansion of macro 'put_user'
60 | put_user(termios->c_oflag, &termio->c_oflag) < 0 ||
| ^~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:61:13: note: in expansion of macro 'put_user'
61 | put_user(termios->c_cflag, &termio->c_cflag) < 0 ||
| ^~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:62:13: note: in expansion of macro 'put_user'
62 | put_user(termios->c_lflag, &termio->c_lflag) < 0 ||
| ^~~~~~~~
arch/riscv/include/asm/uaccess.h:220:19: warning: unused variable '__tmp' [-Wunused-variable]
220 | uintptr_t __tmp; \
| ^~~~~
arch/riscv/include/asm/uaccess.h:249:17: note: in expansion of macro '__put_user_8'
249 | __put_user_8((x), __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:286:9: note: in expansion of macro '__put_user_nocheck'
286 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \
| ^~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/uaccess.h:313:17: note: in expansion of macro '__put_user'
313 | __put_user((x), __p) : \
| ^~~~~~~~~~
include/asm-generic/termios.h:63:13: note: in expansion of macro 'put_user'
63 | put_user(termios->c_line, &termio->c_line) < 0 ||
| ^~~~~~~~
kernel/fork.c: At top level:
kernel/fork.c:161:13: warning: no previous prototype for 'arch_release_task_struct' [-Wmissing-prototypes]
161 | void __weak arch_release_task_struct(struct task_struct *tsk)
| ^~~~~~~~~~~~~~~~~~~~~~~~
kernel/fork.c:763:20: warning: no previous prototype for 'arch_task_cache_init' [-Wmissing-prototypes]
763 | void __init __weak arch_task_cache_init(void) { }
| ^~~~~~~~~~~~~~~~~~~~
In file included from include/linux/uaccess.h:11,
from include/linux/sched/task.h:11,
from kernel/fork.c:23:
..
vim +113 arch/riscv/include/asm/uaccess.h
94
95 #ifdef CONFIG_64BIT
96 #define __get_user_8(x, ptr, err) \
97 __get_user_asm("ld", x, ptr, err)
98 #else /* !CONFIG_64BIT */
99 #define __get_user_8(x, ptr, err) \
100 do { \
101 u32 __user *__ptr = (u32 __user *)(ptr); \
102 u32 __lo, __hi; \
103 __asm__ __volatile__ ( \
104 "1:\n" \
105 " lw %1, %3\n" \
106 "2:\n" \
107 " lw %2, %4\n" \
108 "3:\n" \
109 _ASM_EXTABLE_UACCESS_ERR_ZERO(1b, 3b, %0, %1) \
110 _ASM_EXTABLE_UACCESS_ERR_ZERO(2b, 3b, %0, %1) \
111 : "+r" (err), "=&r" (__lo), "=r" (__hi) \
112 : "m" (__ptr[__LSW]), "m" (__ptr[__MSW])) \
> 113 if (err) \
114 __hi = 0; \
115 (x) = (__typeof__(x))((__typeof__((x)-(x)))( \
116 (((u64)__hi << 32) | __lo))); \
117 } while (0)
118 #endif /* CONFIG_64BIT */
119
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH net-next v5 3/3] tsnep: Add TSN endpoint Ethernet MAC driver
by kernel test robot
Hi Gerhard,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Gerhard-Engleder/TSN-endpoint-Et...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git a5bdc36354cbf1a1a91396f4da548ff484686305
config: m68k-randconfig-r004-20211118 (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.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/3252efb6502fdfc25aa357f7dca6290ba...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Gerhard-Engleder/TSN-endpoint-Ethernet-MAC-driver/20211116-052158
git checkout 3252efb6502fdfc25aa357f7dca6290ba9b140e9
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/ethernet/engleder/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/swab.h:5,
from include/uapi/linux/byteorder/big_endian.h:13,
from include/linux/byteorder/big_endian.h:5,
from arch/m68k/include/uapi/asm/byteorder.h:5,
from include/asm-generic/bitops/le.h:7,
from arch/m68k/include/asm/bitops.h:529,
from include/linux/bitops.h:33,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:55,
from arch/m68k/include/asm/div64.h:6,
from include/linux/math.h:5,
from include/linux/math64.h:6,
from include/linux/time64.h:5,
from include/linux/restart_block.h:10,
from include/linux/thread_info.h:14,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/rcupdate.h:25,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/net/ethernet/engleder/tsnep.h:9,
from drivers/net/ethernet/engleder/tsnep_main.c:18:
drivers/net/ethernet/engleder/tsnep_main.c: In function 'tsnep_tx_activate':
>> drivers/net/ethernet/engleder/tsnep_main.c:292:36: error: 'struct tsnep_tx_entry' has no member named 'len'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~
include/uapi/linux/swab.h:118:39: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
drivers/net/ethernet/engleder/tsnep_main.c:292:17: note: in expansion of macro '__cpu_to_le32'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~~~~~~~~~~~~
>> drivers/net/ethernet/engleder/tsnep_main.c:292:36: error: 'struct tsnep_tx_entry' has no member named 'len'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~
include/uapi/linux/swab.h:19:19: note: in definition of macro '___constant_swab32'
19 | (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
| ^
include/uapi/linux/byteorder/big_endian.h:33:43: note: in expansion of macro '__swab32'
33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
| ^~~~~~~~
drivers/net/ethernet/engleder/tsnep_main.c:292:17: note: in expansion of macro '__cpu_to_le32'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~~~~~~~~~~~~
>> drivers/net/ethernet/engleder/tsnep_main.c:292:36: error: 'struct tsnep_tx_entry' has no member named 'len'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~
include/uapi/linux/swab.h:20:19: note: in definition of macro '___constant_swab32'
20 | (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
| ^
include/uapi/linux/byteorder/big_endian.h:33:43: note: in expansion of macro '__swab32'
33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
| ^~~~~~~~
drivers/net/ethernet/engleder/tsnep_main.c:292:17: note: in expansion of macro '__cpu_to_le32'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~~~~~~~~~~~~
>> drivers/net/ethernet/engleder/tsnep_main.c:292:36: error: 'struct tsnep_tx_entry' has no member named 'len'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~
include/uapi/linux/swab.h:21:19: note: in definition of macro '___constant_swab32'
21 | (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
| ^
include/uapi/linux/byteorder/big_endian.h:33:43: note: in expansion of macro '__swab32'
33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
| ^~~~~~~~
drivers/net/ethernet/engleder/tsnep_main.c:292:17: note: in expansion of macro '__cpu_to_le32'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~~~~~~~~~~~~
>> drivers/net/ethernet/engleder/tsnep_main.c:292:36: error: 'struct tsnep_tx_entry' has no member named 'len'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~
include/uapi/linux/swab.h:22:19: note: in definition of macro '___constant_swab32'
22 | (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
| ^
include/uapi/linux/byteorder/big_endian.h:33:43: note: in expansion of macro '__swab32'
33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
| ^~~~~~~~
drivers/net/ethernet/engleder/tsnep_main.c:292:17: note: in expansion of macro '__cpu_to_le32'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~~~~~~~~~~~~
>> drivers/net/ethernet/engleder/tsnep_main.c:292:36: error: 'struct tsnep_tx_entry' has no member named 'len'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~
include/uapi/linux/swab.h:120:19: note: in definition of macro '__swab32'
120 | __fswab32(x))
| ^
drivers/net/ethernet/engleder/tsnep_main.c:292:17: note: in expansion of macro '__cpu_to_le32'
292 | __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
| ^~~~~~~~~~~~~
drivers/net/ethernet/engleder/tsnep_main.c: In function 'tsnep_tx_unmap':
>> drivers/net/ethernet/engleder/tsnep_main.c:343:32: warning: variable 'entry' set but not used [-Wunused-but-set-variable]
343 | struct tsnep_tx_entry *entry;
| ^~~~~
drivers/net/ethernet/engleder/tsnep_main.c: In function 'tsnep_rx_ring_cleanup':
>> drivers/net/ethernet/engleder/tsnep_main.c:543:26: error: 'struct tsnep_rx_entry' has no member named 'dma'
543 | if (entry->dma)
| ^~
In file included from drivers/net/ethernet/engleder/tsnep.h:10,
from drivers/net/ethernet/engleder/tsnep_main.c:18:
drivers/net/ethernet/engleder/tsnep_main.c:544:55: error: 'struct tsnep_rx_entry' has no member named 'dma'
544 | dma_unmap_single(dmadev, entry->dma, entry->len,
| ^~
include/linux/dma-mapping.h:407:64: note: in definition of macro 'dma_unmap_single'
407 | #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0)
| ^
>> drivers/net/ethernet/engleder/tsnep_main.c:544:67: error: 'struct tsnep_rx_entry' has no member named 'len'
544 | dma_unmap_single(dmadev, entry->dma, entry->len,
| ^~
include/linux/dma-mapping.h:407:67: note: in definition of macro 'dma_unmap_single'
407 | #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0)
| ^
drivers/net/ethernet/engleder/tsnep_main.c: In function 'tsnep_rx_activate':
drivers/net/ethernet/engleder/tsnep_main.c:638:34: error: 'struct tsnep_rx_entry' has no member named 'len'
638 | entry->properties = entry->len & TSNEP_DESC_LENGTH_MASK;
| ^~
drivers/net/ethernet/engleder/tsnep_main.c: In function 'tsnep_rx_poll':
>> drivers/net/ethernet/engleder/tsnep_main.c:666:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
666 | int length;
| ^~~
>> drivers/net/ethernet/engleder/tsnep_main.c:679:17: error: 'dma' undeclared (first use in this function)
679 | dma = entry->dma;
| ^~~
drivers/net/ethernet/engleder/tsnep_main.c:679:17: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/ethernet/engleder/tsnep_main.c:679:28: error: 'struct tsnep_rx_entry' has no member named 'dma'
679 | dma = entry->dma;
| ^~
>> drivers/net/ethernet/engleder/tsnep_main.c:680:17: error: 'len' undeclared (first use in this function)
680 | len = entry->len;
| ^~~
drivers/net/ethernet/engleder/tsnep_main.c:680:28: error: 'struct tsnep_rx_entry' has no member named 'len'
680 | len = entry->len;
| ^~
vim +292 drivers/net/ethernet/engleder/tsnep_main.c
243
244 static void tsnep_tx_activate(struct tsnep_tx *tx, int index, bool last)
245 {
246 struct tsnep_tx_entry *entry = &tx->entry[index];
247
248 entry->properties = 0;
249 if (entry->skb) {
250 entry->properties =
251 skb_pagelen(entry->skb) & TSNEP_DESC_LENGTH_MASK;
252 entry->properties |= TSNEP_DESC_INTERRUPT_FLAG;
253 if (skb_shinfo(entry->skb)->tx_flags & SKBTX_IN_PROGRESS)
254 entry->properties |= TSNEP_DESC_EXTENDED_WRITEBACK_FLAG;
255
256 /* toggle user flag to prevent false acknowledge
257 *
258 * Only the first fragment is acknowledged. For all other
259 * fragments no acknowledge is done and the last written owner
260 * counter stays in the writeback descriptor. Therefore, it is
261 * possible that the last written owner counter is identical to
262 * the new incremented owner counter and a false acknowledge is
263 * detected before the real acknowledge has been done by
264 * hardware.
265 *
266 * The user flag is used to prevent this situation. The user
267 * flag is copied to the writeback descriptor by the hardware
268 * and is used as additional acknowledge data. By toggeling the
269 * user flag only for the first fragment (which is
270 * acknowledged), it is guaranteed that the last acknowledge
271 * done for this descriptor has used a different user flag and
272 * cannot be detected as false acknowledge.
273 */
274 entry->owner_user_flag = !entry->owner_user_flag;
275 }
276 if (last)
277 entry->properties |= TSNEP_TX_DESC_LAST_FRAGMENT_FLAG;
278 if (index == tx->increment_owner_counter) {
279 tx->owner_counter++;
280 if (tx->owner_counter == 4)
281 tx->owner_counter = 1;
282 tx->increment_owner_counter--;
283 if (tx->increment_owner_counter < 0)
284 tx->increment_owner_counter = TSNEP_RING_SIZE - 1;
285 }
286 entry->properties |=
287 (tx->owner_counter << TSNEP_DESC_OWNER_COUNTER_SHIFT) &
288 TSNEP_DESC_OWNER_COUNTER_MASK;
289 if (entry->owner_user_flag)
290 entry->properties |= TSNEP_TX_DESC_OWNER_USER_FLAG;
291 entry->desc->more_properties =
> 292 __cpu_to_le32(entry->len & TSNEP_DESC_LENGTH_MASK);
293
294 dma_wmb();
295
296 entry->desc->properties = __cpu_to_le32(entry->properties);
297 }
298
299 static int tsnep_tx_desc_available(struct tsnep_tx *tx)
300 {
301 if (tx->read <= tx->write)
302 return TSNEP_RING_SIZE - tx->write + tx->read - 1;
303 else
304 return tx->read - tx->write - 1;
305 }
306
307 static int tsnep_tx_map(struct sk_buff *skb, struct tsnep_tx *tx, int count)
308 {
309 struct device *dmadev = tx->adapter->dmadev;
310 struct tsnep_tx_entry *entry;
311 unsigned int len;
312 dma_addr_t dma;
313 int i;
314
315 for (i = 0; i < count; i++) {
316 entry = &tx->entry[(tx->write + i) % TSNEP_RING_SIZE];
317
318 if (i == 0) {
319 len = skb_headlen(skb);
320 dma = dma_map_single(dmadev, skb->data, len,
321 DMA_TO_DEVICE);
322 } else {
323 len = skb_frag_size(&skb_shinfo(skb)->frags[i - 1]);
324 dma = skb_frag_dma_map(dmadev,
325 &skb_shinfo(skb)->frags[i - 1],
326 0, len, DMA_TO_DEVICE);
327 }
328 if (dma_mapping_error(dmadev, dma))
329 return -ENOMEM;
330
331 dma_unmap_len_set(entry, len, len);
332 dma_unmap_addr_set(entry, dma, dma);
333
334 entry->desc->tx = __cpu_to_le64(dma);
335 }
336
337 return 0;
338 }
339
340 static void tsnep_tx_unmap(struct tsnep_tx *tx, int count)
341 {
342 struct device *dmadev = tx->adapter->dmadev;
> 343 struct tsnep_tx_entry *entry;
344 int i;
345
346 for (i = 0; i < count; i++) {
347 entry = &tx->entry[(tx->read + i) % TSNEP_RING_SIZE];
348
349 if (dma_unmap_len(entry, len)) {
350 if (i == 0)
351 dma_unmap_single(dmadev,
352 dma_unmap_addr(entry, dma),
353 dma_unmap_len(entry, len),
354 DMA_TO_DEVICE);
355 else
356 dma_unmap_page(dmadev,
357 dma_unmap_addr(entry, dma),
358 dma_unmap_len(entry, len),
359 DMA_TO_DEVICE);
360 dma_unmap_len_set(entry, len, 0);
361 }
362 }
363 }
364
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[jolsa-perf:bpf/batch 16/29] kernel/bpf/syscall.c:2776:8: error: implicit declaration of function 'bpf_tramp_id_single'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/batch
head: 5f1f613266bf58f8424a93e1f8b99c4ac8fa6c2b
commit: 378851fb026c8aeef2c2f622957a91a1f0fae87f [16/29] bpf: Add bpf_tramp_id_single function
config: hexagon-randconfig-r035-20211118 (attached as .config)
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://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id...
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf bpf/batch
git checkout 378851fb026c8aeef2c2f622957a91a1f0fae87f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel/bpf/syscall.c:2668:15: error: implicit declaration of function 'bpf_tramp_attach_unlink' [-Werror,-Wimplicit-function-declaration]
WARN_ON_ONCE(bpf_tramp_attach_unlink(attach));
^
kernel/bpf/syscall.c:2672:2: error: implicit declaration of function 'bpf_tramp_detach' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_detach(attach);
^
>> kernel/bpf/syscall.c:2776:8: error: implicit declaration of function 'bpf_tramp_id_single' [-Werror,-Wimplicit-function-declaration]
id = bpf_tramp_id_single(tgt_prog, NULL, btf_id);
^
kernel/bpf/syscall.c:2776:6: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_id *' from 'int' [-Wint-conversion]
id = bpf_tramp_id_single(tgt_prog, NULL, btf_id);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c:2831:8: error: implicit declaration of function 'bpf_tramp_id_single' [-Werror,-Wimplicit-function-declaration]
id = bpf_tramp_id_single(NULL, prog->aux->attach_btf, btf_id);
^
kernel/bpf/syscall.c:2831:6: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_id *' from 'int' [-Wint-conversion]
id = bpf_tramp_id_single(NULL, prog->aux->attach_btf, btf_id);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c:2839:8: error: implicit declaration of function 'bpf_tramp_id_is_empty' [-Werror,-Wimplicit-function-declaration]
(!bpf_tramp_id_is_empty(id) &&
^
kernel/bpf/syscall.c:2840:8: error: implicit declaration of function 'bpf_tramp_id_is_equal' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_id_is_equal(id, prog->aux->dst_attach->id))) {
^
kernel/bpf/syscall.c:2840:8: note: did you mean 'bpf_tramp_id_is_empty'?
kernel/bpf/syscall.c:2839:8: note: 'bpf_tramp_id_is_empty' declared here
(!bpf_tramp_id_is_empty(id) &&
^
kernel/bpf/syscall.c:2854:12: error: implicit declaration of function 'bpf_tramp_attach' [-Werror,-Wimplicit-function-declaration]
attach = bpf_tramp_attach(id, tgt_prog, prog);
^
kernel/bpf/syscall.c:2854:10: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_attach *' from 'int' [-Wint-conversion]
attach = bpf_tramp_attach(id, tgt_prog, prog);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c:2875:8: error: implicit declaration of function 'bpf_tramp_attach_link' [-Werror,-Wimplicit-function-declaration]
err = bpf_tramp_attach_link(attach);
^
kernel/bpf/syscall.c:2898:3: error: implicit declaration of function 'bpf_tramp_detach' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_detach(prog->aux->dst_attach);
^
kernel/bpf/syscall.c:2913:2: error: implicit declaration of function 'bpf_tramp_id_free' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_id_free(id);
^
3 warnings and 10 errors generated.
--
>> kernel/bpf/verifier.c:13998:7: error: implicit declaration of function 'bpf_tramp_id_single' [-Werror,-Wimplicit-function-declaration]
id = bpf_tramp_id_single(NULL, prog->aux->attach_btf, btf_id);
^
kernel/bpf/verifier.c:13998:5: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_id *' from 'int' [-Wint-conversion]
id = bpf_tramp_id_single(NULL, prog->aux->attach_btf, btf_id);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/verifier.c:14004:11: error: implicit declaration of function 'bpf_tramp_attach' [-Werror,-Wimplicit-function-declaration]
attach = bpf_tramp_attach(id, tgt_prog, prog);
^
kernel/bpf/verifier.c:14004:9: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_attach *' from 'int' [-Wint-conversion]
attach = bpf_tramp_attach(id, tgt_prog, prog);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/verifier.c:14006:3: error: implicit declaration of function 'bpf_tramp_id_free' [-Werror,-Wimplicit-function-declaration]
bpf_tramp_id_free(id);
^
kernel/bpf/verifier.c:14006:3: note: did you mean 'bpf_tramp_id_single'?
kernel/bpf/verifier.c:13998:7: note: 'bpf_tramp_id_single' declared here
id = bpf_tramp_id_single(NULL, prog->aux->attach_btf, btf_id);
^
2 warnings and 3 errors generated.
vim +/bpf_tramp_id_single +2776 kernel/bpf/syscall.c
2718
2719 static int bpf_tracing_prog_attach(struct bpf_prog *prog,
2720 int tgt_prog_fd,
2721 u32 btf_id)
2722 {
2723 bool prog_extension = prog->type == BPF_PROG_TYPE_EXT;
2724 struct bpf_tramp_attach *attach = NULL;
2725 struct bpf_link_primer link_primer;
2726 struct bpf_prog *tgt_prog = NULL;
2727 struct bpf_tracing_link *link;
2728 struct bpf_tramp_id *id = NULL;
2729 int err;
2730
2731 switch (prog->type) {
2732 case BPF_PROG_TYPE_TRACING:
2733 if (prog->expected_attach_type != BPF_TRACE_FENTRY &&
2734 prog->expected_attach_type != BPF_TRACE_FEXIT &&
2735 prog->expected_attach_type != BPF_MODIFY_RETURN) {
2736 err = -EINVAL;
2737 goto out_put_prog;
2738 }
2739 break;
2740 case BPF_PROG_TYPE_EXT:
2741 if (prog->expected_attach_type != 0) {
2742 err = -EINVAL;
2743 goto out_put_prog;
2744 }
2745 break;
2746 case BPF_PROG_TYPE_LSM:
2747 if (prog->expected_attach_type != BPF_LSM_MAC) {
2748 err = -EINVAL;
2749 goto out_put_prog;
2750 }
2751 break;
2752 default:
2753 err = -EINVAL;
2754 goto out_put_prog;
2755 }
2756
2757 if (!!tgt_prog_fd != !!btf_id) {
2758 err = -EINVAL;
2759 goto out_put_prog;
2760 }
2761
2762 if (tgt_prog_fd) {
2763 /* For now we only allow new targets for BPF_PROG_TYPE_EXT */
2764 if (prog->type != BPF_PROG_TYPE_EXT) {
2765 err = -EINVAL;
2766 goto out_put_prog;
2767 }
2768
2769 tgt_prog = bpf_prog_get(tgt_prog_fd);
2770 if (IS_ERR(tgt_prog)) {
2771 err = PTR_ERR(tgt_prog);
2772 tgt_prog = NULL;
2773 goto out_put_prog;
2774 }
2775
> 2776 id = bpf_tramp_id_single(tgt_prog, NULL, btf_id);
2777 if (!id) {
2778 err = -ENOMEM;
2779 goto out_put_prog;
2780 }
2781 }
2782
2783 link = kzalloc(sizeof(*link), GFP_USER);
2784 if (!link) {
2785 err = -ENOMEM;
2786 goto out_put_prog;
2787 }
2788 bpf_link_init(&link->link, BPF_LINK_TYPE_TRACING,
2789 &bpf_tracing_link_lops, prog);
2790 link->attach_type = prog->expected_attach_type;
2791
2792 mutex_lock(&prog->aux->dst_mutex);
2793
2794 if (!prog_extension && prog->aux->attach) {
2795 err = -EBUSY;
2796 goto out_unlock;
2797 }
2798
2799 /* There are a few possible cases here:
2800 *
2801 * - if prog->aux->dst_trampoline is set, the program was just loaded
2802 * and not yet attached to anything, so we can use the values stored
2803 * in prog->aux
2804 *
2805 * - if prog->aux->dst_trampoline is NULL, the program has already been
2806 * attached to a target and its initial target was cleared (below)
2807 *
2808 * - if tgt_prog != NULL, the caller specified tgt_prog_fd +
2809 * target_btf_id using the link_create API.
2810 *
2811 * - if tgt_prog == NULL when this function was called using the old
2812 * raw_tracepoint_open API, and we need a target from prog->aux
2813 *
2814 * - if prog->aux->dst_trampoline and tgt_prog is NULL, the program
2815 * was detached and is going for re-attachment.
2816 */
2817 if (!prog->aux->dst_attach && !tgt_prog) {
2818 /*
2819 * Allow re-attach for TRACING and LSM programs. If it's
2820 * currently linked, bpf_trampoline_link_prog will fail.
2821 * EXT programs need to specify tgt_prog_fd, so they
2822 * re-attach in separate code path.
2823 */
2824 if (prog->type != BPF_PROG_TYPE_TRACING &&
2825 prog->type != BPF_PROG_TYPE_LSM) {
2826 err = -EINVAL;
2827 goto out_unlock;
2828 }
2829
2830 btf_id = prog->aux->attach_btf_id;
2831 id = bpf_tramp_id_single(NULL, prog->aux->attach_btf, btf_id);
2832 if (!id) {
2833 err = -ENOMEM;
2834 goto out_unlock;
2835 }
2836 }
2837
2838 if (!prog->aux->dst_attach ||
2839 (!bpf_tramp_id_is_empty(id) &&
2840 bpf_tramp_id_is_equal(id, prog->aux->dst_attach->id))) {
2841 /* If there is no saved target, or the specified target is
2842 * different from the destination specified at load time, we
2843 * need a new trampoline and a check for compatibility
2844 */
2845 struct bpf_attach_target_info tgt_info = {};
2846
2847 err = bpf_check_attach_target(NULL, prog, tgt_prog, btf_id,
2848 &tgt_info);
2849 if (err)
2850 goto out_unlock;
2851
2852 id->addr[0] = (void *) tgt_info.tgt_addr;
2853
2854 attach = bpf_tramp_attach(id, tgt_prog, prog);
2855 if (IS_ERR(attach)) {
2856 err = PTR_ERR(attach);
2857 goto out_unlock;
2858 }
2859 } else {
2860 /* The caller didn't specify a target, or the target was the
2861 * same as the destination supplied during program load. This
2862 * means we can reuse the trampoline and reference from program
2863 * load time, and there is no need to allocate a new one. This
2864 * can only happen once for any program, as the saved values in
2865 * prog->aux are cleared below.
2866 */
2867 attach = prog->aux->dst_attach;
2868 tgt_prog = prog->aux->dst_prog;
2869 }
2870
2871 err = bpf_link_prime(&link->link, &link_primer);
2872 if (err)
2873 goto out_unlock;
2874
2875 err = bpf_tramp_attach_link(attach);
2876 if (err) {
2877 bpf_link_cleanup(&link_primer);
2878 link = NULL;
2879 goto out_unlock;
2880 }
2881
2882 link->tgt_prog = tgt_prog;
2883 if (prog_extension)
2884 link->attach = attach;
2885 else
2886 prog->aux->attach = attach;
2887
2888 /* Always clear the trampoline and target prog from prog->aux to make
2889 * sure the original attach destination is not kept alive after a
2890 * program is (re-)attached to another target.
2891 */
2892 if (prog->aux->dst_prog &&
2893 (tgt_prog_fd || attach != prog->aux->dst_attach))
2894 /* got extra prog ref from syscall, or attaching to different prog */
2895 bpf_prog_put(prog->aux->dst_prog);
2896 if (prog->aux->dst_attach && attach != prog->aux->dst_attach)
2897 /* we allocated a new trampoline, so free the old one */
2898 bpf_tramp_detach(prog->aux->dst_attach);
2899
2900 prog->aux->dst_prog = NULL;
2901 prog->aux->dst_attach = NULL;
2902 mutex_unlock(&prog->aux->dst_mutex);
2903
2904 return bpf_link_settle(&link_primer);
2905 out_unlock:
2906 if (attach && attach != prog->aux->dst_attach)
2907 bpf_tramp_detach(attach);
2908 mutex_unlock(&prog->aux->dst_mutex);
2909 kfree(link);
2910 out_put_prog:
2911 if (tgt_prog_fd && tgt_prog)
2912 bpf_prog_put(tgt_prog);
2913 bpf_tramp_id_free(id);
2914 return err;
2915 }
2916
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[mcgrof-next:20211117-sysctl-cleanups-all-set-04 3/36] kernel/hung_task.c:69:8: error: 'sysctl_hung_task_timeout_secs' redeclared as different kind of symbol
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20211117-sysctl-cleanups-all-set-04
head: 3559bb8939dd93c96215ab179d868c5fdc167335
commit: 02c747a7684bf887656b2d3c7ea2c9e4393ee2f5 [3/36] hung_task: Move hung_task sysctl interface to hung_task.c
config: microblaze-randconfig-r036-20211118 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/com...
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20211117-sysctl-cleanups-all-set-04
git checkout 02c747a7684bf887656b2d3c7ea2c9e4393ee2f5
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=microblaze SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> kernel/hung_task.c:69:8: error: 'sysctl_hung_task_timeout_secs' redeclared as different kind of symbol
69 | enum { sysctl_hung_task_timeout_secs = 0 };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/hung_task.c:45:29: note: previous definition of 'sysctl_hung_task_timeout_secs' with type 'long unsigned int'
45 | unsigned long __read_mostly sysctl_hung_task_timeout_secs = CONFIG_DEFAULT_HUNG_TASK_TIMEOUT;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/hung_task.c: In function 'check_hung_task':
>> kernel/hung_task.c:144:21: error: 'sysctl_hung_task_all_cpu_backtrace' undeclared (first use in this function); did you mean 'sysctl_oops_all_cpu_backtrace'?
144 | if (sysctl_hung_task_all_cpu_backtrace)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| sysctl_oops_all_cpu_backtrace
kernel/hung_task.c:144:21: note: each undeclared identifier is reported only once for each function it appears in
kernel/hung_task.c: At top level:
>> kernel/hung_task.c:329:35: error: lvalue required as unary '&' operand
329 | .data = &sysctl_hung_task_timeout_secs,
| ^
vim +/sysctl_hung_task_timeout_secs +69 kernel/hung_task.c
60
61 #ifdef CONFIG_SMP
62 /*
63 * Should we dump all CPUs backtraces in a hung task event?
64 * Defaults to 0, can be changed via sysctl.
65 */
66 unsigned int __read_mostly sysctl_hung_task_all_cpu_backtrace;
67 #else
68 /* Avoid need for ifdefs elsewhere in the code */
> 69 enum { sysctl_hung_task_timeout_secs = 0 };
70 #endif /* CONFIG_SMP */
71
72 /*
73 * Should we panic (and reboot, if panic_timeout= is set) when a
74 * hung task is detected:
75 */
76 unsigned int __read_mostly sysctl_hung_task_panic =
77 CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE;
78
79 static int
80 hung_task_panic(struct notifier_block *this, unsigned long event, void *ptr)
81 {
82 did_panic = 1;
83
84 return NOTIFY_DONE;
85 }
86
87 static struct notifier_block panic_block = {
88 .notifier_call = hung_task_panic,
89 };
90
91 static void check_hung_task(struct task_struct *t, unsigned long timeout)
92 {
93 unsigned long switch_count = t->nvcsw + t->nivcsw;
94
95 /*
96 * Ensure the task is not frozen.
97 * Also, skip vfork and any other user process that freezer should skip.
98 */
99 if (unlikely(t->flags & (PF_FROZEN | PF_FREEZER_SKIP)))
100 return;
101
102 /*
103 * When a freshly created task is scheduled once, changes its state to
104 * TASK_UNINTERRUPTIBLE without having ever been switched out once, it
105 * musn't be checked.
106 */
107 if (unlikely(!switch_count))
108 return;
109
110 if (switch_count != t->last_switch_count) {
111 t->last_switch_count = switch_count;
112 t->last_switch_time = jiffies;
113 return;
114 }
115 if (time_is_after_jiffies(t->last_switch_time + timeout * HZ))
116 return;
117
118 trace_sched_process_hang(t);
119
120 if (sysctl_hung_task_panic) {
121 console_verbose();
122 hung_task_show_lock = true;
123 hung_task_call_panic = true;
124 }
125
126 /*
127 * Ok, the task did not get scheduled for more than 2 minutes,
128 * complain:
129 */
130 if (sysctl_hung_task_warnings) {
131 if (sysctl_hung_task_warnings > 0)
132 sysctl_hung_task_warnings--;
133 pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n",
134 t->comm, t->pid, (jiffies - t->last_switch_time) / HZ);
135 pr_err(" %s %s %.*s\n",
136 print_tainted(), init_utsname()->release,
137 (int)strcspn(init_utsname()->version, " "),
138 init_utsname()->version);
139 pr_err("\"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\""
140 " disables this message.\n");
141 sched_show_task(t);
142 hung_task_show_lock = true;
143
> 144 if (sysctl_hung_task_all_cpu_backtrace)
145 hung_task_show_all_bt = true;
146 }
147
148 touch_nmi_watchdog();
149 }
150
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[android-common:android12-5.10-2021-09 6733/10851] arch/arm64/kvm/fpsimd.c:129:5: error: implicit declaration of function 'sve_cond_update_zcr_vq'
by kernel test robot
Hi Marc,
FYI, the error/warning still remains.
tree: https://android.googlesource.com/kernel/common android12-5.10-2021-09
head: 0a07ca4e42c839ccc8cfcfa63078c9cb580c7d3b
commit: b0e15c8c44275afef4aacfb1560e38b974b02ac8 [6733/10851] FROMGIT: KVM: arm64: Save/restore SVE state for nVHE
config: arm64-buildonly-randconfig-r004-20211004 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c0039de2953d15815448b4b3c3bafb45607781e0)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android12-5.10-2021-09
git checkout b0e15c8c44275afef4aacfb1560e38b974b02ac8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/arm64/kvm/fpsimd.c:129:5: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1,
^
1 error generated.
vim +/sve_cond_update_zcr_vq +129 arch/arm64/kvm/fpsimd.c
108
109 /*
110 * Write back the vcpu FPSIMD regs if they are dirty, and invalidate the
111 * cpu FPSIMD regs so that they can't be spuriously reused if this vcpu
112 * disappears and another task or vcpu appears that recycles the same
113 * struct fpsimd_state.
114 */
115 void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu)
116 {
117 unsigned long flags;
118 bool host_has_sve = system_supports_sve();
119 bool guest_has_sve = vcpu_has_sve(vcpu);
120
121 local_irq_save(flags);
122
123 if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED) {
124 if (guest_has_sve) {
125 __vcpu_sys_reg(vcpu, ZCR_EL1) = read_sysreg_el1(SYS_ZCR);
126
127 /* Restore the VL that was saved when bound to the CPU */
128 if (!has_vhe())
> 129 sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1,
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[mcgrof-next:20211116-sysctl-cleanups-v4 3/35] kernel/hung_task.c:66:28: sparse: sparse: symbol 'sysctl_hung_task_all_cpu_backtrace' was not declared. Should it be static?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20211116-sysctl-cleanups-v4
head: 5347239461f25fc50aa761923245b9ec4a4aafec
commit: e854631643628749ab037f54ca9c26d69ffabb3e [3/35] hung_task: Move hung_task sysctl interface to hung_task.c
config: i386-randconfig-s002-20211117 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/com...
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20211116-sysctl-cleanups-v4
git checkout e854631643628749ab037f54ca9c26d69ffabb3e
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
kernel/hung_task.c:31:19: sparse: sparse: symbol 'sysctl_hung_task_check_count' was not declared. Should it be static?
kernel/hung_task.c:50:29: sparse: sparse: symbol 'sysctl_hung_task_check_interval_secs' was not declared. Should it be static?
kernel/hung_task.c:52:19: sparse: sparse: symbol 'sysctl_hung_task_warnings' was not declared. Should it be static?
>> kernel/hung_task.c:66:28: sparse: sparse: symbol 'sysctl_hung_task_all_cpu_backtrace' was not declared. Should it be static?
kernel/hung_task.c:76:28: sparse: sparse: symbol 'sysctl_hung_task_panic' was not declared. Should it be static?
>> kernel/hung_task.c:282:52: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void * @@ got void [noderef] __user *buffer @@
kernel/hung_task.c:282:52: sparse: expected void *
kernel/hung_task.c:282:52: sparse: got void [noderef] __user *buffer
>> kernel/hung_task.c:332:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@ expected int ( [usertype] *proc_handler )( ... ) @@ got int ( * )( ... ) @@
kernel/hung_task.c:332:35: sparse: expected int ( [usertype] *proc_handler )( ... )
kernel/hung_task.c:332:35: sparse: got int ( * )( ... )
kernel/hung_task.c:340:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@ expected int ( [usertype] *proc_handler )( ... ) @@ got int ( * )( ... ) @@
kernel/hung_task.c:340:35: sparse: expected int ( [usertype] *proc_handler )( ... )
kernel/hung_task.c:340:35: sparse: got int ( * )( ... )
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months