From 69522ade1b4e02798ce2dc2c057ff6a1fd673c85 Mon Sep 17 00:00:00 2001 From: JaeJoon Jung Date: Mon, 10 Aug 2026 12:14:11 +0900 Subject: [PATCH] riscv: net: bpf: add bpf_jit_supports_private_stack() The bpf_jit_supports_private_stack() function is defined with the __weak attribute in kernel/bpf/core.c as shown below, and returns false. include/linux/filter.h:1191:bool bpf_jit_supports_private_stack(void); kernel/bpf/core.c:3381:bool __weak bpf_jit_supports_private_stack(void) However, if this function is not defined in the corresponding architecture to return true, an error occurs when loading BPF as follows, and it is not loaded. $ cd tools/sched_ext $ make $ sudo ./build/bin/scx_simple libbpf: prog 'simple_dispatch': BPF program load failed: -EACCES libbpf: prog 'simple_dispatch': -- BEGIN PROG LOAD LOG -- Private stack not supported by jit arm64, powerpc, and x86 are defined as follows and return true. arch/arm64/net/bpf_jit_comp.c:2318:bool bpf_jit_supports_private_stack(void) arch/powerpc/net/bpf_jit_comp.c:530:bool bpf_jit_supports_private_stack(void) arch/x86/net/bpf_jit_comp.c:4111:bool bpf_jit_supports_private_stack(void) It seems that it should be defined in the same way in RISCV as well. Signed-off-by: JaeJoon Jung Signed-off-by: Linux RISC-V bot --- 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 f9d5347ba966b7..262d41f29c1d6d 100644 --- a/arch/riscv/net/bpf_jit_comp64.c +++ b/arch/riscv/net/bpf_jit_comp64.c @@ -2157,3 +2157,8 @@ bool bpf_jit_supports_fsession(void) { return true; } + +bool bpf_jit_supports_private_stack(void) +{ + return true; +}