Re: [RFC PATCH bpf 0/6] bpf: Disallow interpreter fallback for interpreter-unsupported insns

From: Leon Hwang

Date: Tue Jun 30 2026 - 23:06:24 EST


On 1/7/26 10:59, Leon Hwang wrote:
> On 1/7/26 07:12, Alexei Starovoitov wrote:
>> On Fri Jun 26, 2026 at 8:43 AM PDT, Leon Hwang wrote:
> [...]
>>
>> I don't think we need such fallback in patch [3].

Sorry, it seems I misunderstood the 'patch [3]' as the patch #3 of this
series.

Will discuss the fallback further in the sibling thread:
https://lore.kernel.org/bpf/af9c0a7e-13de-c227-849f-4b35d1fb74ff@xxxxxxxxxxx/.

Thanks,
Leon

>
> Do you mean we can add the internal BPF_ADDR_PERCPU insn support to the
> interpreter?
>
> See my reply in "PROBLEM: BPF interpreter fallback after JIT compilation
> of BPF_ADDR_PERCPU leads to kernel panic" thread [1].
>
> [1]
> https://lore.kernel.org/bpf/90c32de0-feac-4e63-9757-2a1d115be08c@xxxxxxxxx/
>
>>
>> And approach taken by this set also doesn't scale, since it splits
>> the verifier/JIT logic into core.c which will be hard to keep consistent.
>> I think we need another bit like jit_requested in prog like 'must_jit'
>> that the verifier set for addr_space_cast, kfuncs and the rest.
>>
>> Then the core.c change will be:
>> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
>> index 649cce41e13f..5126a43c1b81 100644
>> --- a/kernel/bpf/core.c
>> +++ b/kernel/bpf/core.c
>> @@ -2620,7 +2620,7 @@ struct bpf_prog *__bpf_prog_select_runtime(struct bpf_verifier_env *env, struct
>> goto finalize;
>>
>> if (IS_ENABLED(CONFIG_BPF_JIT_ALWAYS_ON) ||
>> - bpf_prog_has_kfunc_call(fp))
>> + fp->must_jit)
>> jit_needed = true;
>>
>
> Got it. Will follow your suggestion.
>
> Thanks,
> Leon
>