1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 09:32:12 +00:00
Jiri Olsa 20a0bc1027 x86/fgraph,bpf: Fix stack ORC unwind from kprobe_multi return probe
Currently we don't get stack trace via ORC unwinder on top of fgraph exit
handler. We can see that when generating stacktrace from kretprobe_multi
bpf program which is based on fprobe/fgraph.

The reason is that the ORC unwind code won't get pass the return_to_handler
callback installed by fgraph return probe machinery.

Solving this by creating stack frame in return_to_handler expected by
ftrace_graph_ret_addr function to recover original return address and
continue with the unwind.

Also updating the pt_regs data with cs/flags/rsp which are needed for
successful stack retrieval from ebpf bpf_get_stackid helper.
 - in get_perf_callchain we check user_mode(regs) so CS has to be set
 - in perf_callchain_kernel we call perf_hw_regs(regs), so EFLAGS/FIXED
    has to be unset

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20251104215405.168643-3-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2025-11-05 17:05:19 -08:00
..
2025-09-24 17:09:47 +02:00
2025-10-01 17:32:51 -07:00
2025-10-02 15:17:01 -07:00
2025-10-03 17:23:18 +02:00
2025-10-06 10:41:03 -07:00
2025-10-08 09:44:38 -07:00
2025-10-02 18:44:54 -07:00
2025-10-02 15:17:01 -07:00
2025-10-06 13:22:21 -07:00
2025-10-04 16:07:08 -07:00
2025-09-05 15:06:03 +02:00
2025-10-10 10:37:13 -07:00
2025-09-24 02:48:05 -07:00
2025-09-29 11:20:29 -07:00
2025-09-30 17:58:11 -07:00
2025-09-29 17:48:27 -07:00
2025-09-23 11:13:22 +02:00
2025-10-03 10:51:44 -07:00
2025-10-06 13:22:21 -07:00
2025-09-13 17:32:44 -07:00
2025-08-29 13:39:53 -07:00
2025-10-02 09:56:23 -07:00
2025-09-29 11:20:29 -07:00
2025-09-18 10:17:09 +02:00
2025-09-23 11:13:22 +02:00
2025-10-18 10:25:43 +02:00
2025-10-04 11:28:45 -07:00
2025-09-13 16:54:50 -07:00
2025-09-29 11:20:29 -07:00
2025-09-17 15:58:29 -04:00
2025-09-30 16:00:29 -07:00
2025-10-03 16:32:36 -07:00
2025-09-23 13:28:20 -04:00
2025-10-06 13:22:21 -07:00
2025-09-19 14:26:16 +02:00
2025-09-29 11:20:29 -07:00
2025-09-25 09:23:47 +02:00
2025-10-01 07:55:42 -05:00
2025-10-03 14:20:40 -07:00
2025-10-03 12:13:12 -05:00
2025-09-13 16:55:07 -07:00
2025-10-03 10:24:14 -07:00
2025-09-29 11:20:29 -07:00
2025-10-01 15:11:00 -07:00
2025-10-07 08:40:15 -07:00
2025-09-30 15:06:33 -07:00
2025-08-28 13:14:50 +02:00
2025-09-19 17:19:45 -07:00
2025-10-01 11:34:12 -07:00
2025-09-29 11:20:29 -07:00
2025-09-09 10:27:01 -06:00
2025-09-29 11:20:29 -07:00
2025-10-01 07:24:55 -04:00