From: Pu Lehui <pulehui@huaweicloud.com>
To: patchwork-bot+netdevbpf@kernel.org
Cc: bpf@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, bjorn@kernel.org, ast@kernel.org,
daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com,
martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
haoluo@google.com, jolsa@kernel.org, puranjay@kernel.org,
pjw@kernel.org, palmer@dabbelt.com, alex@ghiti.fr,
pulehui@huawei.com
Subject: Re: [PATCH bpf-next v6 0/7] Mixing bpf2bpf and tailcalls for RV64
Date: Wed, 22 Jul 2026 11:05:04 +0800 [thread overview]
Message-ID: <ee25c5b9-97fb-409a-8529-e8689babb44f@huaweicloud.com> (raw)
In-Reply-To: <178465861815.931197.16356281577887013283.git-patchwork-notify@kernel.org>
On 2026/7/22 2:30, patchwork-bot+netdevbpf@kernel.org wrote:
> Hello:
>
> This series was applied to bpf/bpf-next.git (master)
> by Kumar Kartikeya Dwivedi <memxor@gmail.com>:
>
> On Wed, 8 Jul 2026 06:44:29 +0000 you wrote:
>> In the current RV64 JIT, if we just don't initialize the TCC in subprog,
>> the TCC can be propagated from the parent process to the subprocess, but
>> the updated TCC of the parent process cannot be restored when the
>> subprocess exits. Since the RV64 TCC is initialized before saving the
>> callee saved registers into the stack, we cannot use the callee saved
>> register to pass the TCC, otherwise the original value of the callee
>> saved register will be destroyed. So we implemented mixing bpf2bpf and
>> tailcalls similar to x86_64, i.e. using a non-callee saved register to
>> transfer the TCC between functions, and saving that register to the
>> stack to protect the TCC value. As for the tailcall hierarchy issue,
>> inspired by the s390's low-overhead approach, we store TCC from
>> RV_REG_TCC back to stack after calling bpf2bpf call or calling orig bpf
>> func in bpf trampoline.
>>
>> [...]
>
> Here is the summary with links:
> - [bpf-next,v6,1/7] bpf: Extract the is_struct_ops_tramp helper
> https://git.kernel.org/bpf/bpf-next/c/6bcecae4b65d
> - [bpf-next,v6,2/7] riscv, bpf: Fix memory leak in bpf_jit_free
> https://git.kernel.org/bpf/bpf-next/c/369e4635d048
> - [bpf-next,v6,3/7] riscv, bpf: Using kvzalloc_objs to allocate cache buffer
> https://git.kernel.org/bpf/bpf-next/c/f3ab878594b5
> - [bpf-next,v6,4/7] riscv, bpf: Fix kernel stack corruption in tailcall with CFI
> https://git.kernel.org/bpf/bpf-next/c/52fb1756ea1d
> - [bpf-next,v6,5/7] riscv, bpf: Add RV_TAILCALL_OFFSET macro to format tailcall offset
> https://git.kernel.org/bpf/bpf-next/c/a21731f54cfe
> - [bpf-next,v6,6/7] riscv, bpf: Mixing bpf2bpf and tailcalls
> https://git.kernel.org/bpf/bpf-next/c/ec72848ca0ad
> - [bpf-next,v6,7/7] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64
> https://git.kernel.org/bpf/bpf-next/c/683ed8b78c1d
>
> You are awesome, thank you!
Finally got this covered, what a long journey...
But it looks like bpf selftests in riscv is pretty unhappy now.😅
If anyone has some spare cycles, it'd be awesome if we could figure
these out together.:)
prev parent reply other threads:[~2026-07-22 3:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 6:44 Pu Lehui
2026-07-08 6:44 ` [PATCH bpf-next v6 1/7] bpf: Extract the is_struct_ops_tramp helper Pu Lehui
2026-07-08 6:44 ` [PATCH bpf-next v6 2/7] riscv, bpf: Fix memory leak in bpf_jit_free Pu Lehui
2026-07-08 6:44 ` [PATCH bpf-next v6 3/7] riscv, bpf: Using kvzalloc_objs to allocate cache buffer Pu Lehui
2026-07-08 6:44 ` [PATCH bpf-next v6 4/7] riscv, bpf: Fix kernel stack corruption in tailcall with CFI Pu Lehui
2026-07-08 6:44 ` [PATCH bpf-next v6 5/7] riscv, bpf: Add RV_TAILCALL_OFFSET macro to format tailcall offset Pu Lehui
2026-07-08 6:44 ` [PATCH bpf-next v6 6/7] riscv, bpf: Mixing bpf2bpf and tailcalls Pu Lehui
2026-07-08 7:35 ` bot+bpf-ci
2026-07-08 8:54 ` Pu Lehui
2026-07-09 11:37 ` Björn Töpel
2026-07-09 15:09 ` Pu Lehui
2026-07-09 19:51 ` Björn Töpel
2026-07-10 0:53 ` Pu Lehui
2026-07-10 9:43 ` Daniel Borkmann
2026-07-17 7:37 ` Pu Lehui
2026-07-20 14:24 ` Kumar Kartikeya Dwivedi
2026-07-21 18:12 ` Björn Töpel
2026-07-08 6:44 ` [PATCH bpf-next v6 7/7] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64 Pu Lehui
2026-07-21 18:30 ` [PATCH bpf-next v6 0/7] Mixing bpf2bpf and tailcalls for RV64 patchwork-bot+netdevbpf
2026-07-22 3:05 ` Pu Lehui [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=ee25c5b9-97fb-409a-8529-e8689babb44f@huaweicloud.com \
--to=pulehui@huaweicloud.com \
--cc=alex@ghiti.fr \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=martin.lau@linux.dev \
--cc=palmer@dabbelt.com \
--cc=patchwork-bot+netdevbpf@kernel.org \
--cc=pjw@kernel.org \
--cc=pulehui@huawei.com \
--cc=puranjay@kernel.org \
--cc=sdf@fomichev.me \
--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
all inboxes | Powered by JetHome®