All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Guo <dongtai.guo@linux.dev>
To: Huacai Chen <chenhuacai@kernel.org>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Hengqi Chen <hengqi.chen@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>, George Guo <guodongtai@kylinos.cn>,
	bpf@vger.kernel.org, loongarch@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [PATCH bpf-next v2 00/11] LoongArch: BPF: arena features, exceptions, private stack and may_goto
Date: Thu,  2 Jul 2026 10:23:11 +0800	[thread overview]
Message-ID: <20260702022322.51033-1-dongtai.guo@linux.dev> (raw)

This series adds the remaining LoongArch BPF JIT features and enables the
matching selftests:

  - internal-only MOV for per-CPU address resolution
  - timed may_goto
  - per-program private stacks
  - exceptions (bpf_throw)
  - sign-extending loads from arena (PROBE_MEM32SX)
  - atomics on arena pointers (PROBE_ATOMIC)
  - selftests: struct_ops private stack, arena LDSX, arena atomics, and a
    LoongArch deny list

Patch 1 ("LoongArch: BPF: Fix tail call count pointer offset for arena
programs") is the same fix already posted separately for the bpf tree;
several patches in this series (notably exceptions, patch 5) build on
top of the helper it introduces, so it is included here, unchanged, to
keep the series self-contained and applicable on bpf-next. It can be
dropped once it lands via the bpf tree.

  LoongArch: BPF: Fix tail call count pointer offset for arena programs
  https://lore.kernel.org/all/20260629085511.359546-1-dongtai.guo@linux.dev

Based on 7.2-rc1.

v2:
 - Included the tail call count pointer offset fix as patch 1/11 (see
   above) instead of only referencing it, so the series applies cleanly
   on bpf-next without waiting on the bpf tree; the empty prog_array
   off-by-one was fixed independently upstream by commit 0379d10f09bc
   ("LoongArch: BPF: Fix off-by-one error in tail call"), now in 7.2-rc1.
 - timed may_goto: store $ra at the ORC-mandated .ra_offset = -8 slot in
   the trampoline (it was stored at the wrong slot in v1), per Tiezhu
   Yang's review.
 - Consolidated the earlier per-CPU MOV / timed may_goto and arena gating
   postings into one series; rebased on 7.2-rc1.
 - selftests: use the upstream __arch_loongarch / "LOONGARCH" test_loader
   support now in 7.2-rc1 instead of introducing it.
 - Prior postings:
   https://lore.kernel.org/all/20260609041407.122384-1-dongtai.guo@linux.dev
   https://lore.kernel.org/all/20260618033809.98253-1-dongtai.guo@linux.dev

George Guo (11):
  LoongArch: BPF: Fix tail call count pointer offset for arena programs
  LoongArch: BPF: Support internal-only MOV to resolve per-CPU addrs
  LoongArch: BPF: Add timed may_goto support
  LoongArch: BPF: Add private stack support
  LoongArch: BPF: Add exceptions (bpf_throw) support
  LoongArch: BPF: Support sign-extending loads from arena
  LoongArch: BPF: Support atomics on arena pointers
  selftests/bpf: Enable struct_ops private stack test for LoongArch
  selftests/bpf: Enable arena LDSX tests on LoongArch
  selftests/bpf: Enable arena atomics tests on LoongArch
  selftests/bpf: Add LoongArch deny list

 arch/loongarch/include/asm/inst.h             |   1 +
 arch/loongarch/kernel/stacktrace.c            |  52 +++
 arch/loongarch/net/Makefile                   |   2 +-
 arch/loongarch/net/bpf_jit.c                  | 397 ++++++++++++++++--
 arch/loongarch/net/bpf_jit.h                  |   1 +
 arch/loongarch/net/bpf_timed_may_goto.S       |  47 +++
 .../testing/selftests/bpf/DENYLIST.loongarch  |   1 +
 .../bpf/prog_tests/struct_ops_private_stack.c |   2 +-
 .../selftests/bpf/progs/arena_atomics.c       |   3 +
 .../selftests/bpf/progs/verifier_ldsx.c       |  17 +
 10 files changed, 485 insertions(+), 38 deletions(-)
 create mode 100644 arch/loongarch/net/bpf_timed_may_goto.S
 create mode 100644 tools/testing/selftests/bpf/DENYLIST.loongarch

-- 
2.25.1


             reply	other threads:[~2026-07-02  2:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02  2:23 George Guo [this message]
2026-07-02  2:23 ` [PATCH bpf-next v2 01/11] LoongArch: BPF: Fix tail call count pointer offset for arena programs George Guo
2026-07-02  2:35   ` sashiko-bot
2026-07-06  4:55   ` Tiezhu Yang
2026-07-02  2:23 ` [PATCH bpf-next v2 02/11] LoongArch: BPF: Support internal-only MOV to resolve per-CPU addrs George Guo
2026-07-06  6:46   ` Tiezhu Yang
2026-07-02  2:23 ` [PATCH bpf-next v2 03/11] LoongArch: BPF: Add timed may_goto support George Guo
2026-07-02  2:23 ` [PATCH bpf-next v2 04/11] LoongArch: BPF: Add private stack support George Guo
2026-07-02  2:23 ` [PATCH bpf-next v2 05/11] LoongArch: BPF: Add exceptions (bpf_throw) support George Guo
2026-07-02  2:39   ` sashiko-bot
2026-07-02  2:23 ` [PATCH bpf-next v2 06/11] LoongArch: BPF: Support sign-extending loads from arena George Guo
2026-07-02  2:23 ` [PATCH bpf-next v2 07/11] LoongArch: BPF: Support atomics on arena pointers George Guo
2026-07-02  2:48   ` sashiko-bot
2026-07-06  7:06   ` Tiezhu Yang
2026-07-02  2:23 ` [PATCH bpf-next v2 08/11] selftests/bpf: Enable struct_ops private stack test for LoongArch George Guo
2026-07-02  2:23 ` [PATCH bpf-next v2 09/11] selftests/bpf: Enable arena LDSX tests on LoongArch George Guo
2026-07-02  2:23 ` [PATCH bpf-next v2 10/11] selftests/bpf: Enable arena atomics " George Guo
2026-07-02  2:49   ` sashiko-bot
2026-07-02  2:23 ` [PATCH bpf-next v2 11/11] selftests/bpf: Add LoongArch deny list George Guo
2026-07-06  6:37   ` Tiezhu Yang
2026-07-03 10:11 ` [PATCH bpf-next v2 00/11] LoongArch: BPF: arena features, exceptions, private stack and may_goto Huacai Chen
2026-07-06  7:15 ` 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=20260702022322.51033-1-dongtai.guo@linux.dev \
    --to=dongtai.guo@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=guodongtai@kylinos.cn \
    --cc=hengqi.chen@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=song@kernel.org \
    --cc=yangtiezhu@loongson.cn \
    --cc=yonghong.song@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.