From: sashiko-bot@kernel.org
To: "Pu Lehui" <pulehui@huaweicloud.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next] riscv, bpf: Fix missing sign-ext for signed 1-byte and 2-byte kfunc args
Date: Fri, 14 Aug 2026 06:57:33 +0000 [thread overview]
Message-ID: <20260814065737.D1B361F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260814064726.3607615-1-pulehui@huaweicloud.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch introduces a call to a `sign_extend()` function that is undeclared and undefined, resulting in a compilation failure.
--
--- Patch [1]: [PATCH bpf-next] riscv, bpf: Fix missing sign-ext for signed 1-byte and 2-byte kfunc args ---
commit 47567ad8c96e02d677f1ae5123565efa9cf1b55f
Author: Pu Lehui <pulehui@huawei.com>
riscv, bpf: Fix missing sign-ext for signed 1-byte and 2-byte kfunc args
This commit updates the RISC-V BPF JIT to sign-extend 1-byte and 2-byte
kfunc arguments as required by the RV64 ABI. This addresses an issue exposed
by recent state pruning liveness analysis changes.
> diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c
> index 10e01ff06312d..0c6de02eb33a8 100644
> --- a/arch/riscv/net/bpf_jit_comp64.c
> +++ b/arch/riscv/net/bpf_jit_comp64.c
> @@ -1784,9 +1784,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
>
> for (idx = 0; idx < fm->nr_args; idx++) {
> u8 reg = bpf_to_rv_reg(BPF_REG_1 + idx, ctx);
> + bool sign = fm->arg_flags[idx] & BTF_FMODEL_SIGNED_ARG;
>
> - if (fm->arg_size[idx] == sizeof(int))
> - emit_sextw(reg, reg, ctx);
> + if (sign_extend(reg, reg, fm->arg_size[idx], sign, ctx))
> + return -EINVAL;
[Severity: Low]
Is sign_extend() declared in this context?
It appears this function might be missing from this file or requires an
unapplied prerequisite patch. Looking through the source, there doesn't
appear to be a sign_extend() function defined in the RISC-V BPF JIT code
that matches this 5-argument signature. Will this cause a build failure due
to an undeclared function?
> }
> }
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260814064726.3607615-1-pulehui@huaweicloud.com?part=1
next prev parent reply other threads:[~2026-08-14 6:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 6:47 [PATCH bpf-next] riscv, bpf: Fix missing sign-ext for signed 1-byte and 2-byte kfunc args Pu Lehui
2026-08-14 6:57 ` sashiko-bot [this message]
2026-08-14 7:05 ` Pu Lehui
2026-08-14 16:40 ` patchwork-bot+netdevbpf
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=20260814065737.D1B361F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=pulehui@huaweicloud.com \
--cc=sashiko-reviews@lists.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