diff options
author | Martin KaFai Lau <[email protected]> | 2021-09-21 17:49:34 -0700 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2021-09-26 13:07:27 -0700 |
commit | 27113c59b6d0a587b29ae72d4ff3f832f58b0651 (patch) | |
tree | 8b6acdc79afdcd72ac7d406dc6313978f3f3f84b /tools/perf/scripts/python/mem-phys-addr.py | |
parent | 091037fb770e1771a52246f9b68dc76082178a3c (diff) |
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions