ACK: [SRU][N:linux][PATCH v2 0/5] Fix BPF JIT for BPFv4 instructions on PPC64

Tim Whisonant tim.whisonant at canonical.com
Wed Jul 29 21:29:40 UTC 2026


On Tue, Jun 30, 2026 at 06:55:57PM +0100, Andrei Gherzan via kernel-team wrote:
> BugLink: https://bugs.launchpad.net/bugs/2072994
> 
> SRU Justification:
> 
> [ Impact ]
> 
> The test_bpf kernel module selftest fails on PPC64 architecture. 23 out of
> 1049 BPF tests fail because the PPC64 BPF JIT compiler is missing support
> for BPFv4 instructions that were added in upstream kernel 6.0+.
> 
> The missing JIT support covers:
> - ALU_MOVSX (sign-extended mov)
> - ALU_SDIV/ALU_SMOD (signed division/modulo)
> - BSWAP (unconditional byte swap)
> - BPF_LDX_MEMSX (sign-extended load)
> - JMP32_JA (32-bit offset jump)
> 
> [ Test Plan ]
> 
> 1. Boot a Noble PPC64 instance with the patched kernel
> 2. Run the test_bpf module test:
>    $ sudo modprobe test_bpf
>    $ sudo dmesg | grep "test_bpf: Summary"
>    $ sudo modprobe -r test_bpf
> 
> Before fix:
>   test_bpf: Summary: 1026 PASSED, 23 FAILED, [1025/1025 JIT'ed]
> 
> After fix:
>   test_bpf: Summary: 1049 PASSED, 0 FAILED, [1037/1037 JIT'ed]
> 
> Verified on:
> - Noble PPC64 (ppc64le): 1049 PASSED, 0 FAILED, [1037/1037 JIT'ed]
> 
> [ Where problems could occur ]
> 
> The changes add new JIT code generation paths in
> arch/powerpc/net/bpf_jit_comp64.c and new opcodes in ppc-opcode.h.
> Incorrect implementations could cause wrong results in BPF programs using
> these instructions. However, the code is a clean cherry-pick from upstream
> v6.11 with no modifications required.
> 
> Andrei Gherzan (5):
>   powerpc64/bpf: jit support for 32bit offset jmp instruction
>   powerpc64/bpf: jit support for unconditional byte swap
>   powerpc64/bpf: jit support for sign extended load
>   powerpc64/bpf: jit support for sign extended mov
>   powerpc64/bpf: jit support for signed division and modulo
> 
>  arch/powerpc/include/asm/ppc-opcode.h |   2 +
>  arch/powerpc/net/bpf_jit_comp64.c     | 118 +++++++++++++++++++-------
>  2 files changed, 90 insertions(+), 30 deletions(-)
> 
> -- 
> 2.43.0
> 
> 

Acked-by: Tim Whisonant <tim.whisonant at canonical.com>



More information about the kernel-team mailing list