On Wed, 1 Jul 2026 15:29:28 +0800, Tiezhu Yang <[email protected]> wrote:
> On 2026/7/1 下午3:02, Leon Hwang wrote:
>> On 1/7/26 14:49, Tiezhu Yang wrote:
>> [...]
>>>>
>>>> It is a real issue.
>>>>
>>>> Instead of fixing up helper calls, it seems better to prevent
>>>> interpreter fallback if the prog has any JIT-inlineable helper call.
>>>
>>> Hi Alexei and Leon,
>>>
>>> What about the following: (not tested yet, if it is good, I can test it)
>>>
>>> [...]
>>>
>>> If you are OK with the above changes, I will test it again and send
>>> a new version later.
>>>
>>
>> If you don't mind, I think I can disallow the interpreter fallback by
>> the below diff in the next revision of this series.
>>
>> The 'aux->jit_required' is introduced by following Alexei's suggestion.
>
> I am not sure if introducing a new aux->jit_required member is necessary,
> as we already have a local jit_needed flag in the current logic.

A 'must_jit'-like member was suggested by Alexei [1].

Probably, the commits in [2] could help to understand 'aux->jit_required'.

[1] https://lore.kernel.org/bpf/[email protected]/
[2] https://github.com/Asphaltt/bpf/commits/bpf/fix-interpreter-fallback/v2/

>
> Additionally, the issue reported in my patch [1] is fundamentally tied
> to bpf_jit_inlines_helper_call(). Maybe we can simply reuse jit_needed
> by checking bpf_prog_has_inline_helpers() right before JITing, and then
> reject fallback with -ENOTSUPP if JIT compilation fails.

Correct. Reusing jit_needed is preferred.

Thanks,
Leon

>
> Let us wait for Alexei's comments on the overall direction before
> respinning.
>
> [1] bpf: Fix unaligned interpreter panic on JIT fallback path
> https://lore.kernel.org/bpf/[email protected]/
>
> Thanks,
> Tiezhu

Reply via email to