[PATCH bpf-next v3] riscv, bpf: Add kfunc support for RV64

Pu Lehui pulehui at huaweicloud.com
Tue Feb 21 06:06:56 PST 2023


From: Pu Lehui <pulehui at huawei.com>

This patch adds kernel function call support for RV64. Since the offset
from RV64 kernel and module functions to bpf programs is almost within
the range of s32, the current infrastructure of RV64 is already
sufficient for kfunc, so let's turn it on.

Suggested-by: Björn Töpel <bjorn at rivosinc.com>
Signed-off-by: Pu Lehui <pulehui at huawei.com>
Acked-by: Björn Töpel <bjorn at rivosinc.com>
---
v3:
- rewrite commit message to make more sense.
- Add Acked-by of Björn.

 arch/riscv/net/bpf_jit_comp64.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c
index f5a668736c79..a9270366dc57 100644
--- a/arch/riscv/net/bpf_jit_comp64.c
+++ b/arch/riscv/net/bpf_jit_comp64.c
@@ -1751,3 +1751,8 @@ void bpf_jit_build_epilogue(struct rv_jit_context *ctx)
 {
 	__build_epilogue(false, ctx);
 }
+
+bool bpf_jit_supports_kfunc_call(void)
+{
+	return true;
+}
-- 
2.25.1




More information about the linux-riscv mailing list