On Thu, 23 Oct 2025 22:42:08 +0200 Jiri Olsa <[email protected]> wrote:
> > > > > @@ -360,6 +362,9 @@ SYM_CODE_START(return_to_handler) > > > > > movq %rax, RAX(%rsp) > > > > > movq %rdx, RDX(%rsp) > > > > > movq %rbp, RBP(%rsp) > > > > > + movq %rsp, RSP(%rsp) > > > > > + movq $0, EFLAGS(%rsp) > > > > > + movq $__KERNEL_CS, CS(%rsp) > > > > > > > > Is this simulating some kind of interrupt? > > > > > > there are several checks in pt_regs on these fields > > > > > > - 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 has to > > > be set > > > > So this is a different issue. I rather have this added in > > kprobe_multi_link_prog_run as its the only user of it. Or have the > > there's also fprobe tracer that probably needs it as well > > > ftrace_regs conversion update it. This isn't something that should be done > > at every call and slow everyone else down. > > I think it's ok, but not sure where to get rsp value at that point, > perhaps we could just use the pt_regs address Oh, rsp is fine to add, as that's one of the items expected for ftrace_regs. It's the flags and CS that isn't needed. -- Steve
