On Tue, 22 Apr 2025 13:56:09 +0530, Hari Bathini wrote:
arch_bpf_trampoline_size() provides JIT size of the BPF trampoline before the buffer for JIT'ing it is allocated. The total number of instructions emitted for BPF trampoline JIT code depends on where the final image is located. So, the size arrived at with the dummy pass in arch_bpf_trampoline_size() can vary from the actual size needed in arch_prepare_bpf_trampoline(). When the instructions accounted in arch_bpf_trampoline_size() is less than the number of instructions emitted during the actual JIT compile of the trampoline, the below warning is produced:
[...]
Applied to powerpc/next.
[1/1] powerpc/bpf: fix JIT code size calculation of bpf trampoline https://git.kernel.org/powerpc/c/59ba025948be2a92e8bc9ae1cbdaf197660bd508
Thanks