BPF List
 help / color / mirror / Atom feed
* [PATCH] bpf: fix warning for bpf_cpumask in verifier
@ 2024-02-08 10:01 Hari Bathini
  2024-02-08 19:56 ` Stanislav Fomichev
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Hari Bathini @ 2024-02-08 10:01 UTC (permalink / raw)
  To: bpf; +Cc: void, Alexei Starovoitov, Daniel Borkmann

Compiling with CONFIG_BPF_SYSCALL & !CONFIG_BPF_JIT throws the below
warning:

  "WARN: resolve_btfids: unresolved symbol bpf_cpumask"

Fix it by adding the appropriate #ifdef.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
 kernel/bpf/verifier.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 65f598694d55..b263f093ee76 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -5227,7 +5227,9 @@ BTF_ID(struct, prog_test_ref_kfunc)
 #ifdef CONFIG_CGROUPS
 BTF_ID(struct, cgroup)
 #endif
+#ifdef CONFIG_BPF_JIT
 BTF_ID(struct, bpf_cpumask)
+#endif
 BTF_ID(struct, task_struct)
 BTF_SET_END(rcu_protected_types)
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] bpf: fix warning for bpf_cpumask in verifier
  2024-02-08 10:01 [PATCH] bpf: fix warning for bpf_cpumask in verifier Hari Bathini
@ 2024-02-08 19:56 ` Stanislav Fomichev
  2024-02-12  9:56   ` Hari Bathini
  2024-02-12 11:58 ` Jiri Olsa
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Stanislav Fomichev @ 2024-02-08 19:56 UTC (permalink / raw)
  To: Hari Bathini; +Cc: bpf, void, Alexei Starovoitov, Daniel Borkmann

On 02/08, Hari Bathini wrote:
> Compiling with CONFIG_BPF_SYSCALL & !CONFIG_BPF_JIT throws the below
> warning:
> 
>   "WARN: resolve_btfids: unresolved symbol bpf_cpumask"
> 
> Fix it by adding the appropriate #ifdef.

Can you explain a bit more on why CONFIG_BPF_JIT is appropriate here?
kernel/bpf/cpumask.c seems to be gated by CONFIG_BPF_SYSCALL.
So presumably all those symbols should be still compiled in with !CONFIG_BPF_JIT?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bpf: fix warning for bpf_cpumask in verifier
  2024-02-08 19:56 ` Stanislav Fomichev
@ 2024-02-12  9:56   ` Hari Bathini
  2024-02-12 16:46     ` Stanislav Fomichev
  0 siblings, 1 reply; 7+ messages in thread
From: Hari Bathini @ 2024-02-12  9:56 UTC (permalink / raw)
  To: Stanislav Fomichev; +Cc: bpf, void, Alexei Starovoitov, Daniel Borkmann



On 09/02/24 1:26 am, Stanislav Fomichev wrote:
> On 02/08, Hari Bathini wrote:
>> Compiling with CONFIG_BPF_SYSCALL & !CONFIG_BPF_JIT throws the below
>> warning:
>>
>>    "WARN: resolve_btfids: unresolved symbol bpf_cpumask"
>>
>> Fix it by adding the appropriate #ifdef.
> 
> Can you explain a bit more on why CONFIG_BPF_JIT is appropriate here?
> kernel/bpf/cpumask.c seems to be gated by CONFIG_BPF_SYSCALL.
> So presumably all those symbols should be still compiled in with !CONFIG_BPF_JIT?

Actually, CONFIG_BPF_JIT is the precondition for cpumask.c
where bpf_cpumask structure is defined.

   ifeq ($(CONFIG_BPF_JIT),y)
   obj-$(CONFIG_BPF_SYSCALL) += bpf_struct_ops.o
   obj-$(CONFIG_BPF_SYSCALL) += cpumask.o
   obj-${CONFIG_BPF_LSM} += bpf_lsm.o
   endif

Thanks
Hari

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bpf: fix warning for bpf_cpumask in verifier
  2024-02-08 10:01 [PATCH] bpf: fix warning for bpf_cpumask in verifier Hari Bathini
  2024-02-08 19:56 ` Stanislav Fomichev
@ 2024-02-12 11:58 ` Jiri Olsa
  2024-02-12 16:53 ` David Vernet
  2024-02-13 19:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: Jiri Olsa @ 2024-02-12 11:58 UTC (permalink / raw)
  To: Hari Bathini; +Cc: bpf, void, Alexei Starovoitov, Daniel Borkmann

On Thu, Feb 08, 2024 at 03:31:15PM +0530, Hari Bathini wrote:
> Compiling with CONFIG_BPF_SYSCALL & !CONFIG_BPF_JIT throws the below
> warning:
> 
>   "WARN: resolve_btfids: unresolved symbol bpf_cpumask"
> 
> Fix it by adding the appropriate #ifdef.
> 
> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>

