[PATCH v6 5/5] powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free]

Hari Bathini hbathini at linux.ibm.com
Sat Oct 21 01:15:24 AEDT 2023



On 19/10/23 11:41 am, Michael Ellerman wrote:
> Hari Bathini <hbathini at linux.ibm.com> writes:
>> Use bpf_jit_binary_pack_alloc in powerpc jit. The jit engine first
>> writes the program to the rw buffer. When the jit is done, the program
>> is copied to the final location with bpf_jit_binary_pack_finalize.
>> With multiple jit_subprogs, bpf_jit_free is called on some subprograms
>> that haven't got bpf_jit_binary_pack_finalize() yet. Implement custom
>> bpf_jit_free() like in commit 1d5f82d9dd47 ("bpf, x86: fix freeing of
>> not-finalized bpf_prog_pack") to call bpf_jit_binary_pack_finalize(),
>> if necessary. As bpf_flush_icache() is not needed anymore, remove it.
>>
>> Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>
>> Acked-by: Song Liu <song at kernel.org>
>> ---
>>   arch/powerpc/net/bpf_jit.h        |  18 ++---
>>   arch/powerpc/net/bpf_jit_comp.c   | 106 ++++++++++++++++++++++--------
>>   arch/powerpc/net/bpf_jit_comp32.c |  13 ++--
>>   arch/powerpc/net/bpf_jit_comp64.c |  10 +--
>>   4 files changed, 96 insertions(+), 51 deletions(-)
> 
> This causes a crash at boot on my Power7 box:

Thanks, Michael.
Posted v7.

- Hari


More information about the Linuxppc-dev mailing list