lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240916121656.20933-B-hca@linux.ibm.com>
Date: Mon, 16 Sep 2024 14:16:56 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Vasily Gorbik <gor@...ux.ibm.com>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        linux-s390@...r.kernel.org,
        "Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
        Florent Revest <revest@...omium.org>,
        linux-trace-kernel@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH v14 04/19] function_graph: Replace fgraph_ret_regs with
 ftrace_regs

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@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