Acked-by: Jiri Olsa <jolsa@kernel.org>

jirka

> ---
>  kernel/bpf/verifier.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 65f598694d55..b263f093ee76 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -5227,7 +5227,9 @@ BTF_ID(struct, prog_test_ref_kfunc)
>  #ifdef CONFIG_CGROUPS
>  BTF_ID(struct, cgroup)
>  #endif
> +#ifdef CONFIG_BPF_JIT
>  BTF_ID(struct, bpf_cpumask)
> +#endif
>  BTF_ID(struct, task_struct)
>  BTF_SET_END(rcu_protected_types)
>  
> -- 
> 2.43.0
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bpf: fix warning for bpf_cpumask in verifier
  2024-02-12  9:56   ` Hari Bathini
@ 2024-02-12 16:46     ` Stanislav Fomichev
  0 siblings, 0 replies; 7+ messages in thread
From: Stanislav Fomichev @ 2024-02-12 16:46 UTC (permalink / raw)
  To: Hari Bathini; +Cc: bpf, void, Alexei Starovoitov, Daniel Borkmann

On Mon, Feb 12, 2024 at 1:56 AM Hari Bathini <hbathini@linux.ibm.com> wrote:
>
>
>
> On 09/02/24 1:26 am, Stanislav Fomichev wrote:
> > On 02/08, Hari Bathini wrote:
> >> Compiling with CONFIG_BPF_SYSCALL & !CONFIG_BPF_JIT throws the below
> >> warning:
> >>
> >>    "WARN: resolve_btfids: unresolved symbol bpf_cpumask"
> >>
> >> Fix it by adding the appropriate #ifdef.
> >
> > Can you explain a bit more on why CONFIG_BPF_JIT is appropriate here?
> > kernel/bpf/cpumask.c seems to be gated by CONFIG_BPF_SYSCALL.
> > So presumably all those symbols should be still compiled in with !CONFIG_BPF_JIT?
>
> Actually, CONFIG_BPF_JIT is the precondition for cpumask.c
> where bpf_cpumask structure is defined.
>
>    ifeq ($(CONFIG_BPF_JIT),y)
>    obj-$(CONFIG_BPF_SYSCALL) += bpf_struct_ops.o
>    obj-$(CONFIG_BPF_SYSCALL) += cpumask.o
>    obj-${CONFIG_BPF_LSM} += bpf_lsm.o
>    endif

Ah, good point!

Acked-by: Stanislav Fomichev <sdf@google.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bpf: fix warning for bpf_cpumask in verifier
  2024-02-08 10:01 [PATCH] bpf: fix warning for bpf_cpumask in verifier Hari Bathini
  2024-02-08 19:56 ` Stanislav Fomichev
  2024-02-12 11:58 ` Jiri Olsa
@ 2024-02-12 16:53 ` David Vernet
  2024-02-13 19:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: David Vernet @ 2024-02-12 16:53 UTC (permalink / raw)
  To: Hari Bathini; +Cc: bpf, Alexei Starovoitov, Daniel Borkmann

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

On Thu, Feb 08, 2024 at 03:31:15PM +0530, Hari Bathini wrote:
> Compiling with CONFIG_BPF_SYSCALL & !CONFIG_BPF_JIT throws the below
> warning:
> 
>   "WARN: resolve_btfids: unresolved symbol bpf_cpumask"
> 
> Fix it by adding the appropriate #ifdef.

Thanks for the fix!

> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>

Acked-by: David Vernet <void@manifault.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bpf: fix warning for bpf_cpumask in verifier
  2024-02-08 10:01 [PATCH] bpf: fix warning for bpf_cpumask in verifier Hari Bathini
                   ` (2 preceding siblings ...)
  2024-02-12 16:53 ` David Vernet
@ 2024-02-13 19:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-13 19:20 UTC (permalink / raw)
  To: Hari Bathini; +Cc: bpf, void, ast, daniel

Hello:

This patch was applied to bpf/bpf.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Thu,  8 Feb 2024 15:31:15 +0530 you wrote:
> Compiling with CONFIG_BPF_SYSCALL & !CONFIG_BPF_JIT throws the below
> warning:
> 
>   "WARN: resolve_btfids: unresolved symbol bpf_cpumask"
> 
> Fix it by adding the appropriate #ifdef.
> 
> [...]

Here is the summary with links:
  - bpf: fix warning for bpf_cpumask in verifier
    https://git.kernel.org/bpf/bpf/c/11f522256e90

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-13 19:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-08 10:01 [PATCH] bpf: fix warning for bpf_cpumask in verifier Hari Bathini
2024-02-08 19:56 ` Stanislav Fomichev
2024-02-12  9:56   ` Hari Bathini
2024-02-12 16:46     ` Stanislav Fomichev
2024-02-12 11:58 ` Jiri Olsa
2024-02-12 16:53 ` David Vernet
2024-02-13 19:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox