Re: [PATCH bpf-next v5 1/5] bpf: Move JIT for single-subprog programs to verifier

From: Eduard Zingerman

Date: Wed Mar 04 2026 - 01:05:36 EST


On Mon, 2026-03-02 at 18:27 +0800, Xu Kuohai wrote:

[...]

> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index fc4ccd1de569..ab2bc0850770 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -26086,6 +26086,11 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr, __u3
> convert_pseudo_ld_imm64(env);
> }
>
> + /* constants blinding in the JIT may increase prog->len */
> + len = env->prog->len;
> + if (env->subprog_cnt == 1)
> + env->prog = bpf_prog_select_jit(env->prog, &ret);
> +

I probably miss something important, but would it be possible to put a
call to __bpf_prog_select_runtime() here and remove it from syscall.c:bpf_prog_load()?
Thus avoiding the need for `jit_attempted` parameter.

[...]