From: kernel test robot <lkp@intel.com>
To: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
daniel@iogearbox.net
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
kernel-team@fb.com, linux-kernel@vger.kernel.org,
rafael@kernel.org, jeyu@kernel.org,
Andrii Nakryiko <andrii@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH v4 bpf-next 4/5] bpf: load and verify kernel module BTFs
Date: Wed, 11 Nov 2020 15:11:28 +0800 [thread overview]
Message-ID: <202011111538.rjfvj6Xv-lkp@intel.com> (raw)
In-Reply-To: <20201110011932.3201430-5-andrii@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 4563 bytes --]
Hi Andrii,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Andrii-Nakryiko/Integrate-kernel-module-BTF-support/20201110-095309
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: mips-randconfig-r002-20201110 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4d81c8adb6ed9840257f6cb6b93f60856d422a15)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://github.com/0day-ci/linux/commit/dcd763b7808fdc01ebf70bbe07ba92388df4d20d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andrii-Nakryiko/Integrate-kernel-module-BTF-support/20201110-095309
git checkout dcd763b7808fdc01ebf70bbe07ba92388df4d20d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> kernel/bpf/btf.c:4481:20: warning: unused function 'btf_parse_module'
static struct btf char const void unsigned int data_size)
^
fatal error: error in backend: Nested variants found in inline asm string: ' .set push
.set mips64r2
.if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/atomic.h", .line = 154, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
1: ll $1, $2 # atomic_fetch_sub
subu $0, $1, $3
sc $0, $2
beqz $0, 1b
.set pop
move $0, $1
'
clang-12: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 12.0.0 (git://gitmirror/llvm_project 874b0a0b9db93f5d3350ffe6b5efda2d908415d0)
Target: mipsel-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/cross/clang-874b0a0b9d/bin
clang-12: note: diagnostic msg:
Makefile arch drivers include kernel mm scripts source usr
vim +/btf_parse_module +4481 kernel/bpf/btf.c
4480
> 4481 static struct btf *btf_parse_module(const char *module_name, const void *data, unsigned int data_size)
4482 {
4483 struct btf_verifier_env *env = NULL;
4484 struct bpf_verifier_log *log;
4485 struct btf *btf = NULL, *base_btf;
4486 int err;
4487
4488 base_btf = bpf_get_btf_vmlinux();
4489 if (IS_ERR(base_btf))
4490 return base_btf;
4491 if (!base_btf)
4492 return ERR_PTR(-EINVAL);
4493
4494 env = kzalloc(sizeof(*env), GFP_KERNEL | __GFP_NOWARN);
4495 if (!env)
4496 return ERR_PTR(-ENOMEM);
4497
4498 log = &env->log;
4499 log->level = BPF_LOG_KERNEL;
4500
4501 btf = kzalloc(sizeof(*btf), GFP_KERNEL | __GFP_NOWARN);
4502 if (!btf) {
4503 err = -ENOMEM;
4504 goto errout;
4505 }
4506 env->btf = btf;
4507
4508 btf->base_btf = base_btf;
4509 btf->start_id = base_btf->nr_types;
4510 btf->start_str_off = base_btf->hdr.str_len;
4511 btf->kernel_btf = true;
4512 snprintf(btf->name, sizeof(btf->name), "%s", module_name);
4513
4514 btf->data = kvmalloc(data_size, GFP_KERNEL | __GFP_NOWARN);
4515 if (!btf->data) {
4516 err = -ENOMEM;
4517 goto errout;
4518 }
4519 memcpy(btf->data, data, data_size);
4520 btf->data_size = data_size;
4521
4522 err = btf_parse_hdr(env);
4523 if (err)
4524 goto errout;
4525
4526 btf->nohdr_data = btf->data + btf->hdr.hdr_len;
4527
4528 err = btf_parse_str_sec(env);
4529 if (err)
4530 goto errout;
4531
4532 err = btf_check_all_metas(env);
4533 if (err)
4534 goto errout;
4535
4536 btf_verifier_env_free(env);
4537 refcount_set(&btf->refcnt, 1);
4538 return btf;
4539
4540 errout:
4541 btf_verifier_env_free(env);
4542 if (btf) {
4543 kvfree(btf->data);
4544 kvfree(btf->types);
4545 kfree(btf);
4546 }
4547 return ERR_PTR(err);
4548 }
4549
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30898 bytes --]
next prev parent reply other threads:[~2020-11-11 7:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 1:19 [PATCH v4 bpf-next 0/5] Integrate kernel module BTF support Andrii Nakryiko
2020-11-10 1:19 ` [PATCH v4 bpf-next 1/5] bpf: add in-kernel split " Andrii Nakryiko
2020-11-10 17:49 ` Song Liu
2020-11-10 18:31 ` Andrii Nakryiko
2020-11-10 20:14 ` Song Liu
2020-11-10 1:19 ` [PATCH v4 bpf-next 2/5] bpf: assign ID to vmlinux BTF and return extra info for BTF in GET_OBJ_INFO Andrii Nakryiko
2020-11-10 20:24 ` Song Liu
2020-11-10 1:19 ` [PATCH v4 bpf-next 3/5] kbuild: build kernel module BTFs if BTF is enabled and pahole supports it Andrii Nakryiko
2020-11-11 1:04 ` Song Liu
2020-11-16 19:55 ` Allan, Bruce W
2020-11-16 20:34 ` Andrii Nakryiko
2020-11-16 21:24 ` Jakub Kicinski
2020-11-16 22:35 ` Andrii Nakryiko
2021-11-26 15:16 ` Fabian Grünbichler
2021-12-08 0:08 ` Andrii Nakryiko
2020-11-17 3:44 ` David Ahern
2020-11-10 1:19 ` [PATCH v4 bpf-next 4/5] bpf: load and verify kernel module BTFs Andrii Nakryiko
2020-11-11 7:11 ` kernel test robot [this message]
2020-11-11 10:13 ` Jessica Yu
2020-11-11 20:11 ` Andrii Nakryiko
2020-11-13 10:31 ` Jessica Yu
2020-11-13 18:54 ` Andrii Nakryiko
2020-11-10 1:19 ` [PATCH v4 bpf-next 5/5] tools/bpftool: add support for in-kernel and named BTF in `btf show` Andrii Nakryiko
2020-11-11 1:15 ` Song Liu
2020-11-11 4:19 ` Andrii Nakryiko
2020-11-11 7:44 ` Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202011111538.rjfvj6Xv-lkp@intel.com \
--to=lkp@intel.com \
--cc=acme@redhat.com \
--cc=andrii@kernel.org \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=daniel@iogearbox.net \
--cc=jeyu@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).