Commit 6f606ff
bpf: Move insn_buf[16] to bpf_verifier_env
This patch moves the 'struct bpf_insn insn_buf[16]' stack usage
to the bpf_verifier_env. A '#define INSN_BUF_SIZE 16' is also added
to replace the ARRAY_SIZE(insn_buf) usages.
Both convert_ctx_accesses() and do_misc_fixup() are changed
to use the env->insn_buf.
It is a refactoring work for adding the epilogue_buf[16] in a later patch.
With this patch, the stack size usage decreased.
Before:
./kernel/bpf/verifier.c:22133:5: warning: stack frame size (2584)
After:
./kernel/bpf/verifier.c:22184:5: warning: stack frame size (2264)
Reviewed-by: Eduard Zingerman <[email protected]>
Signed-off-by: Martin KaFai Lau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>1 parent c6d9daf commit 6f606ff
2 files changed
+11
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
780 | 782 | | |
781 | 783 | | |
782 | 784 | | |
| 785 | + | |
783 | 786 | | |
784 | 787 | | |
785 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19677 | 19677 | | |
19678 | 19678 | | |
19679 | 19679 | | |
19680 | | - | |
| 19680 | + | |
| 19681 | + | |
19681 | 19682 | | |
19682 | 19683 | | |
19683 | 19684 | | |
| |||
19690 | 19691 | | |
19691 | 19692 | | |
19692 | 19693 | | |
19693 | | - | |
| 19694 | + | |
19694 | 19695 | | |
19695 | 19696 | | |
19696 | 19697 | | |
| |||
19837 | 19838 | | |
19838 | 19839 | | |
19839 | 19840 | | |
19840 | | - | |
| 19841 | + | |
19841 | 19842 | | |
19842 | 19843 | | |
19843 | 19844 | | |
| |||
19846 | 19847 | | |
19847 | 19848 | | |
19848 | 19849 | | |
19849 | | - | |
| 19850 | + | |
19850 | 19851 | | |
19851 | 19852 | | |
19852 | 19853 | | |
| |||
20391 | 20392 | | |
20392 | 20393 | | |
20393 | 20394 | | |
20394 | | - | |
| 20395 | + | |
20395 | 20396 | | |
20396 | 20397 | | |
20397 | 20398 | | |
| |||
20510 | 20511 | | |
20511 | 20512 | | |
20512 | 20513 | | |
20513 | | - | |
| 20514 | + | |
20514 | 20515 | | |
20515 | 20516 | | |
20516 | 20517 | | |
| |||
20803 | 20804 | | |
20804 | 20805 | | |
20805 | 20806 | | |
20806 | | - | |
| 20807 | + | |
20807 | 20808 | | |
20808 | 20809 | | |
20809 | 20810 | | |
| |||
0 commit comments