From: Martin KaFai Lau <martin.lau@linux.dev>
To: Amery Hung <ameryhung@gmail.com>
Cc: daniel@iogearbox.net, andrii@kernel.org,
alexei.starovoitov@gmail.com, martin.lau@kernel.org,
eddyz87@gmail.com, kernel-team@meta.com, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 2/2] selftests/bpf: Test gen_pro/epilogue that generate kfuncs
Date: Tue, 25 Feb 2025 12:53:31 -0800 [thread overview]
Message-ID: <a53a4ae7-304c-4409-a273-09b85ac65b68@linux.dev> (raw)
In-Reply-To: <20250221164721.1794729-2-ameryhung@gmail.com>
On 2/21/25 8:47 AM, Amery Hung wrote:
> +static int st_ops_gen_epilogue_with_kfunc(struct bpf_insn *insn_buf, const struct bpf_prog *prog,
> + s16 ctx_stack_off)
> +{
> + struct bpf_insn *insn = insn_buf;
> +
> + /* r1 = 0;
> + * r0 = bpf_cgroup_from_id(r1);
> + * if r0 != 0 goto pc+6;
> + * r1 = stack[ctx_stack_off]; // r1 will be "u64 *ctx"
> + * r1 = r1[0]; // r1 will be "struct st_ops *args"
> + * r6 = r1->a;
> + * r6 += 10000;
> + * r1->a = r6;
> + * goto pc+2
> + * r1 = r0;
> + * bpf_cgroup_release(r1);
> + * r0 = r6;
I think r6 is not initialized on the "r0 != 0" case.
Others lgtm.
next prev parent reply other threads:[~2025-02-25 20:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 16:47 [PATCH bpf-next v3 1/2] bpf: Search and add kfuncs in struct_ops prologue and epilogue Amery Hung
2025-02-21 16:47 ` [PATCH bpf-next v3 2/2] selftests/bpf: Test gen_pro/epilogue that generate kfuncs Amery Hung
2025-02-25 20:53 ` Martin KaFai Lau [this message]
2025-02-25 21:12 ` Amery Hung
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=a53a4ae7-304c-4409-a273-09b85ac65b68@linux.dev \
--to=martin.lau@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
/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