public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Yonghong Song <yonghong.song@linux.dev>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	kernel-team@fb.com, Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH bpf-next v7 8/9] bpf: Support private stack for struct_ops progs
Date: Wed, 30 Oct 2024 13:14:52 -1000	[thread overview]
Message-ID: <ZyK97MokcVLgoFrQ@slm.duckdns.org> (raw)
In-Reply-To: <20241029221718.268017-1-yonghong.song@linux.dev>

Hello,

On Tue, Oct 29, 2024 at 03:17:18PM -0700, Yonghong Song wrote:
> For struct_ops progs, whether a particular prog will use private stack
> or not (prog->aux->use_priv_stack) will be set before actual insn-level
> verification for that prog. One particular implementation is to
> piggyback on struct_ops->check_member(). The next patch will have an
> example for this. The struct_ops->check_member() will set
> prog->aux->use_priv_stack to be true which enables private stack
> usage with ignoring BPF_PRIV_STACK_MIN_SIZE limit.
> 
> If use_priv_stack is true for a particular struct_ops prog, bpf
> trampoline will need to do recursion checks (one level at this point)
> to avoid stack overwrite.
> 
> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>

From sched_ext usage POV:

 Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

  reply	other threads:[~2024-10-30 23:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 22:16 [PATCH bpf-next v7 0/9] bpf: Support private stack for bpf progs Yonghong Song
2024-10-29 22:16 ` [PATCH bpf-next v7 1/9] bpf: Check stack depth limit after visiting all subprogs Yonghong Song
2024-10-29 22:16 ` [PATCH bpf-next v7 2/9] bpf: Allow private stack to have each subprog having stack size of 512 bytes Yonghong Song
2024-10-29 22:16 ` [PATCH bpf-next v7 3/9] bpf: Check potential private stack recursion for progs with async callback Yonghong Song
2024-10-29 22:16 ` [PATCH bpf-next v7 4/9] bpf: Allocate private stack for eligible main prog or subprogs Yonghong Song
2024-10-29 22:17 ` [PATCH bpf-next v7 5/9] bpf, x86: Avoid repeated usage of bpf_prog->aux->stack_depth Yonghong Song
2024-10-29 22:17 ` [PATCH bpf-next v7 6/9] bpf, x86: Support private stack in jit Yonghong Song
2024-10-29 22:17 ` [PATCH bpf-next v7 7/9] selftests/bpf: Add tracing prog private stack tests Yonghong Song
2024-10-29 22:17 ` [PATCH bpf-next v7 8/9] bpf: Support private stack for struct_ops progs Yonghong Song
2024-10-30 23:14   ` Tejun Heo [this message]
2024-10-29 22:17 ` [PATCH bpf-next v7 9/9] selftests/bpf: Add struct_ops prog private stack tests Yonghong Song
2024-10-30 23:29   ` Tejun Heo
2024-10-31 19:37     ` Yonghong Song

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=ZyK97MokcVLgoFrQ@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@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