All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: bpf <bpf@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <kafai@fb.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>
Subject: Re: [PATCH net v2] bpf: Fix build when CONFIG_BPF_SYSCALL is disabled
Date: Wed, 10 Nov 2021 15:51:53 -0800	[thread overview]
Message-ID: <878rxvbmcm.fsf@intel.com> (raw)
In-Reply-To: <CAADnVQKqjLM1P7X+iTfnH-QFw5=z5L_w8MLsWtcNWbh5QR7VVg@mail.gmail.com>

Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:

>> Thanks for the fix.
>>
>> But instead of moving this to core.c, you can probably make the btf.h
>> declaration conditional on CONFIG_BPF_SYSCALL, since this is not useful in
>> isolation (only used by verifier for module kfunc support). For the case of
>> kfunc_btf_id_list variables, just define it as an empty struct and static
>> variables, since the definition is still inside btf.c. So it becomes a noop for
>> !CONFIG_BPF_SYSCALL.
>>
>> I am also not sure whether BTF is useful without BPF support, but maybe I'm
>> missing some usecase.
>
> Unlikely. I would just disallow such config instead of sprinkling
> the code with ifdefs.

Is something like this what you have in mind?

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


Cheers,
-- 
Vinicius

  reply	other threads:[~2021-11-10 23:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 20:54 [PATCH net v2] bpf: Fix build when CONFIG_BPF_SYSCALL is disabled Vinicius Costa Gomes
2021-11-10 21:25 ` Kumar Kartikeya Dwivedi
2021-11-10 21:59   ` Alexei Starovoitov
2021-11-10 23:51     ` Vinicius Costa Gomes [this message]
2021-11-11  0:13       ` Kumar Kartikeya Dwivedi
2021-11-11  2:04         ` Vinicius Costa Gomes
2021-11-11  2:11           ` Kumar Kartikeya Dwivedi
2021-11-10 23:10   ` Vinicius Costa Gomes

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=878rxvbmcm.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.