BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Anton Protopopov <a.s.protopopov@gmail.com>,
	bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Anton Protopopov <aspsk@isovalent.com>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	Quentin Monnet <qmo@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>
Subject: Re: [PATCH v11 bpf-next 00/12] BPF indirect jumps
Date: Wed, 05 Nov 2025 12:51:48 -0800	[thread overview]
Message-ID: <7463cbcabcd06016d7dfbd858f4e089c4acd88f1.camel@gmail.com> (raw)
In-Reply-To: <20251105090410.1250500-1-a.s.protopopov@gmail.com>

On Wed, 2025-11-05 at 09:03 +0000, Anton Protopopov wrote:
> This patchset implements a new type of map, instruction set, and uses
> it to build support for indirect branches in BPF (on x86). (The same
> map will be later used to provide support for indirect calls and static
> keys.) See [1], [2] for more context.
> 
> Short table of contents:
> 
>   * Patches 1-6 implement the new map of type
>     BPF_MAP_TYPE_INSN_SET and corresponding selftests. This map can
>     be used to track the "original -> xlated -> jitted mapping" for
>     a given program.
> 
>   * Patches 7-12 implement the support for indirect jumps on x86 and add libbpf
>     support for LLVM-compiled programs containing indirect jumps, and selftests.
> 
> The jump table support was merged to LLVM and now can be
> enabled with -mcpu=v4, see [3]. The __BPF_FEATURE_GOTOX
> macros can be used to check if the compiler supports the
> feature or not.
> 
> See individual patches for more details on the implementation details.

I retested this series with upstream clang [1] (includes latest
changes for relocations handling from Yonghong), and all works as
expected.

The series is ready to land from my perspective.
(AI has a few notes on tests, though).

[1] f60e69315e9e ("[llvm] Emit canonical linkage correct function
symbol (#166487)")

> v10 -> v11 (this series):
> 
>   * rearranged patches and split libbpf patch such that first 6 patches
>     implementing instruction arrays can be applied independently

I actually tried applying first 6 patches and then removing patch #3
"libbpf: Recognize insn_array map type", nothing broke: kernel and
selftests compile, relevant selftests passing.
So, not sure if splitting patch #3 as a separate thing is really
necessary.

> 
>   * instruction arrays:
>     * move [fake] aux->used_maps assignment in this patch
> 
>   * indirect jumps:
>     * call clear_insn_aux_data before bpf_remove_insns (AI)
> 
>   * libbpf:
>     * remove the relocations check after the new LLVM is released (Eduard, Yonghong)
>     * libbpf: fix an index printed in pr_warn (AI)
> 
>   * selftests:
>     * protect programs triggered by nanosleep from fake runs (Eduard)
>     * patch verifier_gotox to not emit .rel.jumptables
> 

[...]

  parent reply	other threads:[~2025-11-05 20:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05  9:03 [PATCH v11 bpf-next 00/12] BPF indirect jumps Anton Protopopov
2025-11-05  9:03 ` [PATCH v11 bpf-next 01/12] bpf, x86: add new map type: instructions array Anton Protopopov
2025-11-06  2:03   ` Alexei Starovoitov
2025-11-06 10:01     ` Anton Protopopov
2025-11-06 17:08       ` Alexei Starovoitov
2025-11-16 12:58         ` Anton Protopopov
2025-11-22  2:40           ` Alexei Starovoitov
2025-11-24 15:17             ` Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 02/12] bpftool: Recognize insn_array map type Anton Protopopov
2025-11-05  9:21   ` bot+bpf-ci
2025-11-05  9:29     ` Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 03/12] libbpf: " Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 04/12] selftests/bpf: add selftests for new insn_array map Anton Protopopov
2025-11-05  9:28   ` bot+bpf-ci
2025-11-05  9:52     ` Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 05/12] bpf: support instructions arrays with constants blinding Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 06/12] selftests/bpf: test instructions arrays with blinding Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 07/12] bpf, x86: allow indirect jumps to r8...r15 Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 08/12] bpf, x86: add support for indirect jumps Anton Protopopov
2025-11-05 11:23   ` Anton Protopopov
2025-11-05 17:45     ` Ihor Solodrai
2025-11-05 20:16       ` Anton Protopopov
2025-11-05 22:42   ` Alexei Starovoitov
2025-11-06 10:03     ` Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 09/12] bpf: disasm: add support for BPF_JMP|BPF_JA|BPF_X Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 10/12] libbpf: support llvm-generated indirect jumps Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 11/12] selftests/bpf: add new verifier_gotox test Anton Protopopov
2025-11-05  9:04 ` [PATCH v11 bpf-next 12/12] selftests/bpf: add C-level selftests for indirect jumps Anton Protopopov
2025-11-05  9:28   ` bot+bpf-ci
2025-11-05  9:37     ` Anton Protopopov
2025-11-05 20:51 ` Eduard Zingerman [this message]
2025-11-05 21:54   ` [PATCH v11 bpf-next 00/12] BPF " Anton Protopopov
2025-11-06  1:56     ` Alexei Starovoitov
2025-11-06  2:00 ` patchwork-bot+netdevbpf

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=7463cbcabcd06016d7dfbd858f4e089c4acd88f1.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=a.s.protopopov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=aspsk@isovalent.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=qmo@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox