]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/powerpc/net/bpf_jit64.h
bpf: take advantage of stack_depth tracking in powerpc JIT
[mirror_ubuntu-bionic-kernel.git] / arch / powerpc / net / bpf_jit64.h
index 62fa7589db2b4edc6e9e28742a4b7e531fd23162..8bdef7ed28a831353d1d6b17499f54f439aff191 100644 (file)
@@ -23,7 +23,7 @@
  *             [   nv gpr save area    ] 8*8           |
  *             [    tail_call_cnt      ] 8             |
  *             [    local_tmp_var      ] 8             |
- * fp (r31) -->        [   ebpf stack space    ] 512           |
+ * fp (r31) -->        [   ebpf stack space    ] upto 512      |
  *             [     frame header      ] 32/112        |
  * sp (r1) --->        [    stack pointer      ] --------------
  */
@@ -32,8 +32,8 @@
 #define BPF_PPC_STACK_SAVE     (8*8)
 /* for bpf JIT code internal usage */
 #define BPF_PPC_STACK_LOCALS   16
-/* Ensure this is quadword aligned */
-#define BPF_PPC_STACKFRAME     (STACK_FRAME_MIN_SIZE + MAX_BPF_STACK + \
+/* stack frame excluding BPF stack, ensure this is quadword aligned */
+#define BPF_PPC_STACKFRAME     (STACK_FRAME_MIN_SIZE + \
                                 BPF_PPC_STACK_LOCALS + BPF_PPC_STACK_SAVE)
 
 #ifndef __ASSEMBLY__
@@ -103,6 +103,7 @@ struct codegen_context {
         */
        unsigned int seen;
        unsigned int idx;
+       unsigned int stack_size;
 };
 
 #endif /* !__ASSEMBLY__ */