Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-07 Thread Steven Rostedt
On Tue, 7 Nov 2023 08:48:44 -0500 Steven Rostedt wrote: > On Tue, 7 Nov 2023 14:43:28 +0900 > Masami Hiramatsu (Google) wrote: > > > > > > > It's only needed if an architecture supports direct trampolines. > > > > I see, and x86_64 needs it. > > OK, maybe better to keep it clear on

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-07 Thread Steven Rostedt
On Tue, 7 Nov 2023 14:43:28 +0900 Masami Hiramatsu (Google) wrote: > > > > It's only needed if an architecture supports direct trampolines. > > I see, and x86_64 needs it. > OK, maybe better to keep it clear on x86-64 even on the > return handler. As it is arch specific, I'm not sure it

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Google
On Mon, 6 Nov 2023 22:06:17 -0500 Steven Rostedt wrote: > On Tue, 7 Nov 2023 09:42:58 +0900 > Masami Hiramatsu (Google) wrote: > > > Got it. So does ftrace_regs need a placeholder for direct trampoline? > > (Or, can we use a register to pass it?) > > I think we don't need to clear it for

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Steven Rostedt
On Tue, 7 Nov 2023 09:42:58 +0900 Masami Hiramatsu (Google) wrote: > Got it. So does ftrace_regs need a placeholder for direct trampoline? > (Or, can we use a register to pass it?) > I think we don't need to clear it for return_to_handler() but if > `ftrace_regs` spec requires it, it is better

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Google
On Mon, 6 Nov 2023 11:37:10 -0500 Steven Rostedt wrote: > On Mon, 6 Nov 2023 10:05:49 +0900 > Masami Hiramatsu (Google) wrote: > > > So for x86-64, > > > > - rdi, rsi, rcx, rdx, r8, r9, and rsp > > - rax and rdx > > - rbp > > > > (BTW, why orig_rax is cleared?) > > You mean from

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Steven Rostedt
On Mon, 6 Nov 2023 10:05:49 +0900 Masami Hiramatsu (Google) wrote: > So for x86-64, > > - rdi, rsi, rcx, rdx, r8, r9, and rsp > - rax and rdx > - rbp > > (BTW, why orig_rax is cleared?) You mean from ftrace_caller? That's a "hack" to determine if we need to call the direct trampoline or

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Peter Zijlstra
On Mon, Nov 06, 2023 at 09:47:08PM +0900, Masami Hiramatsu wrote: > On Mon, 6 Nov 2023 11:19:32 +0100 > Peter Zijlstra wrote: > > > On Mon, Nov 06, 2023 at 09:38:50AM +0900, Masami Hiramatsu wrote: > > > On Sun, 5 Nov 2023 18:34:09 -0500 > > > Steven Rostedt wrote: > > > > > > > On Sun, 5 Nov

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Google
On Mon, 6 Nov 2023 11:19:32 +0100 Peter Zijlstra wrote: > On Mon, Nov 06, 2023 at 09:38:50AM +0900, Masami Hiramatsu wrote: > > On Sun, 5 Nov 2023 18:34:09 -0500 > > Steven Rostedt wrote: > > > > > On Sun, 5 Nov 2023 18:33:01 -0500 > > > Steven Rostedt wrote: > > > > > > > For x86_64, that

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Peter Zijlstra
On Mon, Nov 06, 2023 at 09:38:50AM +0900, Masami Hiramatsu wrote: > On Sun, 5 Nov 2023 18:34:09 -0500 > Steven Rostedt wrote: > > > On Sun, 5 Nov 2023 18:33:01 -0500 > > Steven Rostedt wrote: > > > > > For x86_64, that would be: > > > > > > rdi, rsi, rdx, r8, r9, rsp > > > > I missed rcx.

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Google
On Sun, 5 Nov 2023 18:33:01 -0500 Steven Rostedt wrote: > On Mon, 6 Nov 2023 00:17:34 +0100 > Peter Zijlstra wrote: > > > Changelog nor code made it clear this was partial anything. So this is > > still the partial thing? > > > > Can we then pretty clear clarify all that, and make it clear

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Google
On Sun, 5 Nov 2023 18:34:09 -0500 Steven Rostedt wrote: > On Sun, 5 Nov 2023 18:33:01 -0500 > Steven Rostedt wrote: > > > For x86_64, that would be: > > > > rdi, rsi, rdx, r8, r9, rsp > > I missed rcx. I would like to add rax to the list so that it can handle the return value too. :)

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Steven Rostedt
On Sun, 5 Nov 2023 18:33:01 -0500 Steven Rostedt wrote: > For x86_64, that would be: > > rdi, rsi, rdx, r8, r9, rsp I missed rcx. -- Steve

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Steven Rostedt
On Mon, 6 Nov 2023 00:17:34 +0100 Peter Zijlstra wrote: > Changelog nor code made it clear this was partial anything. So this is > still the partial thing? > > Can we then pretty clear clarify all that, and make it clear which regs > are in there? Because when I do 'vim -t ftrace_regs' it just

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Peter Zijlstra
On Sun, Nov 05, 2023 at 02:11:30PM -0500, Steven Rostedt wrote: > On Sun, 5 Nov 2023 18:25:36 +0100 > Peter Zijlstra wrote: > > > On Mon, Nov 06, 2023 at 01:11:21AM +0900, Masami Hiramatsu (Google) wrote: > > > From: Masami Hiramatsu (Google) > > > > > > Support HAVE_FUNCTION_GRAPH_FREGS on

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Steven Rostedt
On Sun, 5 Nov 2023 14:11:30 -0500 Steven Rostedt wrote: > You even Acked the patch: More specifically, you acked the series and stressed the ftrace_regs wrapper part when doing so: https://lore.kernel.org/all/20201113080733.gz2...@hirez.programming.kicks-ass.net/ > On Thu, Nov 12, 2020 at

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Steven Rostedt
On Sun, 5 Nov 2023 18:25:36 +0100 Peter Zijlstra wrote: > On Mon, Nov 06, 2023 at 01:11:21AM +0900, Masami Hiramatsu (Google) wrote: > > From: Masami Hiramatsu (Google) > > > > Support HAVE_FUNCTION_GRAPH_FREGS on x86-64, which saves ftrace_regs > > on the stack in ftrace_graph return

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Peter Zijlstra
On Mon, Nov 06, 2023 at 01:11:21AM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Support HAVE_FUNCTION_GRAPH_FREGS on x86-64, which saves ftrace_regs > on the stack in ftrace_graph return trampoline so that the callbacks > can access registers via ftrace_regs

[RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-05 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Support HAVE_FUNCTION_GRAPH_FREGS on x86-64, which saves ftrace_regs on the stack in ftrace_graph return trampoline so that the callbacks can access registers via ftrace_regs APIs. Note that this only recovers 'rax' and 'rdx' registers because other registers are