* Re: [PATCH bpf-next v6 12/23] HID: initial BPF implementation
[not found] <20220712145850.599666-13-benjamin.tissoires@redhat.com>
@ 2022-07-14 14:49 ` kernel test robot
2022-07-14 16:42 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-07-14 14:49 UTC (permalink / raw)
To: Benjamin Tissoires; +Cc: llvm, kbuild-all
Hi Benjamin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Benjamin-Tissoires/Introduce-eBPF-support-for-HID-devices/20220712-230852
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: hexagon-randconfig-r016-20220714 (https://download.01.org/0day-ci/archive/20220714/202207142225.7Lu43LAS-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5e61b9c556267086ef9b743a0b57df302eef831b)
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/intel-lab-lkp/linux/commit/57eb5074a35029f30cc13ed3a526b3342b169788
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Benjamin-Tissoires/Introduce-eBPF-support-for-HID-devices/20220712-230852
git checkout 57eb5074a35029f30cc13ed3a526b3342b169788
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/hid/bpf/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/hid/bpf/hid_bpf_dispatch.c:191:12: warning: no previous prototype for function 'hid_bpf_init' [-Wmissing-prototypes]
int __init hid_bpf_init(void)
^
drivers/hid/bpf/hid_bpf_dispatch.c:191:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __init hid_bpf_init(void)
^
static
>> drivers/hid/bpf/hid_bpf_dispatch.c:224:13: warning: no previous prototype for function 'hid_bpf_exit' [-Wmissing-prototypes]
void __exit hid_bpf_exit(void)
^
drivers/hid/bpf/hid_bpf_dispatch.c:224:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __exit hid_bpf_exit(void)
^
static
2 warnings generated.
--
>> drivers/hid/bpf/hid_bpf_jmp_table.c:100:21: warning: no previous prototype for function '__hid_bpf_tail_call' [-Wmissing-prototypes]
__weak noinline int __hid_bpf_tail_call(struct hid_bpf_ctx *ctx)
^
drivers/hid/bpf/hid_bpf_jmp_table.c:100:17: note: declare 'static' if the function is not intended to be used outside of this translation unit
__weak noinline int __hid_bpf_tail_call(struct hid_bpf_ctx *ctx)
^
static
1 warning generated.
vim +/hid_bpf_init +191 drivers/hid/bpf/hid_bpf_dispatch.c
190
> 191 int __init hid_bpf_init(void)
192 {
193 int err;
194
195 /* Note: if we exit with an error any time here, we would entirely break HID, which
196 * is probably not something we want. So we log an error and return success.
197 *
198 * This is not a big deal: the syscall allowing to attach a BPF program to a HID device
199 * will not be available, so nobody will be able to use the functionality.
200 */
201
202 err = register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &hid_bpf_kfunc_set);
203 if (err) {
204 pr_warn("error while setting HID BPF tracing kfuncs: %d", err);
205 return 0;
206 }
207
208 err = hid_bpf_preload_skel();
209 if (err) {
210 pr_warn("error while preloading HID BPF dispatcher: %d", err);
211 return 0;
212 }
213
214 /* register syscalls after we are sure we can load our preloaded bpf program */
215 err = register_btf_kfunc_id_set(BPF_PROG_TYPE_SYSCALL, &hid_bpf_syscall_kfunc_set);
216 if (err) {
217 pr_warn("error while setting HID BPF syscall kfuncs: %d", err);
218 return 0;
219 }
220
221 return 0;
222 }
223
> 224 void __exit hid_bpf_exit(void)
225 {
226 /* HID depends on us, so if we hit that code, we are guaranteed that hid
227 * has been removed and thus we do not need to clear the HID devices
228 */
229 hid_bpf_free_links_and_skel();
230 }
231
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next v6 12/23] HID: initial BPF implementation
[not found] <20220712145850.599666-13-benjamin.tissoires@redhat.com>
2022-07-14 14:49 ` [PATCH bpf-next v6 12/23] HID: initial BPF implementation kernel test robot
@ 2022-07-14 16:42 ` kernel test robot
2022-07-15 9:28 ` Benjamin Tissoires
1 sibling, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-07-14 16:42 UTC (permalink / raw)
To: Benjamin Tissoires; +Cc: llvm, kbuild-all
Hi Benjamin,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Benjamin-Tissoires/Introduce-eBPF-support-for-HID-devices/20220712-230852
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: arm-vexpress_defconfig (https://download.01.org/0day-ci/archive/20220715/202207150008.O4t08On6-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5e61b9c556267086ef9b743a0b57df302eef831b)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/57eb5074a35029f30cc13ed3a526b3342b169788
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Benjamin-Tissoires/Introduce-eBPF-support-for-HID-devices/20220712-230852
git checkout 57eb5074a35029f30cc13ed3a526b3342b169788
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: dispatch_hid_bpf_device_event
>>> referenced by hid-core.c
>>> hid/hid-core.o:(hid_input_report) in archive drivers/built-in.a
--
>> ld.lld: error: undefined symbol: hid_bpf_device_init
>>> referenced by hid-core.c
>>> hid/hid-core.o:(hid_allocate_device) in archive drivers/built-in.a
--
>> ld.lld: error: undefined symbol: hid_bpf_destroy_device
>>> referenced by hid-core.c
>>> hid/hid-core.o:(hid_destroy_device) in archive drivers/built-in.a
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next v6 12/23] HID: initial BPF implementation
2022-07-14 16:42 ` kernel test robot
@ 2022-07-15 9:28 ` Benjamin Tissoires
0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Tissoires @ 2022-07-15 9:28 UTC (permalink / raw)
To: kernel test robot; +Cc: llvm, kbuild-all
On Thu, Jul 14, 2022 at 6:43 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Benjamin,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on bpf-next/master]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Benjamin-Tissoires/Introduce-eBPF-support-for-HID-devices/20220712-230852
> base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
> config: arm-vexpress_defconfig (https://download.01.org/0day-ci/archive/20220715/202207150008.O4t08On6-lkp@intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5e61b9c556267086ef9b743a0b57df302eef831b)
> 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 arm cross compiling tool for clang build
> # apt-get install binutils-arm-linux-gnueabi
> # https://github.com/intel-lab-lkp/linux/commit/57eb5074a35029f30cc13ed3a526b3342b169788
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Benjamin-Tissoires/Introduce-eBPF-support-for-HID-devices/20220712-230852
> git checkout 57eb5074a35029f30cc13ed3a526b3342b169788
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> >> ld.lld: error: undefined symbol: dispatch_hid_bpf_device_event
> >>> referenced by hid-core.c
> >>> hid/hid-core.o:(hid_input_report) in archive drivers/built-in.a
> --
> >> ld.lld: error: undefined symbol: hid_bpf_device_init
> >>> referenced by hid-core.c
> >>> hid/hid-core.o:(hid_allocate_device) in archive drivers/built-in.a
> --
> >> ld.lld: error: undefined symbol: hid_bpf_destroy_device
> >>> referenced by hid-core.c
> >>> hid/hid-core.o:(hid_destroy_device) in archive drivers/built-in.a
>
Good catch!
The issue is in include/linux/hid_bpf.h, the declaration of the
functions are guarded by #ifdef CONFIG_BPF instead of #ifdef
CONFIG_HID_BPF.
I'll amend it in the next version (and same for the other missing
static declarations).
Cheers,
Benjamin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-15 9:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220712145850.599666-13-benjamin.tissoires@redhat.com>
2022-07-14 14:49 ` [PATCH bpf-next v6 12/23] HID: initial BPF implementation kernel test robot
2022-07-14 16:42 ` kernel test robot
2022-07-15 9:28 ` Benjamin Tissoires
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox