From patchwork Mon Nov 15 19:18:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12620927 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B25EBC433EF for ; Tue, 16 Nov 2021 00:27:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D69F619E8 for ; Tue, 16 Nov 2021 00:27:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349305AbhKPAaj (ORCPT ); Mon, 15 Nov 2021 19:30:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232503AbhKOTaA (ORCPT ); Mon, 15 Nov 2021 14:30:00 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8F19C06120C for ; Mon, 15 Nov 2021 11:18:49 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id r5so9514502pgi.6 for ; Mon, 15 Nov 2021 11:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7M7FIkw4xCHWvU18lhKXQJCKfukAcHTRUhan1PsbW/Q=; b=T1xuQ+uuD5FKrXHy+6Ul5+64EqeZFSXeFrYQOHEDJ0WMFXsPzZw8TA5H3oeZVjcoyx SkovVtY10eYK3XQGlPqYMe+Kwi+ljuQ00zpC1zFwMy5nXUcul81mMxg1trfhwaG4zC5F vzqFnXfLjc1tlCbEObfjR+dNwxkjsY1smFwMSJ6GbER5CX7PET6/GYLqD1ZPobqo+gmP D0sjMltC6argMwI8Z0EIspNqPnKsFal6h9YRcEHT/nScTPpC7gFHSCdIddDFKsUuymGo WhLvFTwVOPDJJxhAsZcYPmw1iq8Ew/nBFnQ2PoljgXCdgmmqNcJvuai9Cr4KtR0h9Pt2 NFUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7M7FIkw4xCHWvU18lhKXQJCKfukAcHTRUhan1PsbW/Q=; b=ZQ1m7W1lcuJcdTz13+Pj6iRGRZOOkT0IosyPwxKAEmgJDkK5AJnIadqpTkQ5F3Djbc Vgy1MdhP73u4LFwSN+M3WHt9mDHDSBFxbGiWNrcYbFN5JMBxjKx/jhrXEFcH/k8Onhco zA0vVo/X03gZVCYlZXBszAueqli7forECcC08S9eTuLFvZXnIFpvSeMfVzkGJWFi02po 9blgg7XpiQlC3DUCDH6iuii+2G69jJR5//xuN7nnhY86KlfY116r73/aUuE54FHtUdvi vrpP+sIwfNJW8EJZCwFTJkRHdHMPbzomVL+fORKmfoIyAiDIj9V9iESWq+GL1TvzRPkv JW/g== X-Gm-Message-State: AOAM533dHodxY6yeQvYPmjrjOU0wuKJwzPq6J1IubQPgh4mGx2N7Ohlc 8emufM+uvTsDyG8EAM1/h3nT7s+ReJ8= X-Google-Smtp-Source: ABdhPJy8lYj1hAvUg3X0Mw15jRT6C+84K3+8NuXCKD9WCb6ceNbxt12tFJ55/dMeYQDBAHTesEQ+xg== X-Received: by 2002:a05:6a00:234f:b0:3eb:3ffd:6da2 with SMTP id j15-20020a056a00234f00b003eb3ffd6da2mr34867984pfj.15.1637003929008; Mon, 15 Nov 2021 11:18:49 -0800 (PST) Received: from localhost ([2405:201:6014:d064:502e:73f4:8af1:9522]) by smtp.gmail.com with ESMTPSA id d21sm1138672pfu.52.2021.11.15.11.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 11:18:48 -0800 (PST) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Vinicius Costa Gomes , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann Subject: [PATCH bpf v1 1/3] bpf: Make CONFIG_DEBUG_INFO_BTF depend upon CONFIG_BPF_SYSCALL Date: Tue, 16 Nov 2021 00:48:38 +0530 Message-Id: <20211115191840.496263-2-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115191840.496263-1-memxor@gmail.com> References: <20211115191840.496263-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4223; h=from:subject; bh=f6QOkxkZ7BNFTA6nheRnBYBiocEQj+ELUmnK0PDqBC8=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhkrI2NN1ewITG6TVKeciu+xJmSo0qOONLncG7ws21 DwostZmJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYZKyNgAKCRBM4MiGSL8Rys3sD/ 9CfhRPO3QqdEYNiRl4ZQCOLvdZRaljmeIjdldHYPABEEuxQyB51/bGX30OuraqIiQtpSwPjPEHfpre GfMa+lFqT9Ky9a4GuJ+pU7t9o2FsJOPps0b82g19rslDmfVoes7lJnQE92MFdX1TibVqRb+sJKLtB2 AiGIK1ubMD6CEk+lP3OHOHsddoLrylTLiWpc8+ebbo19XpE8TejL5G89QzvVXEa08QQb/cQ1sExJod xPda/hf+W8T1CTeQaNRK15EzPyhav1Jef3mdKwBAWPk2hVOujEHJtD2Q44m3jgbGb3/Rf4EF0y3vro bUWnDUNEIV6AnbOT0WsV7a6CGfUNwAPB4K+4laCeCdIsjuTQa4yEEa7BBxT6wdumd1AqluFiSw2W10 9OmpjMetBNHiPaU6TCmbWdv4jBnMbaYk40h/O+3IPKnaUZBzMlhYv7B3BGaPw1uguEXyzb/apdxTHo YTcTz5XbATbw9JuKEHvx6y2gxHTEnJgIlUoUUDe6QShk1qDWApY3Xiz+uqIQpwF++3FNnwZV0UKmvf dFnnrbhC3wfw9sqBVs8XdZslX9tY5QBOgllj3EaQWH+NFjYfREqJ7MitXIemLlHOu/ISGYR/5I7a9j u1q0XhirD0ULCrnlb4xTBQwr2w/BLpBvvbGLsZVYdUnRN1bLGax1MQUATHxw== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Vinicius Costa Gomes reported [0] that build fails when CONFIG_DEBUG_INFO_BTF is enabled and CONFIG_BPF_SYSCALL is disabled. This leads to btf.c not being compiled, and then no symbol being present in vmlinux for the declarations in btf.h. Since BTF is not useful without enabling BPF subsystem, disallow this combination. However, theoretically disabling both now could still fail, as the symbol for kfunc_btf_id_list variables is not available. This isn't a problem as the compiler usually optimizes the whole register/unregister call, but at lower optimization levels it can fail the build in linking stage. Fix that by adding dummy variables so that modules taking address of them still work, but the whole thing is a noop. [0]: https://lore.kernel.org/bpf/20211110205418.332403-1-vinicius.gomes@intel.com Fixes: 14f267d95fe4 ("bpf: btf: Introduce helpers for dynamic BTF set registration") Reported-by: Vinicius Costa Gomes Signed-off-by: Kumar Kartikeya Dwivedi --- include/linux/btf.h | 14 ++++++++++---- kernel/bpf/btf.c | 9 ++------- lib/Kconfig.debug | 1 + 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/linux/btf.h b/include/linux/btf.h index 203eef993d76..0e1b6281fd8f 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -245,7 +245,10 @@ struct kfunc_btf_id_set { struct module *owner; }; -struct kfunc_btf_id_list; +struct kfunc_btf_id_list { + struct list_head list; + struct mutex mutex; +}; #ifdef CONFIG_DEBUG_INFO_BTF_MODULES void register_kfunc_btf_id_set(struct kfunc_btf_id_list *l, @@ -254,6 +257,9 @@ void unregister_kfunc_btf_id_set(struct kfunc_btf_id_list *l, struct kfunc_btf_id_set *s); bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, u32 kfunc_id, struct module *owner); + +extern struct kfunc_btf_id_list bpf_tcp_ca_kfunc_list; +extern struct kfunc_btf_id_list prog_test_kfunc_list; #else static inline void register_kfunc_btf_id_set(struct kfunc_btf_id_list *l, struct kfunc_btf_id_set *s) @@ -268,13 +274,13 @@ static inline bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, { return false; } + +static struct kfunc_btf_id_list bpf_tcp_ca_kfunc_list __maybe_unused; +static struct kfunc_btf_id_list prog_test_kfunc_list __maybe_unused; #endif #define DEFINE_KFUNC_BTF_ID_SET(set, name) \ struct kfunc_btf_id_set name = { LIST_HEAD_INIT(name.list), (set), \ THIS_MODULE } -extern struct kfunc_btf_id_list bpf_tcp_ca_kfunc_list; -extern struct kfunc_btf_id_list prog_test_kfunc_list; - #endif diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 6b9d23be1e99..3ace85d496ae 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -6361,11 +6361,6 @@ BTF_TRACING_TYPE_xxx /* BTF ID set registration API for modules */ -struct kfunc_btf_id_list { - struct list_head list; - struct mutex mutex; -}; - #ifdef CONFIG_DEBUG_INFO_BTF_MODULES void register_kfunc_btf_id_set(struct kfunc_btf_id_list *l, @@ -6404,8 +6399,6 @@ bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, u32 kfunc_id, return false; } -#endif - #define DEFINE_KFUNC_BTF_ID_LIST(name) \ struct kfunc_btf_id_list name = { LIST_HEAD_INIT(name.list), \ __MUTEX_INITIALIZER(name.mutex) }; \ @@ -6413,3 +6406,5 @@ bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, u32 kfunc_id, DEFINE_KFUNC_BTF_ID_LIST(bpf_tcp_ca_kfunc_list); DEFINE_KFUNC_BTF_ID_LIST(prog_test_kfunc_list); + +#endif diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 6fdbf9613aec..eae860c86e26 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -316,6 +316,7 @@ config DEBUG_INFO_BTF bool "Generate BTF typeinfo" depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST + depends on BPF_SYSCALL help Generate deduplicated BTF type information from DWARF debug info. Turning this on expects presence of pahole tool, which will convert From patchwork Mon Nov 15 19:18:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12620929 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88E6DC433F5 for ; Tue, 16 Nov 2021 00:27:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 716FA619E8 for ; Tue, 16 Nov 2021 00:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349446AbhKPAaj (ORCPT ); Mon, 15 Nov 2021 19:30:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236321AbhKOTaA (ORCPT ); Mon, 15 Nov 2021 14:30:00 -0500 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F3EC061220 for ; Mon, 15 Nov 2021 11:18:53 -0800 (PST) Received: by mail-pj1-x1043.google.com with SMTP id p18-20020a17090ad31200b001a78bb52876so81202pju.3 for ; Mon, 15 Nov 2021 11:18:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7MZPPjPZFUBNCsMLqWiJT2pCHT/Qm/4xh1xJ07l2ke0=; b=g8KmNU4GQ1ZHepyPOgz6HjVSZBogZcQ1byVNuYL0qw/hxgDMkho8cRajdxE25Fb+JB elEWHDXKOsE0w4E7dLI2CaiXLeEv9FOsn5BmcquDQKE4EER4aBtWmTbQaHSopkgSusIx Ts6R/duXs6mNC0A5InHGSYj4hGuKGE8MjrFXCpns8UcW6zqyQEGvykQQvICxK9qw6R9A gLC6Ec7zmKu2zj/YzcmF/Kfu/ID+z8JBMdwH2DkRNqR3admBfbVW7Nwazz2z6LCoLvDd S09Z09DcWSCYLMHiUIpNE9tAvhA6RKB+wLYst664NWID1H/KYa1tsXMCFR7GZ9qn6wps dAXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7MZPPjPZFUBNCsMLqWiJT2pCHT/Qm/4xh1xJ07l2ke0=; b=4mc40AjOJXlS/xt7dd21z7tfZQ89XR1Bf/Xb0hck7fHfDqd+G+8yyB1GjlD08hq8ri UNbseJJssxerQ+xx0ihi0KXqqqBz8u10kiMsQJRZfe6jzKzTGce2Mx1EHGklFIqYXNaC edaHHh85/3y15RV1WnZArClGPNfwQdE3A7nKDJSdraUOCqJKim3FaZ7LzBbBozHXoxzi /rDG3INzrDmadYcit257RMUXR53a4dL1JZp1twG9lHn1twbiwZrjCDB82kN5JOReZ3wD q0hEJEcVM+FPsNOim7l3mTdBxGIrZPhgM5RgsF3PvI4Oknz1h0Hcci7i2tEc3h0CUfXu nWVA== X-Gm-Message-State: AOAM531rpnqnrGT+7L8Lt8Z5Teg6tp12DOOPPlGai6LPVKzWhLld+Qo/ 4IQrGp3YEJMKNBbUSAO+pOClkPZOodY= X-Google-Smtp-Source: ABdhPJxDOp5eUd8vtUHlgZnlADyYZ6uVYh0k6Zqs0CPQ+9WAzz4/3EEVo2QQM0Gh5uUCoTgWcs93CA== X-Received: by 2002:a17:903:120c:b0:143:a512:e608 with SMTP id l12-20020a170903120c00b00143a512e608mr36039224plh.21.1637003932430; Mon, 15 Nov 2021 11:18:52 -0800 (PST) Received: from localhost ([2405:201:6014:d064:502e:73f4:8af1:9522]) by smtp.gmail.com with ESMTPSA id na15sm122726pjb.31.2021.11.15.11.18.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 11:18:52 -0800 (PST) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann Subject: [PATCH bpf v1 2/3] bpf: Fix bpf_check_mod_kfunc_call for built-in modules Date: Tue, 16 Nov 2021 00:48:39 +0530 Message-Id: <20211115191840.496263-3-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115191840.496263-1-memxor@gmail.com> References: <20211115191840.496263-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=809; h=from:subject; bh=vmL3kw2QHlmGaggy5v7m3WRcFMAkoH2EedmKHt88Lq4=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhkrI2N+aovIoBzw3zhKxZVtlRIgIMoqf8TXl7YuA0 ieisSliJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYZKyNgAKCRBM4MiGSL8RyhzaD/ wLo57MXBQ2jfzrKZGMhyN/rumbPBdpIYu8Z8+QgQa3+KoHhYX5injN7smArEa2M3K1EjYimwUByO5Q 7bMbg+IDOKd8wkxXu4CSvW+8IWCLz6SDjx7ZDtH5SxRURIzEyiqfke8eU2wiyz2WHx/IbG11VYdvki 10RN+UT9XYyM7tQBWBuZHUUXegs67sYR+PIMwB70o85kJWINLN/G1XjQ/fQgJS2eHpYmxaEg14K4dI iI1GZNMic4D6U1qIvgSoecOlmCxdFfLNjgd4SJB9M6JsUAv3UhCQThF/DRFbwh/m/IY4Yy/kHpGURD qOnTZMQcAQTFwKYdUY6CD5VtYGuwmF4yx280K88MTn1agXxH2SQFpvoTV9RvrlqY1wXq4VIsqM3/A5 1O2azPlWTT9OctQFnBVBfhiB0wjjV6oHcJwaSGi8AtEYcz7UOOYmfN9+hwHyewQwQado6ZXMLT/it7 mvSodo19TvbyYrAXMGBWgzCe0BBtBtdU7Pyy1zlbWX+DsZGuH04b+WNdY5SkUfA0kesaAC4kwxOUqk nnZCWv2g5wzn5blDNf69VFAm7i5jdO32jwNVesONYdBxxTg3SYsa6vRiFWlYN906NqYZPer9Ukd1Zt 2ZC72E5cqIzl6YsXcVASlPuqeHqErvix7L4XqU54j/DaEo7zv5KDA8Txuw3Q== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net When module registering its set is built-in, THIS_MODULE will be NULL, hence we cannot return early in case owner is NULL. Fixes: 14f267d95fe4 ("bpf: btf: Introduce helpers for dynamic BTF set registration") Signed-off-by: Kumar Kartikeya Dwivedi --- kernel/bpf/btf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 3ace85d496ae..48cdf5b425a7 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -6386,8 +6386,6 @@ bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, u32 kfunc_id, { struct kfunc_btf_id_set *s; - if (!owner) - return false; mutex_lock(&klist->mutex); list_for_each_entry(s, &klist->list, list) { if (s->owner == owner && btf_id_set_contains(s->set, kfunc_id)) { From patchwork Mon Nov 15 19:18:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12620923 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 989CDC433EF for ; Tue, 16 Nov 2021 00:27:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 833F3619E8 for ; Tue, 16 Nov 2021 00:27:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348857AbhKPAag (ORCPT ); Mon, 15 Nov 2021 19:30:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238597AbhKOTaN (ORCPT ); Mon, 15 Nov 2021 14:30:13 -0500 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AE1FC061224 for ; Mon, 15 Nov 2021 11:18:56 -0800 (PST) Received: by mail-pj1-x1042.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so686153pjb.1 for ; Mon, 15 Nov 2021 11:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PB5GUFs5f+m2nVEY35YykB5F9U2TeFXf/TB4jp9nzJQ=; b=D7VdecOC+cJezG5p7C6xtYxueS6mvn4xFOVUnK+jnReCLBdCMsVGba+ON3vqoh6vgJ kQUkZ24fwyN5t1uoL0+0s32hLF7sZ8dAimaj+ic3iqcsJzUhY1lJ3if35chqYD9scF/m 9E3Hu6tpb/Fu2Tn67srFFdPPSOCzlTQZIzuzmlHPaF2GV3B7cbTag94PpeHyjvcun5vn mloVDrIq6X/HbqKtWwtBACsWPGxIcGpZ8eLQJrUwTdc0zhTsquislclyEQnh/lowWTKt 2ZcBFPChmUgt3k0JOZ3kFBFXYR+Z0vCi7I0x7RdJMNDAo4B/ZpkIPvzLEG1gzU8/eoeQ 2p5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PB5GUFs5f+m2nVEY35YykB5F9U2TeFXf/TB4jp9nzJQ=; b=GEYoup5iju0gNC3xFi5IV3Y371opczRe8t0tM97xuHvT8fSRqJLqTxt0tHifGKQdFF bQxRp3SwqPhMAJy/+HE8q2xau76BszHfuHN6MhENZc0088GBBUST8NoL4qns282MBpHt V8xUIOJCZqUZ6oBYpon6QYiQLZDlFhc7m6O56lgCIiZM7wT4DcAlsBriteTZkLFVJQec Nqv97PGu2/FFP7XoaddEoBmeqt42R9XEjaK19vqTq8tfoaznxe4GntD24M5Nf7G+2Xiu Vt6mL0trvObC4HBQNj/FkrmW9jq12Ob/toG/C8tTDVEI3hddtmpcQUc2OBgqhHGzqUUw PzDQ== X-Gm-Message-State: AOAM532wqORiVhBoP59lJA8SgKyEC5ytIMYkWu696H8x4dBBQobC3tmL A6agzCXSRdf3yDb7GEBeA2lDh87R+Ms= X-Google-Smtp-Source: ABdhPJwBy7ClxT6uoose4uzZr8owAW0WASdoKYcT8ko2VHi7Bf5iCHEaauHD7ldxMx61LXYM8aRlqg== X-Received: by 2002:a17:90a:e506:: with SMTP id t6mr1102891pjy.9.1637003935676; Mon, 15 Nov 2021 11:18:55 -0800 (PST) Received: from localhost ([2405:201:6014:d064:502e:73f4:8af1:9522]) by smtp.gmail.com with ESMTPSA id on6sm111462pjb.47.2021.11.15.11.18.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 11:18:55 -0800 (PST) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Pavel Skripkin , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann Subject: [PATCH bpf v1 3/3] tools/resolve_btfids: Demote unresolved symbol message to debug Date: Tue, 16 Nov 2021 00:48:40 +0530 Message-Id: <20211115191840.496263-4-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115191840.496263-1-memxor@gmail.com> References: <20211115191840.496263-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1208; h=from:subject; bh=5zKu8YbLk2/tQC2/IPEz36iS/1TQBcHMJEOqg0OClAg=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhkrI2thqzTsu5si1jp+oNh+7smaM+3APoRJnr2xPo JqmtIDOJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYZKyNgAKCRBM4MiGSL8RyhjvD/ 0e6eYj7iw1u2n2ywhjs6AK8S6qBd+Sq+EHRv/+2XNivrMU5Q69e7QfbmWJmZvO6wUpBrqyWulJm7b+ X0wG//hEEqDDwlfqd7+oUJaRz0QsCdCkPHFhFRBubpDgCwF9vmcS/gt6YJA7cyBgmmeimFZk1j2q8+ n8S/YfZd9kbbmQ+NZENE4+3j5j7SwIoRZP3Ddl2V0IyTl3QzdhUKKDBcmn5ULinAowMYAdEM4F6F3v ztKoGfWApWLBAiEWO9HC273fttV84YLzL+Tbpq4YX/c+oOxsB/9Q8iEh+oQTL+vyx3bF+zlQ2thgng 289thkOlegbAogv/W2a4ekFpRE3hwdUoRgyfuQef4pM8oeBrtNIM5bhfNxR7gGv8nZ+vi4en6DrOMt vNrmhPvu7Z9C3ImI1lkIWu+Un2PgP652c326fcLfJsIFoZa5cqLF3apZT8RYIJ3Q2+is4y6fRPsv3b EXsQ2FlA3UWXZr2dSHJ0KgrgzOo26FR99ZDyDCr2EwciccB/3FLPVr4IuFahiTMMp9ms0YTZh460bl /Nz3KnYQMnSGETxXeCRSDUzLoy0PBVARPd9h+XFwq6v/BtS597GZcT+SfXpuyKfEgqems0ENsrtR0Q YOmNqDWown5eR99gPXb7toktT4cZEyvS9cfsoGzDxrWLFGQ/0VVgM0h1O72A== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net resolve_btfids prints a warning when it finds an unresolved symbol, (id == 0) in id_patch. This can be the case for BTF sets that are empty (due to disabled config options), hence printing warnings for certain builds, most recently seen in [0]. Hence, demote the warning to debug log level to avoid build time noise. [0]: https://lore.kernel.org/all/1b99ae14-abb4-d18f-cc6a-d7e523b25542@gmail.com Fixes: 0e32dfc80bae ("bpf: Enable TCP congestion control kfunc from modules") Reported-by: Pavel Skripkin Signed-off-by: Kumar Kartikeya Dwivedi --- tools/bpf/resolve_btfids/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c index a59cb0ee609c..833bfcc9ccf6 100644 --- a/tools/bpf/resolve_btfids/main.c +++ b/tools/bpf/resolve_btfids/main.c @@ -569,7 +569,7 @@ static int id_patch(struct object *obj, struct btf_id *id) int i; if (!id->id) { - pr_err("WARN: resolve_btfids: unresolved symbol %s\n", id->name); + pr_debug("WARN: resolve_btfids: unresolved symbol %s\n", id->name); } for (i = 0; i < id->addr_cnt; i++) {