diff options
| author | Eduard Zingerman <eddyz87@gmail.com> | 2026-10-09 03:47:47 -0700 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-10-09 20:29:14 +0000 |
| commit | 4c3a56544b65d50b68c48d5d7829feb455ac7ade (patch) | |
| tree | 4e5cb8fe35e4cc9ed58d4dacc7a6b2c8e4fc8a78 /include/linux | |
| parent | 97d592e69d097c5ba5381165b21f08b28f831695 (diff) | |
| download | linux-next-4c3a56544b65d50b68c48d5d7829feb455ac7ade.tar.gz linux-next-4c3a56544b65d50b68c48d5d7829feb455ac7ade.zip | |
bpf: Add bpf_same_memory_origin()
When dealing with loops like:
for (ptr = ...; ptr < end_ptr; ptr += 8)
...
Scalar evolution needs to know if ptr and end_ptr identify a same
memory location (possibly with different offsets). If they do,
it is sound to attempt to infer iteration bounds for such a loop.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261009-scev-minimal-rebase-v3-29-bcba9bc53ac9@gmail.com
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bpf_verifier.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index 711a4cb24c06..6daa0c826f25 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -1822,6 +1822,8 @@ struct arg_access_info bpf_global_subprog_stack_access_bytes(struct bpf_verifier_env *env, struct bpf_insn *insn, int arg, int insn_idx); int bpf_compute_subprog_arg_access(struct bpf_verifier_env *env); +bool bpf_same_memory_origin(const struct bpf_reg_state *reg_a, + const struct bpf_reg_state *reg_b); int bpf_set_reg_range(struct bpf_verifier_env *env, struct bpf_reg_state *reg, struct cnum64 range, u16 base, u16 step); bool bpf_reg_union_compatible(const struct bpf_reg_state *a, const struct bpf_reg_state *b); |
