bpf: Take advantage of stack_depth tracking in sparc64 JIT

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2017-05-31 19:35:00 -07:00
parent 551f40c42f
commit a5e2ee5da4
1 changed files with 7 additions and 2 deletions

View File

@ -802,8 +802,13 @@ static void build_prologue(struct jit_ctx *ctx)
{
s32 stack_needed = BASE_STACKFRAME;
if (ctx->saw_frame_pointer || ctx->saw_tail_call)
stack_needed += MAX_BPF_STACK;
if (ctx->saw_frame_pointer || ctx->saw_tail_call) {
struct bpf_prog *prog = ctx->prog;
u32 stack_depth;
stack_depth = prog->aux->stack_depth;
stack_needed += round_up(stack_depth, 16);
}
if (ctx->saw_tail_call)
stack_needed += 8;