Thread (9 messages) 9 messages, 4 authors, 2026-01-08

Re: [PATCH bpf-next 1/2] arm64/ftrace,bpf: Fix partial regs after bpf_prog_run

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2026-01-07 16:07:58
Also in: bpf, linux-trace-kernel

On Wed, 7 Jan 2026 14:16:05 +0000
Will Deacon [off-list ref] wrote:
I still don't understand why we need anything new in the arch code for this.

We've selected HAVE_ARCH_FTRACE_REGS and we implement
ftrace_regs_set_instruction_pointer() and ftrace_regs_set_return_value()
so the core code already has everything it needs to make this work
without additional arch support.
I believe the issue is that the BPF code takes a pt_regs and does the
update directly with that, and not the ftrace_regs.

I'm guessing this is due to BPF programs modifying the pt_regs directly,
and BPF programs do not yet understand ftrace_regs?

Because arm64 requires making a copy of pt_regs as the ftrace_regs has a
different layout, and the ftrace_regs is what does the changes, if the
pt_regs passed to the BPF program modifies the values it needs a way to
propagate that back to the ftrace_regs.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help