summaryrefslogtreecommitdiffstats
path: root/arch/s390/net/bpf_jit.h
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>2017-11-07 19:16:25 +0100
committerHeiko Carstens <heiko.carstens@de.ibm.com>2017-11-10 18:57:37 +0100
commit78372709bf95c2ef5c886780efc268f7f052168a (patch)
tree11f908545f711b32ab60a2dd2ce2f749c1b26f44 /arch/s390/net/bpf_jit.h
parent22841cea1a10832d07f16720c718f6795f35fe2a (diff)
downloadlinux-78372709bf95c2ef5c886780efc268f7f052168a.tar.gz
linux-78372709bf95c2ef5c886780efc268f7f052168a.tar.bz2
linux-78372709bf95c2ef5c886780efc268f7f052168a.zip
s390/bpf: take advantage of stack_depth tracking
Make use of the "stack_depth" tracking feature introduced with commit 8726679a0fa31 ("bpf: teach verifier to track stack depth") for the s390 JIT, so that stack usage can be reduced. Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'arch/s390/net/bpf_jit.h')
-rw-r--r--arch/s390/net/bpf_jit.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/s390/net/bpf_jit.h b/arch/s390/net/bpf_jit.h
index fda605dbc1b4..5057728b300e 100644
--- a/arch/s390/net/bpf_jit.h
+++ b/arch/s390/net/bpf_jit.h
@@ -52,10 +52,13 @@ extern u8 sk_load_word[], sk_load_half[], sk_load_byte[];
*
* We get 160 bytes stack space from calling function, but only use
* 12 * 8 byte for old backchain, r15..r6, and tail_call_cnt.
+ *
+ * The stack size used by the BPF program ("BPF stack" above) is passed
+ * via "aux->stack_depth".
*/
-#define STK_SPACE (MAX_BPF_STACK + 8 + 8 + 4 + 4 + 160)
+#define STK_SPACE_ADD (8 + 8 + 4 + 4 + 160)
#define STK_160_UNUSED (160 - 12 * 8)
-#define STK_OFF (STK_SPACE - STK_160_UNUSED)
+#define STK_OFF (STK_SPACE_ADD - STK_160_UNUSED)
#define STK_OFF_TMP 160 /* Offset of tmp buffer on stack */
#define STK_OFF_HLEN 168 /* Offset of SKB header length on stack */
#define STK_OFF_SKBP 176 /* Offset of SKB pointer on stack */