diff options
author | Philo Lu <lulie@linux.alibaba.com> | 2024-04-05 10:55:34 +0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-04-05 10:31:17 -0700 |
commit | 0a525621b7e5b49202b19d8f75382c6778fdd0c1 (patch) | |
tree | 15aca0b681bfa152ff7768390965942dcbe6026b /tools/testing/selftests/bpf/prog_tests/linked_funcs.c | |
parent | 58babe27180c8d4cb54d831589cf801bd9268876 (diff) |
bpf: store both map ptr and state in bpf_insn_aux_data
Currently, bpf_insn_aux_data->map_ptr_state is used to store either
map_ptr or its poison state (i.e., BPF_MAP_PTR_POISON). Thus
BPF_MAP_PTR_POISON must be checked before reading map_ptr. In certain
cases, we may need valid map_ptr even in case of poison state.
This will be explained in next patch with bpf_for_each_map_elem()
helper.
This patch changes map_ptr_state into a new struct including both map
pointer and its state (poison/unpriv). It's in the same union with
struct bpf_loop_inline_state, so there is no extra memory overhead.
Besides, macros BPF_MAP_PTR_UNPRIV/BPF_MAP_PTR_POISON/BPF_MAP_PTR are no
longer needed.
This patch does not change any existing functionality.
Signed-off-by: Philo Lu <lulie@linux.alibaba.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20240405025536.18113-2-lulie@linux.alibaba.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/linked_funcs.c')
0 files changed, 0 insertions, 0 deletions