riscv, bpf: Fix incorrect runtime stats
authorXu Kuohai <xukuohai@huawei.com>
Tue, 16 Apr 2024 06:42:08 +0000 (14:42 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 16 Apr 2024 15:19:41 +0000 (17:19 +0200)
commit10541b374aa05c8118cc6a529a615882e53f261b
tree59373141f5538e6004c743c0a6c0493ce6b7ca79
parentdc7d7447b56bcc9cf79a9c22e4edad200a298e4c
riscv, bpf: Fix incorrect runtime stats

When __bpf_prog_enter() returns zero, the s1 register is not set to zero,
resulting in incorrect runtime stats. Fix it by setting s1 immediately upon
the return of __bpf_prog_enter().

Fixes: 49b5e77ae3e2 ("riscv, bpf: Add bpf trampoline support for RV64")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Pu Lehui <pulehui@huawei.com>
Acked-by: Björn Töpel <bjorn@kernel.org>
Link: https://lore.kernel.org/bpf/20240416064208.2919073-3-xukuohai@huaweicloud.com
arch/riscv/net/bpf_jit_comp64.c