The interpreter does the following: u32 index = BPF_R3; and JITs should do the same. Cc: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx> --- arch/sparc/net/bpf_jit_comp_64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c index 0a3c18e39199..6c482685dc6c 100644 --- a/arch/sparc/net/bpf_jit_comp_64.c +++ b/arch/sparc/net/bpf_jit_comp_64.c @@ -856,6 +856,7 @@ static void emit_tail_call(struct jit_ctx *ctx) ctx->saw_tail_call = true; + emit_alu_K(SRL, bpf_index, 0, ctx); off = offsetof(struct bpf_array, map.max_entries); emit(LD32 | IMMED | RS1(bpf_array) | S13(off) | RD(tmp), ctx); emit_cmp(bpf_index, tmp, ctx); -- 2.39.1