From: sashiko-bot@kernel.org
To: "Tiezhu Yang" <yangtiezhu@loongson.cn>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v1 1/3] selftests/bpf: Enable instruction array test for LoongArch
Date: Mon, 23 Nov 2026 05:02:12 +0000 [thread overview]
Message-ID: <sashiko-outbox-228693@kernel.org> (raw)
In-Reply-To: <20261123045008.23691-2-yangtiezhu@loongson.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests/bpf: enabling bpf_insn_array on LoongArch fails
without JIT support
--
commit a34406fe396aca3cf00c1518cc4013c6dae7154b
Author: Tiezhu Yang <yangtiezhu@loongson.cn>
selftests/bpf: Enable instruction array test for LoongArch
This commit enables the bpf_insn_array selftest suite on LoongArch by
adding defined(__loongarch__) to the architecture guard.
> diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_insn_array.c b/tools/testing/selftests/bpf/prog_tests/bpf_insn_array.c
> index 4ffe4fe6b78e9..6b1a426aa4cd5 100644
> --- a/tools/testing/selftests/bpf/prog_tests/bpf_insn_array.c
> +++ b/tools/testing/selftests/bpf/prog_tests/bpf_insn_array.c
> @@ -5,7 +5,7 @@
> #include <test_progs.h>
>
> #if defined(__x86_64__) || defined(__powerpc__) || defined(__aarch64__) || \
> - (defined(__riscv) && __riscv_xlen == 64)
> + (defined(__riscv) && __riscv_xlen == 64) || defined(__loongarch__)
> static int map_create(__u32 map_type, __u32 max_entries)
> {
> const char *map_name = "insn_array";
[Severity: Medium]
Does enabling bpf_insn_array on LoongArch depend on a prerequisite JIT
patch that is not in the tree yet?
In arch/loongarch/net/bpf_jit.c, bpf_int_jit_compile() does not call
bpf_prog_update_insn_ptrs(), so insn_array->ips[] stays zeroed and
bpf_insn_array_ready() rejects program loading with -EFAULT. In addition,
build_insn() only handles BPF_JMP | BPF_JA and BPF_JMP32 | BPF_JA, without
BPF_JMP | BPF_JA | BPF_X (gotox), so the gotox subtests fail to JIT with
-EINVAL (-ENOTSUPP).
Also, HAVE_EBPF_JIT on LoongArch is only selected for 64BIT, while
defined(__loongarch__) matches 32-bit builds as well.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123045008.23691-1-yangtiezhu@loongson.cn?part=1
next prev parent reply other threads:[~2026-11-23 5:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 4:50 [PATCH bpf-next v1 0/3] selftests/bpf: Enable instructions array, indirect calls tests for LoongArch Tiezhu Yang
2026-11-23 4:50 ` [PATCH bpf-next v1 1/3] selftests/bpf: Enable instruction array test " Tiezhu Yang
2026-11-23 5:02 ` sashiko-bot [this message]
2026-11-23 5:21 ` Tiezhu Yang
2026-11-23 4:50 ` [PATCH bpf-next v1 2/3] selftests/bpf: Allow unaligned access in callx_rodata_misaligned_read Tiezhu Yang
2026-11-23 4:50 ` [PATCH bpf-next v1 3/3] selftests/bpf: Enable callx related testcases for LoongArch Tiezhu Yang
2026-11-23 4:59 ` sashiko-bot
2026-11-23 5:13 ` Tiezhu Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-228693@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yangtiezhu@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox