Commit 997ce888 authored by Zi Shen Lim's avatar Zi Shen Lim Committed by David S. Miller

arm64: bpf: optimize JMP_CALL

Remove superfluous stack frame, saving us 3 instructions for
every JMP_CALL.
Signed-off-by: default avatarZi Shen Lim <zlim.lnx@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ddb55992
...@@ -578,11 +578,8 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) ...@@ -578,11 +578,8 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
const u64 func = (u64)__bpf_call_base + imm; const u64 func = (u64)__bpf_call_base + imm;
emit_a64_mov_i64(tmp, func, ctx); emit_a64_mov_i64(tmp, func, ctx);
emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx);
emit(A64_MOV(1, A64_FP, A64_SP), ctx);
emit(A64_BLR(tmp), ctx); emit(A64_BLR(tmp), ctx);
emit(A64_MOV(1, r0, A64_R(0)), ctx); emit(A64_MOV(1, r0, A64_R(0)), ctx);
emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx);
break; break;
} }
/* tail call */ /* tail call */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment