From: Yonghong Song <yonghong.song@linux.dev>
To: bpf@vger.kernel.org
Cc: 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>,
Tejun Heo <tj@kernel.org>
Subject: [PATCH bpf-next v5 3/9] sched-ext: Allow sched-ext progs to use private stack
Date: Thu, 17 Oct 2024 15:31:54 -0700 [thread overview]
Message-ID: <20241017223154.3176602-1-yonghong.song@linux.dev> (raw)
In-Reply-To: <20241017223138.3175885-1-yonghong.song@linux.dev>
Allow sched-ext struct_ops bpf progs to use private stack. In later
jit, there will be some recursion checking if private stack is used
such that if the same prog is run again in the same cpu, then
that second prog run will be skipped.
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
---
kernel/sched/ext.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 3cd7c50a51c5..f186cf7cac90 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -5370,10 +5370,16 @@ bpf_scx_get_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
}
}
+static bool bpf_scx_priv_stack_allowed(void)
+{
+ return true;
+}
+
static const struct bpf_verifier_ops bpf_scx_verifier_ops = {
.get_func_proto = bpf_scx_get_func_proto,
.is_valid_access = bpf_scx_is_valid_access,
.btf_struct_access = bpf_scx_btf_struct_access,
+ .priv_stack_allowed = bpf_scx_priv_stack_allowed,
};
static int bpf_scx_init_member(const struct btf_type *t,
--
2.43.5
next prev parent reply other threads:[~2024-10-17 22:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 22:31 [PATCH bpf-next v5 0/9] bpf: Support private stack for bpf progs Yonghong Song
2024-10-17 22:31 ` [PATCH bpf-next v5 1/9] bpf: Allow each subprog having stack size of 512 bytes Yonghong Song
2024-10-17 22:31 ` [PATCH bpf-next v5 2/9] bpf: Support private stack for struct_ops programs Yonghong Song
2024-10-17 22:31 ` Yonghong Song [this message]
2024-10-17 22:31 ` [PATCH bpf-next v5 4/9] bpf: Mark each subprog with proper private stack modes Yonghong Song
2024-10-17 22:32 ` [PATCH bpf-next v5 5/9] bpf, x86: Refactor func emit_prologue Yonghong Song
2024-10-17 22:32 ` [PATCH bpf-next v5 6/9] bpf, x86: Create a helper for certain "reg <op>= imm" operations Yonghong Song
2024-10-17 22:32 ` [PATCH bpf-next v5 7/9] bpf, x86: Add jit support for private stack Yonghong Song
2024-10-20 19:52 ` kernel test robot
2024-10-21 4:44 ` Yonghong Song
2024-10-17 22:32 ` [PATCH bpf-next v5 8/9] selftests/bpf: Add tracing prog private stack tests Yonghong Song
2024-10-17 22:32 ` [PATCH bpf-next v5 9/9] selftests/bpf: Add struct_ops " 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=20241017223154.3176602-1-yonghong.song@linux.dev \
--to=yonghong.song@linux.dev \
--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=tj@kernel.org \
/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