Skip to content

Commit

Permalink
arm64: bpf: optimize LD_ABS, LD_IND
Browse files Browse the repository at this point in the history
Remove superfluous stack frame, saving us 3 instructions for every
LD_ABS or LD_IND.

Signed-off-by: Zi Shen Lim <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
zlim authored and jsdizkcksv committed Feb 11, 2025
1 parent f4983b1 commit 1b158d2
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions arch/arm64/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,8 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
emit_a64_mov_i64(r3, size, ctx);
emit(A64_SUB_I(1, r4, fp, ctx->stack_size), ctx);
emit_a64_mov_i64(r5, (unsigned long)bpf_load_pointer, ctx);
emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx);
emit(A64_MOV(1, A64_FP, A64_SP), ctx);
emit(A64_BLR(r5), ctx);
emit(A64_MOV(1, r0, A64_R(0)), ctx);
emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx);

jmp_offset = epilogue_offset(ctx);
check_imm19(jmp_offset);
Expand Down

0 comments on commit 1b158d2

Please sign in to comment.