All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] BPF: Include missing nospec.h to avoid build error
@ 2023-02-22  2:50 Huacai Chen
  2023-02-22  5:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 4+ messages in thread
From: Huacai Chen @ 2023-02-22  2:50 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, John Fastabend
  Cc: bpf, Xuefeng Li, Tiezhu Yang, Huacai Chen, Huacai Chen

Commit 74e19ef0ff8061ef55957c3a ("uaccess: Add speculation barrier to
copy_from_user()") defines a default barrier_nospec() and removes the
#ifdefs in kernel/bpf/core.c, but doesn't include nospec.h, which causes
such a build error:

  CC      kernel/bpf/core.o
kernel/bpf/core.c: In function ‘___bpf_prog_run’:
kernel/bpf/core.c:1913:3: error: implicit declaration of function ‘barrier_nospec’; did you mean ‘barrier_data’? [-Werror=implicit-function-declaration]
   barrier_nospec();
   ^~~~~~~~~~~~~~
   barrier_data
cc1: some warnings being treated as errors

So include nospec.h to avoid the build error.

Fixes: 74e19ef0ff8061ef55957c3a ("uaccess: Add speculation barrier to copy_from_user()")
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 kernel/bpf/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 430c66d59ec7..f9c3b1033ec3 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -34,6 +34,7 @@
 #include <linux/log2.h>
 #include <linux/bpf_verifier.h>
 #include <linux/nodemask.h>
+#include <linux/nospec.h>
 #include <linux/bpf_mem_alloc.h>
 
 #include <asm/barrier.h>
-- 
2.39.1


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

* Re: [PATCH] BPF: Include missing nospec.h to avoid build error
  2023-02-22  2:50 [PATCH] BPF: Include missing nospec.h to avoid build error Huacai Chen
@ 2023-02-22  5:10 ` patchwork-bot+netdevbpf
  2023-02-22  6:26   ` Huacai Chen
  0 siblings, 1 reply; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-22  5:10 UTC (permalink / raw)
  To: Huacai Chen
  Cc: ast, daniel, john.fastabend, bpf, lixuefeng, yangtiezhu, chenhuacai

Hello:

This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Wed, 22 Feb 2023 10:50:48 +0800 you wrote:
> Commit 74e19ef0ff8061ef55957c3a ("uaccess: Add speculation barrier to
> copy_from_user()") defines a default barrier_nospec() and removes the
> #ifdefs in kernel/bpf/core.c, but doesn't include nospec.h, which causes
> such a build error:
> 
>   CC      kernel/bpf/core.o
> kernel/bpf/core.c: In function ‘___bpf_prog_run’:
> kernel/bpf/core.c:1913:3: error: implicit declaration of function ‘barrier_nospec’; did you mean ‘barrier_data’? [-Werror=implicit-function-declaration]
>    barrier_nospec();
>    ^~~~~~~~~~~~~~
>    barrier_data
> cc1: some warnings being treated as errors
> 
> [...]

Here is the summary with links:
  - BPF: Include missing nospec.h to avoid build error
    https://git.kernel.org/bpf/bpf/c/345d24a91c79

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] 4+ messages in thread

* Re: [PATCH] BPF: Include missing nospec.h to avoid build error
  2023-02-22  5:10 ` patchwork-bot+netdevbpf
@ 2023-02-22  6:26   ` Huacai Chen
  2023-02-22 16:29     ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: Huacai Chen @ 2023-02-22  6:26 UTC (permalink / raw)
  To: patchwork-bot+netdevbpf
  Cc: Huacai Chen, ast, daniel, john.fastabend, bpf, lixuefeng, yangtiezhu

Oh, I'm sorry but the modified commit message seems broken.

Huacai

On Wed, Feb 22, 2023 at 1:10 PM <patchwork-bot+netdevbpf@kernel.org> wrote:
>
> Hello:
>
> This patch was applied to bpf/bpf.git (master)
> by Alexei Starovoitov <ast@kernel.org>:
>
> On Wed, 22 Feb 2023 10:50:48 +0800 you wrote:
> > Commit 74e19ef0ff8061ef55957c3a ("uaccess: Add speculation barrier to
> > copy_from_user()") defines a default barrier_nospec() and removes the
> > #ifdefs in kernel/bpf/core.c, but doesn't include nospec.h, which causes
> > such a build error:
> >
> >   CC      kernel/bpf/core.o
> > kernel/bpf/core.c: In function ‘___bpf_prog_run’:
> > kernel/bpf/core.c:1913:3: error: implicit declaration of function ‘barrier_nospec’; did you mean ‘barrier_data’? [-Werror=implicit-function-declaration]
> >    barrier_nospec();
> >    ^~~~~~~~~~~~~~
> >    barrier_data
> > cc1: some warnings being treated as errors
> >
> > [...]
>
> Here is the summary with links:
>   - BPF: Include missing nospec.h to avoid build error
>     https://git.kernel.org/bpf/bpf/c/345d24a91c79
>
> 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] 4+ messages in thread

* Re: [PATCH] BPF: Include missing nospec.h to avoid build error
  2023-02-22  6:26   ` Huacai Chen
@ 2023-02-22 16:29     ` Alexei Starovoitov
  0 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2023-02-22 16:29 UTC (permalink / raw)
  To: Huacai Chen
  Cc: patchwork-bot+netdevbpf, Huacai Chen, Alexei Starovoitov,
	Daniel Borkmann, John Fastabend, bpf, Xuefeng Li, Tiezhu Yang

On Tue, Feb 21, 2023 at 10:27 PM Huacai Chen <chenhuacai@gmail.com> wrote:
>
> Oh, I'm sorry but the modified commit message seems broken.

You didn't do it correctly. I fixed it up while applying.

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

end of thread, other threads:[~2023-02-22 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22  2:50 [PATCH] BPF: Include missing nospec.h to avoid build error Huacai Chen
2023-02-22  5:10 ` patchwork-bot+netdevbpf
2023-02-22  6:26   ` Huacai Chen
2023-02-22 16:29     ` Alexei Starovoitov

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.