From: Hari Bathini <hbathini@linux.ibm.com>
To: Shung-Hsi Yu <shung-hsi.yu@suse.com>,
"Naveen N. Rao" <naveen@kernel.org>,
bpf@vger.kernel.org
Cc: "Michael Ellerman" <mpe@ellerman.id.au>,
"Mark Rutland" <mark.rutland@arm.com>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Masahiro Yamada" <masahiroy@kernel.org>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Masami Hiramatsu" <mhiramat@kernel.org>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"Vishal Chourasia" <vishalc@linux.ibm.com>,
"Mahesh J Salgaonkar" <mahesh@linux.ibm.com>,
"Miroslav Benes" <mbenes@suse.cz>,
"Michal Suchánek" <msuchanek@suse.de>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-trace-kernel@vger.kernel.org,
live-patching@vger.kernel.org
Subject: Re: [BUG?] ppc64le: fentry BPF not triggered after live patch (v6.14)
Date: Mon, 7 Apr 2025 13:46:19 +0530 [thread overview]
Message-ID: <873f3934-e964-49d4-a312-1debb1c77255@linux.ibm.com> (raw)
In-Reply-To: <rwmwrvvtg3pd7qrnt3of6dideioohwhsplancoc2gdrjran7bg@j5tqng6loymr>
Hi Shung-Hsi Yu
Thanks for reporting this.
On 31/03/25 6:49 pm, Shung-Hsi Yu wrote:
> Hi all,
>
> On ppc64le (v6.14, kernel config attached), I've observed that fentry
> BPF programs stop being invoked after the target kernel function is live
> patched. This occurs regardless of whether the BPF program was attached
> before or after the live patch. I believe fentry/fprobe on ppc64le is
> added with [1].
>
> Steps to reproduce on ppc64le:
> - Use bpftrace (v0.10.0+) to attach a BPF program to cmdline_proc_show
> with fentry (kfunc is the older name bpftrace used for fentry, used
> here for max compatability)
>
> bpftrace -e 'kfunc:cmdline_proc_show { printf("%lld: cmdline_proc_show() called by %s\n", nsecs(), comm) }'
>
> - Run `cat /proc/cmdline` and observe bpftrace output
>
> - Load samples/livepatch/livepatch-sample.ko
>
> - Run `cat /proc/cmdline` again. Observe "this has been live patched" in
> output, but no new bpftrace output.
>
> Note: once the live patching module is disabled through the sysfs interface
> the BPF program invocation is restored.
>
> Is this the expected interaction between fentry BPF and live patching?
> On x86_64 it does _not_ happen, so I'd guess the behavior on ppc64le is
> unintended. Any insights appreciated.
As Naveen updated in another thread already, this behavior is expected
as ppc64le does not handle it. Will take a stab at fixing it.
>
> Thanks,
> Shung-Hsi Yu
>
> 1: https://lore.kernel.org/all/20241030070850.1361304-2-hbathini@linux.ibm.com/
fwiw, the above patch was necessary for fentry, but the support was
complete with:
https://lore.kernel.org/all/20241018173632.277333-18-hbathini@linux.ibm.com/
Thanks
Hari
next prev parent reply other threads:[~2025-04-07 8:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 13:19 [BUG?] ppc64le: fentry BPF not triggered after live patch (v6.14) Shung-Hsi Yu
2025-03-31 14:09 ` Steven Rostedt
2025-04-01 12:48 ` Jiri Olsa
2025-04-03 15:26 ` Naveen N Rao
2025-04-03 18:33 ` Song Liu
2025-04-07 8:22 ` Hari Bathini
2025-10-02 19:45 ` Hari Bathini
2025-04-07 8:16 ` Hari Bathini [this message]
2025-04-07 8:42 ` Viktor Malik
2025-04-16 19:24 ` Hari Bathini
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=873f3934-e964-49d4-a312-1debb1c77255@linux.ibm.com \
--to=hbathini@linux.ibm.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=daniel@iogearbox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=live-patching@vger.kernel.org \
--cc=mahesh@linux.ibm.com \
--cc=mark.rutland@arm.com \
--cc=masahiroy@kernel.org \
--cc=mbenes@suse.cz \
--cc=mhiramat@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
--cc=rostedt@goodmis.org \
--cc=shung-hsi.yu@suse.com \
--cc=vishalc@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).