public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Xu Kuohai <xukuohai@huaweicloud.com>,
	bpf@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	 Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Yonghong Song	 <yonghong.song@linux.dev>,
	Puranjay Mohan <puranjay@kernel.org>,
	Anton Protopopov <a.s.protopopov@gmail.com>
Subject: Re: [PATCH bpf-next v4 2/4] bpf: Add helper to detect indirect jump targets
Date: Wed, 14 Jan 2026 12:46:18 -0800	[thread overview]
Message-ID: <2e5ed01463ae8f79780a42c4e7f93baeafd2565a.camel@gmail.com> (raw)
In-Reply-To: <20260114093914.2403982-3-xukuohai@huaweicloud.com>

On Wed, 2026-01-14 at 17:39 +0800, Xu Kuohai wrote:
> From: Xu Kuohai <xukuohai@huawei.com>
> 
> Introduce helper bpf_insn_is_indirect_target to determine whether a BPF
> instruction is an indirect jump target. This helper will be used by
> follow-up patches to decide where to emit indirect landing pad instructions.
> 
> Add a new flag to struct bpf_insn_aux_data to mark instructions that are
> indirect jump targets. The BPF verifier sets this flag, and the helper
> checks it to determine whether an instruction is an indirect jump target.
> 
> Since bpf_insn_aux_data is only available before JIT stage, add a new
> field to struct bpf_prog_aux to store a pointer to the bpf_insn_aux_data
> array, making it accessible to the JIT.
> 
> For programs with multiple subprogs, each subprog uses its own private
> copy of insn_aux_data, since subprogs may insert additional instructions
> during JIT and need to update the array. For non-subprog, the verifier's
> insn_aux_data array is used directly to avoid unnecessary copying.
> 
> Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
> ---

Hm, I've missed the fact insn_aux_data is not currently available to jit.
Is it really necessary to copy this array for each subprogram?
Given that we still want to free insn_aux_data after program load,
I'd expect that it should be possible just to pass a pointer with an
offset pointing to a start of specific subprogram. Wdyt?

[...]


  parent reply	other threads:[~2026-01-14 20:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14  9:39 [PATCH bpf-next v4 0/4] emit ENDBR/BTI instructions for indirect jump targets Xu Kuohai
2026-01-14  9:39 ` [PATCH bpf-next v4 1/4] bpf: Fix an off-by-one error in check_indirect_jump Xu Kuohai
2026-01-14 10:29   ` Anton Protopopov
2026-01-15  7:31     ` Xu Kuohai
2026-01-14  9:39 ` [PATCH bpf-next v4 2/4] bpf: Add helper to detect indirect jump targets Xu Kuohai
2026-01-14 11:00   ` Anton Protopopov
2026-01-15  7:37     ` Xu Kuohai
2026-01-14 20:46   ` Eduard Zingerman [this message]
2026-01-15  7:47     ` Xu Kuohai
2026-01-18 17:20       ` Alexei Starovoitov
2026-01-18 23:22         ` Kumar Kartikeya Dwivedi
2026-01-19  2:35         ` Xu Kuohai
2026-01-14  9:39 ` [PATCH bpf-next v4 3/4] bpf, x86: Emit ENDBR for " Xu Kuohai
2026-01-14 16:46   ` kernel test robot
2026-01-14  9:39 ` [PATCH bpf-next v4 4/4] bpf, arm64: Emit BTI for indirect jump target Xu Kuohai

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=2e5ed01463ae8f79780a42c4e7f93baeafd2565a.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=a.s.protopopov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=puranjay@kernel.org \
    --cc=xukuohai@huaweicloud.com \
    --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