From: Heiko Carstens <hca@linux.ibm.com>
To: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
daniel@iogearbox.net, kafai@meta.com, kernel-team@meta.com,
eddyz87@gmail.com, memxor@gmail.com,
Mykyta Yatsenko <yatsenko@meta.com>,
Ilya Leoshkevich <iii@linux.ibm.com>,
Maxim Khmelevskii <max@linux.ibm.com>
Subject: Re: [PATCH bpf-next v8 7/9] bpf: task work scheduling kfuncs
Date: Fri, 24 Jul 2026 17:29:05 +0200 [thread overview]
Message-ID: <20260724152905.220718B7d-hca@linux.ibm.com> (raw)
In-Reply-To: <ee9e9748-c791-44a6-a1eb-b6973f304b1f@gmail.com>
On Fri, Jul 24, 2026 at 02:06:58PM +0100, Mykyta Yatsenko wrote:
> On 7/24/26 12:22 PM, Heiko Carstens wrote:
> > On Tue, Sep 23, 2025 at 12:24:02PM +0100, Mykyta Yatsenko wrote:
> >> From: Mykyta Yatsenko <yatsenko@meta.com>
> >>
> >> Implementation of the new bpf_task_work_schedule kfuncs, that let a BPF
> >> program schedule task_work callbacks for a target task:
> >> * bpf_task_work_schedule_signal() - schedules with TWA_SIGNAL
> >> * bpf_task_work_schedule_resume() - schedules with TWA_RESUME
> >
> > ...
> >
> >> Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
> >> Reviewed-by: Andrii Nakryiko <andrii@kernel.org>
> >> Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
> >> Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> >> ---
> >> kernel/bpf/helpers.c | 292 ++++++++++++++++++++++++++++++++++++++++++-
> >> 1 file changed, 290 insertions(+), 2 deletions(-)
> >
> > ...
> >
> >> +static void bpf_task_work_callback(struct callback_head *cb)
> >> +{
> > ...
> >> + migrate_disable();
> >> + ctx->callback_fn(ctx->map, key, ctx->map_val);
> >> + migrate_enable();
> >
> > The above indirect call results in a CFI failure - while trying to make kCFI
> > work on s390, and running the bpf selftests I stumbled across this, which can
> > also be reproduced on x86:
> >
>
> Thanks for reporting, I'll take a look.
FWIW, there is another thing to consider: architectures which select
ARCH_SUPPORTS_CFI only optionally need to support kCFI for BPF.
In order to avoid CFI failures because of missing CFI hashes of BPF programs,
functions which call such programs indirectly need to have the overridable
__bpfcall attribute. So something like this is required as well:
-static void bpf_task_work_callback(struct callback_head *cb)
+static __bpfcall void bpf_task_work_callback(struct callback_head *cb)
next prev parent reply other threads:[~2026-07-24 15:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 11:23 [PATCH bpf-next v8 0/9] bpf: Introduce deferred task context execution Mykyta Yatsenko
2025-09-23 11:23 ` [PATCH bpf-next v8 1/9] bpf: refactor special field-type detection Mykyta Yatsenko
2025-09-23 11:23 ` [PATCH bpf-next v8 2/9] bpf: extract generic helper from process_timer_func() Mykyta Yatsenko
2025-09-23 11:23 ` [PATCH bpf-next v8 3/9] bpf: htab: extract helper for freeing special structs Mykyta Yatsenko
2025-09-23 11:23 ` [PATCH bpf-next v8 4/9] bpf: verifier: permit non-zero returns from async callbacks Mykyta Yatsenko
2025-09-23 11:24 ` [PATCH bpf-next v8 5/9] bpf: bpf task work plumbing Mykyta Yatsenko
2025-09-23 11:24 ` [PATCH bpf-next v8 6/9] bpf: extract map key pointer calculation Mykyta Yatsenko
2025-09-23 11:24 ` [PATCH bpf-next v8 7/9] bpf: task work scheduling kfuncs Mykyta Yatsenko
2026-07-24 11:22 ` Heiko Carstens
2026-07-24 13:06 ` Mykyta Yatsenko
2026-07-24 15:29 ` Heiko Carstens [this message]
2025-09-23 11:24 ` [PATCH bpf-next v8 8/9] selftests/bpf: BPF task work scheduling tests Mykyta Yatsenko
2025-09-23 14:59 ` Alexei Starovoitov
2025-09-23 15:50 ` Ihor Solodrai
2025-09-23 11:24 ` [PATCH bpf-next v8 9/9] selftests/bpf: add bpf task work stress tests Mykyta Yatsenko
2025-09-23 15:20 ` [PATCH bpf-next v8 0/9] bpf: Introduce deferred task context execution 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=20260724152905.220718B7d-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=iii@linux.ibm.com \
--cc=kafai@meta.com \
--cc=kernel-team@meta.com \
--cc=max@linux.ibm.com \
--cc=memxor@gmail.com \
--cc=mykyta.yatsenko5@gmail.com \
--cc=yatsenko@meta.com \
/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.