* [PATCH net-next] bpf: Take advantage of stack_depth tracking in sparc64 JIT
@ 2017-06-01 2:40 David Miller
0 siblings, 0 replies; only message in thread
From: David Miller @ 2017-06-01 2:40 UTC (permalink / raw)
To: netdev; +Cc: ast, daniel, sparclinux
Signed-off-by: David S. Miller <davem@davemloft.net>
---
Committed to net-next.
arch/sparc/net/bpf_jit_comp_64.c | 9 +++++++--
1 file 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 4a52d34..098874a 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;
--
2.1.2.532.g19b5d50
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-01 2:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-01 2:40 [PATCH net-next] bpf: Take advantage of stack_depth tracking in sparc64 JIT David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).