From: Eduard Zingerman <eddyz87@gmail.com>
To: Emil Tsalapatis <emil@etsalapatis.com>, bpf@vger.kernel.org
Cc: andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net,
martin.lau@kernel.org, memxor@gmail.com, song@kernel.org,
yonghong.song@linux.dev
Subject: Re: [PATCH bpf-next v3 2/2] selftests: bpf: Add tests for void global subprogs
Date: Mon, 23 Feb 2026 16:24:34 -0800 [thread overview]
Message-ID: <107f5fd6beb9f561cc759754c1724f7d0ed7ddb4.camel@gmail.com> (raw)
In-Reply-To: <20260223215046.1706110-3-emil@etsalapatis.com>
On Mon, 2026-02-23 at 16:50 -0500, Emil Tsalapatis wrote:
[...]
> diff --git a/tools/testing/selftests/bpf/progs/freplace_void.c b/tools/testing/selftests/bpf/progs/freplace_void.c
> new file mode 100644
> index 000000000000..76707b29dc6a
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/freplace_void.c
> @@ -0,0 +1,14 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <linux/bpf.h>
> +#include <bpf/bpf_helpers.h>
> +
> +volatile int data;
> +
> +SEC("freplace/foo")
> +__weak
Nit: __weak not needed here.
> +void test_freplace_void(struct __sk_buff *skb)
> +{
> + data = 1;
Nit: 'data' is never validated, so there is no point in 'data'
definition and this statement.
> +}
> +
> +char _license[] SEC("license") = "GPL";
> diff --git a/tools/testing/selftests/bpf/progs/test_global_func18.c b/tools/testing/selftests/bpf/progs/test_global_func18.c
> new file mode 100644
> index 000000000000..3dafb0dc2342
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/test_global_func18.c
Nit: I'd put this to verifier_global_subprogs.c
> @@ -0,0 +1,23 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +#include <vmlinux.h>
> +#include <bpf/bpf_helpers.h>
> +#include "bpf_misc.h"
> +
> +__weak
> +void foo(void)
> +{
> +}
> +
> +SEC("tc")
> +__failure __msg("!read_ok")
> +int global_func18(struct __sk_buff *skb)
> +{
> + foo();
> +
> + asm volatile(
> + "r1 = r0;"
> + :::
> + );
> +
> + return 0;
> +}
prev parent reply other threads:[~2026-02-24 0:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 21:50 [PATCH bpf-next v3 0/2] bpf: Allow void return type for global subprogs Emil Tsalapatis
2026-02-23 21:50 ` [PATCH bpf-next v3 1/2] bpf: Allow void global functions in the verifier Emil Tsalapatis
2026-02-24 0:09 ` Eduard Zingerman
2026-02-24 18:46 ` Emil Tsalapatis
2026-02-24 19:02 ` Eduard Zingerman
2026-02-24 19:53 ` Emil Tsalapatis
2026-02-24 20:33 ` Eduard Zingerman
2026-02-25 0:55 ` Emil Tsalapatis
2026-02-23 21:50 ` [PATCH bpf-next v3 2/2] selftests: bpf: Add tests for void global subprogs Emil Tsalapatis
2026-02-24 0:24 ` Eduard Zingerman [this message]
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=107f5fd6beb9f561cc759754c1724f7d0ed7ddb4.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=emil@etsalapatis.com \
--cc=martin.lau@kernel.org \
--cc=memxor@gmail.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