diff options
| author | Eduard Zingerman <[email protected]> | 2024-01-27 17:52:36 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2024-02-02 21:22:14 +0000 |
| commit | 6efbde200bf3cf2dbf6e7181893fed13a79c789b (patch) | |
| tree | 0b91ca2602847f5df1035b1b80bf01ab8872bb3c /tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | |
| parent | selftests/bpf: Add test cases for narrowing fill (diff) | |
| download | kernel-6efbde200bf3cf2dbf6e7181893fed13a79c789b.tar.gz kernel-6efbde200bf3cf2dbf6e7181893fed13a79c789b.zip | |
bpf: Handle scalar spill vs all MISC in stacksafe()
When check_stack_read_fixed_off() reads value from an spi
all stack slots of which are set to STACK_{MISC,INVALID},
the destination register is set to unbound SCALAR_VALUE.
Exploit this fact by allowing stacksafe() to use a fake
unbound scalar register to compare 'mmmm mmmm' stack value
in old state vs spilled 64-bit scalar in current state
and vice versa.
Veristat results after this patch show some gains:
./veristat -C -e file,prog,states -f 'states_pct>10' not-opt after
File Program States (DIFF)
----------------------- --------------------- ---------------
bpf_overlay.o tail_rev_nodeport_lb4 -45 (-15.85%)
bpf_xdp.o tail_lb_ipv4 -541 (-19.57%)
pyperf100.bpf.o on_event -680 (-10.42%)
pyperf180.bpf.o on_event -2164 (-19.62%)
pyperf600.bpf.o on_event -9799 (-24.84%)
strobemeta.bpf.o on_event -9157 (-65.28%)
xdp_synproxy_kern.bpf.o syncookie_tc -54 (-19.29%)
xdp_synproxy_kern.bpf.o syncookie_xdp -74 (-24.50%)
Signed-off-by: Eduard Zingerman <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockmap_basic.c')
0 files changed, 0 insertions, 0 deletions
