From: kernel test robot <lkp@intel.com>
To: Alan Maguire <alan.maguire@oracle.com>,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
jolsa@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, quentin@isovalent.com,
eddyz87@gmail.com, martin.lau@linux.dev, song@kernel.org,
yonghong.song@linux.dev, john.fastabend@gmail.com,
kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
masahiroy@kernel.org, bpf@vger.kernel.org,
Alan Maguire <alan.maguire@oracle.com>
Subject: Re: [PATCH v4 bpf-next 13/17] bpf: support standalone BTF in modules
Date: Sun, 12 Nov 2023 23:35:59 +0800 [thread overview]
Message-ID: <202311122307.bjlq3XJ5-lkp@intel.com> (raw)
In-Reply-To: <20231112124834.388735-14-alan.maguire@oracle.com>
Hi Alan,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Alan-Maguire/btf-add-kind-layout-encoding-crcs-to-UAPI/20231112-205314
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20231112124834.388735-14-alan.maguire%40oracle.com
patch subject: [PATCH v4 bpf-next 13/17] bpf: support standalone BTF in modules
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20231112/202311122307.bjlq3XJ5-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231112/202311122307.bjlq3XJ5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311122307.bjlq3XJ5-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/bpf/btf.c: In function 'btf_seq_show':
kernel/bpf/btf.c:7447:29: warning: function 'btf_seq_show' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
7447 | seq_vprintf((struct seq_file *)show->target, fmt, args);
| ^~~~~~~~
kernel/bpf/btf.c: In function 'btf_snprintf_show':
kernel/bpf/btf.c:7484:9: warning: function 'btf_snprintf_show' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
7484 | len = vsnprintf(show->target, ssnprintf->len_left, fmt, args);
| ^~~
kernel/bpf/btf.c: In function 'btf_populate_kfunc_set':
>> kernel/bpf/btf.c:8153:44: error: implicit declaration of function 'btf_id_renumber'; did you mean 'btf_is_enum64'? [-Werror=implicit-function-declaration]
8153 | set->pairs[i].id = btf_id_renumber(btf, set->pairs[i].id);
| ^~~~~~~~~~~~~~~
| btf_is_enum64
cc1: some warnings being treated as errors
vim +8153 kernel/bpf/btf.c
8046
8047 static int btf_populate_kfunc_set(struct btf *btf, enum btf_kfunc_hook hook,
8048 const struct btf_kfunc_id_set *kset)
8049 {
8050 struct btf_kfunc_hook_filter *hook_filter;
8051 struct btf_id_set8 *add_set = kset->set;
8052 bool vmlinux_set = !btf_is_module(btf);
8053 bool add_filter = !!kset->filter;
8054 struct btf_kfunc_set_tab *tab;
8055 struct btf_id_set8 *set;
8056 u32 set_cnt;
8057 int ret;
8058
8059 if (hook >= BTF_KFUNC_HOOK_MAX) {
8060 ret = -EINVAL;
8061 goto end;
8062 }
8063
8064 if (!add_set->cnt)
8065 return 0;
8066
8067 tab = btf->kfunc_set_tab;
8068
8069 if (tab && add_filter) {
8070 u32 i;
8071
8072 hook_filter = &tab->hook_filters[hook];
8073 for (i = 0; i < hook_filter->nr_filters; i++) {
8074 if (hook_filter->filters[i] == kset->filter) {
8075 add_filter = false;
8076 break;
8077 }
8078 }
8079
8080 if (add_filter && hook_filter->nr_filters == BTF_KFUNC_FILTER_MAX_CNT) {
8081 ret = -E2BIG;
8082 goto end;
8083 }
8084 }
8085
8086 if (!tab) {
8087 tab = kzalloc(sizeof(*tab), GFP_KERNEL | __GFP_NOWARN);
8088 if (!tab)
8089 return -ENOMEM;
8090 btf->kfunc_set_tab = tab;
8091 }
8092
8093 set = tab->sets[hook];
8094 /* Warn when register_btf_kfunc_id_set is called twice for the same hook
8095 * for module sets.
8096 */
8097 if (WARN_ON_ONCE(set && !vmlinux_set)) {
8098 ret = -EINVAL;
8099 goto end;
8100 }
8101
8102 /* We don't need to allocate, concatenate, and sort module sets, because
8103 * only one is allowed per hook. Hence, we can directly assign the
8104 * pointer and return.
8105 */
8106 if (!vmlinux_set) {
8107 tab->sets[hook] = add_set;
8108 goto do_add_filter;
8109 }
8110
8111 /* In case of vmlinux sets, there may be more than one set being
8112 * registered per hook. To create a unified set, we allocate a new set
8113 * and concatenate all individual sets being registered. While each set
8114 * is individually sorted, they may become unsorted when concatenated,
8115 * hence re-sorting the final set again is required to make binary
8116 * searching the set using btf_id_set8_contains function work.
8117 */
8118 set_cnt = set ? set->cnt : 0;
8119
8120 if (set_cnt > U32_MAX - add_set->cnt) {
8121 ret = -EOVERFLOW;
8122 goto end;
8123 }
8124
8125 if (set_cnt + add_set->cnt > BTF_KFUNC_SET_MAX_CNT) {
8126 ret = -E2BIG;
8127 goto end;
8128 }
8129
8130 /* Grow set */
8131 set = krealloc(tab->sets[hook],
8132 offsetof(struct btf_id_set8, pairs[set_cnt + add_set->cnt]),
8133 GFP_KERNEL | __GFP_NOWARN);
8134 if (!set) {
8135 ret = -ENOMEM;
8136 goto end;
8137 }
8138
8139 /* For newly allocated set, initialize set->cnt to 0 */
8140 if (!tab->sets[hook])
8141 set->cnt = 0;
8142 tab->sets[hook] = set;
8143
8144 /* Concatenate the two sets */
8145 memcpy(set->pairs + set->cnt, add_set->pairs, add_set->cnt * sizeof(set->pairs[0]));
8146 if (btf->standalone_btf) {
8147 u32 i;
8148
8149 /* renumber BTF ids since BTF is standalone and has been mapped to look
8150 * like split BTF, while BTF kfunc ids are still old unmapped values.
8151 */
8152 for (i = set->cnt; i < set->cnt + add_set->cnt; i++)
> 8153 set->pairs[i].id = btf_id_renumber(btf, set->pairs[i].id);
8154 }
8155
8156 set->cnt += add_set->cnt;
8157
8158 sort(set->pairs, set->cnt, sizeof(set->pairs[0]), btf_id_cmp_func, NULL);
8159
8160 do_add_filter:
8161 if (add_filter) {
8162 hook_filter = &tab->hook_filters[hook];
8163 hook_filter->filters[hook_filter->nr_filters++] = kset->filter;
8164 }
8165 return 0;
8166 end:
8167 btf_free_kfunc_set_tab(btf);
8168 return ret;
8169 }
8170
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-11-12 15:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-12 12:48 [PATCH v4 bpf-next 00/17] Add kind layout, CRCs to BTF Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 01/17] btf: add kind layout encoding, crcs to UAPI Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 02/17] libbpf: support kind layout section handling in BTF Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 03/17] libbpf: use kind layout to compute an unknown kind size Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 04/17] libbpf: add kind layout encoding, crc support Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 05/17] libbpf: BTF validation can use kind layout for unknown kinds Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 06/17] btf: support kernel parsing of BTF with kind layout Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 07/17] bpf: add BTF CRC verification where present Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 08/17] bpf: verify base BTF CRC to ensure it matches module BTF Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 09/17] kbuild, bpf: switch to --btf_features, add crc,kind_layout features Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 10/17] bpftool: add BTF dump "format meta" to dump header/metadata Alan Maguire
2023-11-14 5:10 ` Quentin Monnet
2023-11-15 8:45 ` Alan Maguire
2023-11-15 14:51 ` Quentin Monnet
2023-11-16 9:16 ` Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 11/17] bpftool: update doc to describe bpftool btf dump .. format meta Alan Maguire
2023-11-14 5:12 ` Quentin Monnet
2023-11-12 12:48 ` [PATCH v4 bpf-next 12/17] selftests/bpf: test kind encoding/decoding Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 13/17] bpf: support standalone BTF in modules Alan Maguire
2023-11-12 15:35 ` kernel test robot [this message]
2023-11-12 20:00 ` kernel test robot
2023-11-12 12:48 ` [PATCH v4 bpf-next 14/17] kbuild, bpf: allow opt-out from using split BTF for modules Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 15/17] selftests/bpf: generalize module load to support specifying a module name Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 16/17] selftests/bpf: build separate bpf_testmod module with standalone BTF Alan Maguire
2023-11-12 12:48 ` [PATCH v4 bpf-next 17/17] selftests/bpf: update btf_module test to ensure standalone BTF works Alan Maguire
2023-11-14 20:16 ` [PATCH v4 bpf-next 00/17] Add kind layout, CRCs to BTF Alan Maguire
2023-11-21 19:44 ` Andrii Nakryiko
2023-11-22 17:00 ` Alan Maguire
2023-11-22 17:42 ` Andrii Nakryiko
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=202311122307.bjlq3XJ5-lkp@intel.com \
--to=lkp@intel.com \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=martin.lau@linux.dev \
--cc=masahiroy@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=quentin@isovalent.com \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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