Re: [PATCH v1 0/4] LoongArch: BPF: Support instructions array, indirect jumps and calls
From: George Guo
Date: Fri Dec 04 2026 - 01:57:14 EST
On 2026/11/23 12:39, Tiezhu Yang wrote:
> Tested with the series of BPF selftests, here are the test results:
>
> $ sudo ./test_progs -t bpf_insn_array | tail -1
> Summary: 1/20 PASSED, 0 SKIPPED, 0/0 FAILED
>
> $ sudo ./test_progs-cpuv4 -t gotox | tail -1
> Summary: 2/14 PASSED, 0 SKIPPED, 0/0 FAILED
>
> $ sudo ./test_progs -t callx | tail -1
> Summary: 6/89 PASSED, 6 SKIPPED, 0/0 FAILED
Tested the whole series on Loongson-3C6000. These tests are skipped on
LoongArch upstream, so I added LoongArch to the arch checks in
bpf_insn_array.c, callx_func_ptr_map.c, callx_rodata_lskel.c,
verifier_callx.c, verifier_callx_rodata.c and verifier_gotox.c locally:
$ sudo ./test_progs -t bpf_insn_array | tail -1
Summary: 1/20 PASSED, 0 SKIPPED, 0/0 FAILED
$ sudo ./test_progs-cpuv4 -t gotox | tail -1
Summary: 2/47 PASSED, 0 SKIPPED, 0/0 FAILED
$ sudo ./test_progs -t jit_insns,jit_insns_blinded | tail -1
Summary: 2/47 PASSED, 0 SKIPPED, 0/0 FAILED
With CONFIG_ARCH_STRICT_ALIGN=n:
$ sudo ./test_progs -t callx | tail -1
Summary: 4/77 PASSED, 0 SKIPPED, 0/0 FAILED
With CONFIG_ARCH_STRICT_ALIGN=y:
$ sudo ./test_progs -t callx | tail -1
Summary: 3/76 PASSED, 0 SKIPPED, 1/1 FAILED
The only failure with CONFIG_ARCH_STRICT_ALIGN=y is
verifier_callx_rodata/callx_rodata_misaligned_read, and it is not
related to this series. HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
then, so the verifier checks alignment strictly. The program is still
rejected as expected, but by the alignment check first:
misaligned value access off 352+4 size 8
instead of the message the test looks for:
read of 8 bytes at offset
Reviewed-by: George Guo <guodongtai@xxxxxxxxxx>
Tested-by: George Guo <guodongtai@xxxxxxxxxx>
Thanks,
George