summaryrefslogtreecommitdiff
path: root/arch/sparc/net/bpf_jit_comp_64.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-06-01 05:35:00 +0300
committerDavid S. Miller <davem@davemloft.net>2017-06-01 05:35:00 +0300
commita5e2ee5da47412c98b023acb49d0787e40e4ec6a (patch)
treed62a0564b8fd44b3b9590a0c010445ec6bd331bf /arch/sparc/net/bpf_jit_comp_64.c
parent551f40c42f02000077a6cc5416bfe213052dbbf0 (diff)
downloadlinux-a5e2ee5da47412c98b023acb49d0787e40e4ec6a.tar.xz
bpf: Take advantage of stack_depth tracking in sparc64 JIT
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/net/bpf_jit_comp_64.c')
-rw-r--r--arch/sparc/net/bpf_jit_comp_64.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c
index 4a52d34facf9..098874a81f6e 100644
--- a/arch/sparc/net/bpf_jit_comp_64.c
+++ b/arch/sparc/net/bpf_jit_comp_64.c
@@ -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;