diff options
| author | Martin KaFai Lau <kafai@fb.com> | 2021-09-21 17:49:34 -0700 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2021-09-26 13:07:27 -0700 |
| commit | 27113c59b6d0a587b29ae72d4ff3f832f58b0651 (patch) | |
| tree | 8b6acdc79afdcd72ac7d406dc6313978f3f3f84b /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | selftests/bpf: Fix btf_dump __int128 test failure with clang build kernel (diff) | |
| download | linux-27113c59b6d0a587b29ae72d4ff3f832f58b0651.tar.gz linux-27113c59b6d0a587b29ae72d4ff3f832f58b0651.zip | |
bpf: Check the other end of slot_type for STACK_SPILL
Every 8 bytes of the stack is tracked by a bpf_stack_state.
Within each bpf_stack_state, there is a 'u8 slot_type[8]' to track
the type of each byte. Verifier tests slot_type[0] == STACK_SPILL
to decide if the spilled reg state is saved. Verifier currently only
saves the reg state if the whole 8 bytes are spilled to the stack,
so checking the slot_type[7] is the same as checking slot_type[0].
The later patch will allow verifier to save the bounded scalar
reg also for <8 bytes spill. There is a llvm patch [1] to ensure
the <8 bytes spill will be 8-byte aligned, so checking
slot_type[7] instead of slot_type[0] is required.
While at it, this patch refactors the slot_type[0] == STACK_SPILL
test into a new function is_spilled_reg() and change the
slot_type[0] check to slot_type[7] check in there also.
[1] https://reviews.llvm.org/D109073
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210922004934.624194-1-kafai@fb.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
