Re: [PATCH bpf-next v2 14/15] bpf: Optimize state pruning for spilled scalars

2024-01-10 Thread Andrii Nakryiko
On Wed, Jan 10, 2024 at 1:04 PM Eduard Zingerman wrote: > > On Tue, 2024-01-09 at 16:22 -0800, Andrii Nakryiko wrote: > [...] > > > static bool stacksafe(struct bpf_verifier_env *env, struct > > > bpf_func_state *old, > > > struct bpf_func_state *cur, struct bpf_idmap > >

Re: [PATCH bpf-next v2 14/15] bpf: Optimize state pruning for spilled scalars

2024-01-10 Thread Eduard Zingerman
On Tue, 2024-01-09 at 16:22 -0800, Andrii Nakryiko wrote: [...] > > static bool stacksafe(struct bpf_verifier_env *env, struct bpf_func_state > > *old, > > struct bpf_func_state *cur, struct bpf_idmap *idmap, > > bool exact) > > { > > + struct bpf_reg_state unbound_r

Re: [PATCH bpf-next v2 14/15] bpf: Optimize state pruning for spilled scalars

2024-01-09 Thread Andrii Nakryiko
On Mon, Jan 8, 2024 at 12:53 PM Maxim Mikityanskiy wrote: > > From: Eduard Zingerman > > Changes for scalar ID tracking of spilled unbound scalars lead to > certain verification performance regression. This commit mitigates the > regression by exploiting the following properties maintained by > c

[PATCH bpf-next v2 14/15] bpf: Optimize state pruning for spilled scalars

2024-01-08 Thread Maxim Mikityanskiy
From: Eduard Zingerman Changes for scalar ID tracking of spilled unbound scalars lead to certain verification performance regression. This commit mitigates the regression by exploiting the following properties maintained by check_stack_read_fixed_off(): - a mix of STACK_MISC, STACK_ZERO and STACK