From: Jiri Olsa <olsajiri@gmail.com>
To: Song Liu <song@kernel.org>
Cc: bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
live-patching@vger.kernel.org, ast@kernel.org,
daniel@iogearbox.net, andrii@kernel.org, rostedt@goodmis.org,
andrey.grodzovsky@crowdstrike.com, mhiramat@kernel.org,
kernel-team@meta.com, olsajiri@gmail.com
Subject: Re: [PATCH v3 bpf 0/3] Fix ftrace for livepatch + BPF fexit programs
Date: Mon, 27 Oct 2025 09:47:09 +0100 [thread overview]
Message-ID: <aP8xjR_ct9kn9yuf@krava> (raw)
In-Reply-To: <20251026205445.1639632-1-song@kernel.org>
On Sun, Oct 26, 2025 at 01:54:42PM -0700, Song Liu wrote:
> livepatch and BPF trampoline are two special users of ftrace. livepatch
> uses ftrace with IPMODIFY flag and BPF trampoline uses ftrace direct
> functions. When livepatch and BPF trampoline with fexit programs attach to
> the same kernel function, BPF trampoline needs to call into the patched
> version of the kernel function.
>
> 1/3 and 2/3 of this patchset fix two issues with livepatch + fexit cases,
> one in the register_ftrace_direct path, the other in the
> modify_ftrace_direct path.
>
> 3/3 adds selftests for both cases.
>
> ---
>
> Changes v2 => v3:
> 1. Incorporate feedback by AI, which also fixes build error reported by
> Steven and kernel test robot.
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
thanks,
jirka
>
> v2: https://lore.kernel.org/bpf/20251024182901.3247573-1-song@kernel.org/
>
> Changes v1 => v2:
> 1. Target bpf tree. (Alexei)
> 2. Bring back the FTRACE_WARN_ON in __ftrace_hash_update_ipmodify
> for valid code paths. (Steven)
> 3. Update selftests with cleaner way to find livepatch-sample.ko.
> (offlline discussion with Ihor)
>
> v1: https://lore.kernel.org/bpf/20251024071257.3956031-1-song@kernel.org/
>
> Song Liu (3):
> ftrace: Fix BPF fexit with livepatch
> ftrace: bpf: Fix IPMODIFY + DIRECT in modify_ftrace_direct()
> selftests/bpf: Add tests for livepatch + bpf trampoline
>
> kernel/bpf/trampoline.c | 5 -
> kernel/trace/ftrace.c | 46 ++++++--
> tools/testing/selftests/bpf/config | 3 +
> .../bpf/prog_tests/livepatch_trampoline.c | 107 ++++++++++++++++++
> .../bpf/progs/livepatch_trampoline.c | 30 +++++
> 5 files changed, 177 insertions(+), 14 deletions(-)
> create mode 100644 tools/testing/selftests/bpf/prog_tests/livepatch_trampoline.c
> create mode 100644 tools/testing/selftests/bpf/progs/livepatch_trampoline.c
>
> --
> 2.47.3
prev parent reply other threads:[~2025-10-27 8:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-26 20:54 [PATCH v3 bpf 0/3] Fix ftrace for livepatch + BPF fexit programs Song Liu
2025-10-26 20:54 ` [PATCH v3 bpf 1/3] ftrace: Fix BPF fexit with livepatch Song Liu
2025-10-27 8:48 ` Jiri Olsa
2025-10-27 17:10 ` Song Liu
2025-10-27 17:01 ` Steven Rostedt
2025-10-27 17:11 ` Song Liu
2025-10-26 20:54 ` [PATCH v3 bpf 2/3] ftrace: bpf: Fix IPMODIFY + DIRECT in modify_ftrace_direct() Song Liu
2025-10-26 20:54 ` [PATCH v3 bpf 3/3] selftests/bpf: Add tests for livepatch + bpf trampoline Song Liu
2025-10-27 8:47 ` Jiri Olsa [this message]
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=aP8xjR_ct9kn9yuf@krava \
--to=olsajiri@gmail.com \
--cc=andrey.grodzovsky@crowdstrike.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=song@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 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.