linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG?] ppc64le: fentry BPF not triggered after live patch (v6.14)
@ 2025-03-31 13:19 Shung-Hsi Yu
  2025-03-31 14:09 ` Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Shung-Hsi Yu @ 2025-03-31 13:19 UTC (permalink / raw)
  To: Naveen N. Rao, Hari Bathini, bpf
  Cc: Michael Ellerman, Mark Rutland, Daniel Borkmann, Masahiro Yamada,
	Nicholas Piggin, Alexei Starovoitov, Steven Rostedt,
	Masami Hiramatsu, Andrii Nakryiko, Christophe Leroy,
	Vishal Chourasia, Mahesh J Salgaonkar, Miroslav Benes,
	Michal Suchánek, linux-kernel, linuxppc-dev,
	linux-trace-kernel, live-patching

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.


Thanks,
Shung-Hsi Yu

1: https://lore.kernel.org/all/20241030070850.1361304-2-hbathini@linux.ibm.com/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-10-02 19:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-04-07  8:42 ` Viktor Malik
2025-04-16 19:24   ` Hari Bathini

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).