BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tiezhu Yang" <yangtiezhu@loongson.cn>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v1 3/3] selftests/bpf: Enable callx related testcases for LoongArch
Date: Mon, 23 Nov 2026 04:59:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-228686@kernel.org> (raw)
In-Reply-To: <20261123045008.23691-4-yangtiezhu@loongson.cn>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests/bpf: callx tests fail on LoongArch due to missing
  JIT callx support
--

commit 89364474c6ac0435e5e06b0462fca0c350392e2f
Author: Tiezhu Yang <yangtiezhu@loongson.cn>

selftests/bpf: Enable callx related testcases for LoongArch

This commit enables the callx BPF selftests and defines CAN_USE_CALLX for
LoongArch.

> diff --git a/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c b/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c
> index cc63b84e4d942..c052fa7624e8d 100644
> --- a/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c
> +++ b/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c
> @@ -9,7 +9,7 @@
>  #include <bpf/btf.h>
>  
>  #if defined(__x86_64__) || defined(__aarch64__) || \
> -    (defined(__riscv) && __riscv_xlen == 64)
> +    (defined(__riscv) && __riscv_xlen == 64) || defined(__loongarch__)
>  
>  #define CALLEE_INSN	6
>  #define DATA		0x1234
> diff --git a/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c b/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c
> index acd821fb568f5..f89bfe3e429d1 100644
> --- a/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c
> +++ b/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c
> @@ -4,7 +4,7 @@
>  #include "callx_rodata.lskel.h"
>  
>  #if defined(__x86_64__) || defined(__aarch64__) || \
> -    (defined(__riscv) && __riscv_xlen == 64)
> +    (defined(__riscv) && __riscv_xlen == 64) || defined(__loongarch__)
>  
>  static void run(int prog_fd, int expected, const char *name)
>  {
> diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h
> index 6b930cb48f8d2..523e54383d7e2 100644
> --- a/tools/testing/selftests/bpf/progs/bpf_misc.h
> +++ b/tools/testing/selftests/bpf/progs/bpf_misc.h
> @@ -306,7 +306,8 @@
>  
>  /* clang always emits callx, gcc only when it defines __BPF_FEATURE_CALLX */
>  #if (defined(__TARGET_ARCH_arm64) || defined(__TARGET_ARCH_x86) ||	\
> -     (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) &&		\
> +     (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64) ||		\
> +     defined(__TARGET_ARCH_loongarch)) &&				\
>  	(defined(__clang__) || defined(__BPF_FEATURE_CALLX))
>  #define CAN_USE_CALLX
>  #endif

[Severity: Medium]
Will these callx selftests fail on LoongArch because the LoongArch BPF JIT
does not yet implement indirect subprog calls?

In this tree, arch/loongarch/net/bpf_jit.c does not override the default
weak bpf_jit_supports_callx() (which returns false) or handle
BPF_JMP | BPF_CALL | BPF_X in build_insn().  As a result,
require_callx_jit() rejects these programs with -EOPNOTSUPP instead of
letting the test suite skip them.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123045008.23691-1-yangtiezhu@loongson.cn?part=3

  reply	other threads:[~2026-11-23  4:59 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
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 [this message]
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-228686@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