]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
riscv, bpf: Factor out emit_call for kernel and bpf context
authorPu Lehui <pulehui@huawei.com>
Wed, 15 Feb 2023 13:52:03 +0000 (21:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Oct 2023 21:05:34 +0000 (23:05 +0200)
commit7795592e08189dece5265b752981f3b80f0246e7
treed763416998b03b17ddd7790890e918056c893813
parent58941cc742ca7bc4201feecf9c7ed7724c992384
riscv, bpf: Factor out emit_call for kernel and bpf context

[ Upstream commit 0fd1fd0104954380477353aea29c347e85dff16d ]

The current emit_call function is not suitable for kernel function call as
it store return value to bpf R0 register. We can separate it out for common
use. Meanwhile, simplify judgment logic, that is, fixed function address
can use jal or auipc+jalr, while the unfixed can use only auipc+jalr.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Björn Töpel <bjorn@rivosinc.com>
Acked-by: Björn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/bpf/20230215135205.1411105-3-pulehui@huaweicloud.com
Stable-dep-of: 2f1b0d3d7331 ("riscv, bpf: Sign-extend return values")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/net/bpf_jit_comp64.c