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.
Thanks,
Leon
---
diff --git a/kernel/bpf/fixups.c b/kernel/bpf/fixups.c
index b5a273a5f944..677b6d2a6ba4 100644
--- a/kernel/bpf/fixups.c
+++ b/kernel/bpf/fixups.c
@@ -1841,8 +1841,10 @@ int bpf_do_misc_fixups(struct bpf_verifier_env *env)
}
/* Skip inlining the helper call if the JIT does it. */
- if (bpf_jit_inlines_helper_call(insn->imm))
+ if (bpf_jit_inlines_helper_call(insn->imm)) {
+ prog->aux->jit_required = true;
goto next_insn;
+ }
if (insn->imm == BPF_FUNC_get_route_realm)
prog->dst_needed = 1;