From: Heiko Carstens <hca@linux.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
linux-s390@vger.kernel.org,
"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
Florent Revest <revest@chromium.org>,
linux-trace-kernel@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Alexei Starovoitov <ast@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH v14 04/19] function_graph: Replace fgraph_ret_regs with ftrace_regs
Date: Mon, 16 Sep 2024 14:16:56 +0200 [thread overview]
Message-ID: <20240916121656.20933-B-hca@linux.ibm.com> (raw)
In-Reply-To: <20240915051559.435abfcd@rorschach.local.home>
On Sun, Sep 15, 2024 at 05:15:59AM -0400, Steven Rostedt wrote:
>
> Can I get an Acked-by from the S390 maintainers for this patch?
...
> > +static __always_inline unsigned long
> > +ftrace_regs_get_frame_pointer(struct ftrace_regs *fregs)
> > +{
> > + unsigned long *sp;
> > +
> > + sp = (void *)ftrace_regs_get_stack_pointer(fregs);
> > + return sp[0]; /* return backchain */
> > +}
> > +
...
> > diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
> > index ae4d4fd9afcd..cda798b976de 100644
> > --- a/arch/s390/kernel/mcount.S
> > +++ b/arch/s390/kernel/mcount.S
> > @@ -133,14 +133,15 @@ SYM_CODE_END(ftrace_common)
> > SYM_FUNC_START(return_to_handler)
> > stmg %r2,%r5,32(%r15)
> > lgr %r1,%r15
> > - aghi %r15,-(STACK_FRAME_OVERHEAD+__FGRAPH_RET_SIZE)
> > +# Allocate ftrace_regs + backchain on the stack
> > + aghi %r15,-STACK_FRAME_SIZE_FREGS
> > stg %r1,__SF_BACKCHAIN(%r15)
> > la %r3,STACK_FRAME_OVERHEAD(%r15)
> > - stg %r1,__FGRAPH_RET_FP(%r3)
> > - stg %r2,__FGRAPH_RET_GPR2(%r3)
> > + stg %r2,(__SF_GPRS+2*8)(%r15)
> > + stg %r15,(__SF_GPRS+15*8)(%r15)
> > lgr %r2,%r3
> > brasl %r14,ftrace_return_to_handler
> > - aghi %r15,STACK_FRAME_OVERHEAD+__FGRAPH_RET_SIZE
> > + aghi %r15,STACK_FRAME_SIZE_FREGS
This does not pass the ftrace selftests. Please merge the patch below
into this patch. With that:
Acked-by: Heiko Carstens <hca@linux.ibm.com>
diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h
index 7b80ff4d3386..df5a0f8d3445 100644
--- a/arch/s390/include/asm/ftrace.h
+++ b/arch/s390/include/asm/ftrace.h
@@ -78,10 +78,7 @@ ftrace_regs_set_instruction_pointer(struct ftrace_regs *fregs,
static __always_inline unsigned long
ftrace_regs_get_frame_pointer(struct ftrace_regs *fregs)
{
- unsigned long *sp;
-
- sp = (void *)ftrace_regs_get_stack_pointer(fregs);
- return sp[0]; /* return backchain */
+ return ftrace_regs_get_stack_pointer(fregs);
}
static __always_inline unsigned long
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
index cda798b976de..10b08e617306 100644
--- a/arch/s390/kernel/mcount.S
+++ b/arch/s390/kernel/mcount.S
@@ -133,13 +133,12 @@ SYM_CODE_END(ftrace_common)
SYM_FUNC_START(return_to_handler)
stmg %r2,%r5,32(%r15)
lgr %r1,%r15
-# Allocate ftrace_regs + backchain on the stack
+ # allocate ftrace_regs and stack frame for ftrace_return_to_handler
aghi %r15,-STACK_FRAME_SIZE_FREGS
stg %r1,__SF_BACKCHAIN(%r15)
- la %r3,STACK_FRAME_OVERHEAD(%r15)
- stg %r2,(__SF_GPRS+2*8)(%r15)
- stg %r15,(__SF_GPRS+15*8)(%r15)
- lgr %r2,%r3
+ stg %r2,(STACK_FREGS_PTREGS_GPRS+2*8)(%r15)
+ stg %r1,(STACK_FREGS_PTREGS_GPRS+15*8)(%r15)
+ la %r2,STACK_FRAME_OVERHEAD(%r15)
brasl %r14,ftrace_return_to_handler
aghi %r15,STACK_FRAME_SIZE_FREGS
lgr %r14,%r2
next prev parent reply other threads:[~2024-09-16 12:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <172615368656.133222.2336770908714920670.stgit@devnote2>
[not found] ` <172615373091.133222.1812791604518973124.stgit@devnote2>
2024-09-15 9:15 ` [PATCH v14 04/19] function_graph: Replace fgraph_ret_regs with ftrace_regs Steven Rostedt
2024-09-16 12:16 ` Heiko Carstens [this message]
2024-09-16 16:29 ` Steven Rostedt
2024-09-16 18:59 ` Heiko Carstens
2024-10-01 12:55 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240916121656.20933-B-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=acme@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=ast@kernel.org \
--cc=borntraeger@linux.ibm.com \
--cc=daniel@iogearbox.net \
--cc=gor@linux.ibm.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=revest@chromium.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox