linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkstack: add riscv support for scripts/checkstack.pl
@ 2022-07-13 19:41 Wadim Mueller
  2022-07-25 17:40 ` Conor.Dooley
  0 siblings, 1 reply; 4+ messages in thread
From: Wadim Mueller @ 2022-07-13 19:41 UTC (permalink / raw)
  Cc: Wadim Mueller, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	linux-kernel, linux-riscv

scripts/checkstack.pl lacks support for the riscv architecture. Add
support to detect "addi sp,sp,-FRAME_SIZE" stack frame generation instruction

Signed-off-by: Wadim Mueller <wafgo01@gmail.com>
---
 scripts/checkstack.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index d2c38584ece6..d48dfed6d3db 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -16,6 +16,7 @@
 #	AArch64, PARISC ports by Kyle McMartin
 #	sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
 #	ppc64le port by Breno Leitao <leitao@debian.org>
+#	riscv port by Wadim Mueller <wafgo01@gmail.com>
 #
 #	Usage:
 #	objdump -d vmlinux | scripts/checkstack.pl [arch]
@@ -108,6 +109,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack);
 	} elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
 		# f0019d10:       9d e3 bf 90     save  %sp, -112, %sp
 		$re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
+	} elsif ($arch =~ /^riscv(64)?$/) {
+		#ffffffff8036e868:	c2010113          	addi	sp,sp,-992
+		$re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
 	} else {
 		print("wrong or unknown architecture \"$arch\"\n");
 		exit
-- 
2.25.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] checkstack: add riscv support for scripts/checkstack.pl
  2022-07-13 19:41 [PATCH] checkstack: add riscv support for scripts/checkstack.pl Wadim Mueller
@ 2022-07-25 17:40 ` Conor.Dooley
  2022-07-26  4:47   ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: Conor.Dooley @ 2022-07-25 17:40 UTC (permalink / raw)
  To: wafgo01; +Cc: paul.walmsley, palmer, aou, linux-kernel, linux-riscv, masahiroy

On 13/07/2022 20:41, Wadim Mueller wrote:
> [You don't often get email from wafgo01@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 

I feel like you might've been mislead by get_maintainer for this
patch. It looks like the maintainer covering this is Masahiro
Yamada <masahiroy@kernel.org> (at least he's taken the last few
patches for it).

I'll be honest, I don't know how to verify that the output is
correct - but I did run it & it does output something that looks
sane /shrug

Thanks,
Conor.

> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> scripts/checkstack.pl lacks support for the riscv architecture. Add
> support to detect "addi sp,sp,-FRAME_SIZE" stack frame generation instruction
> 
> Signed-off-by: Wadim Mueller <wafgo01@gmail.com>
> ---
>  scripts/checkstack.pl | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
> index d2c38584ece6..d48dfed6d3db 100755
> --- a/scripts/checkstack.pl
> +++ b/scripts/checkstack.pl
> @@ -16,6 +16,7 @@
>  #      AArch64, PARISC ports by Kyle McMartin
>  #      sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
>  #      ppc64le port by Breno Leitao <leitao@debian.org>
> +#      riscv port by Wadim Mueller <wafgo01@gmail.com>
>  #
>  #      Usage:
>  #      objdump -d vmlinux | scripts/checkstack.pl [arch]
> @@ -108,6 +109,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack);
>         } elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
>                 # f0019d10:       9d e3 bf 90     save  %sp, -112, %sp
>                 $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
> +       } elsif ($arch =~ /^riscv(64)?$/) {
> +               #ffffffff8036e868:      c2010113                addi    sp,sp,-992
> +               $re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
>         } else {
>                 print("wrong or unknown architecture \"$arch\"\n");
>                 exit
> --
> 2.25.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] checkstack: add riscv support for scripts/checkstack.pl
  2022-07-25 17:40 ` Conor.Dooley
@ 2022-07-26  4:47   ` Masahiro Yamada
  2022-07-26 20:11     ` Wadim Mueller
  0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2022-07-26  4:47 UTC (permalink / raw)
  To: Conor.Dooley
  Cc: wafgo01, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Linux Kernel Mailing List, open list:SIFIVE DRIVERS

On Tue, Jul 26, 2022 at 2:40 AM <Conor.Dooley@microchip.com> wrote:
>
> On 13/07/2022 20:41, Wadim Mueller wrote:
> > [You don't often get email from wafgo01@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> >
>
> I feel like you might've been mislead by get_maintainer for this
> patch. It looks like the maintainer covering this is Masahiro
> Yamada <masahiroy@kernel.org> (at least he's taken the last few
> patches for it).


I can pick this up.

Applied to linux-kbuild. Thanks.


>
> I'll be honest, I don't know how to verify that the output is
> correct - but I did run it & it does output something that looks
> sane /shrug
>
> Thanks,
> Conor.
>
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> >
> > scripts/checkstack.pl lacks support for the riscv architecture. Add
> > support to detect "addi sp,sp,-FRAME_SIZE" stack frame generation instruction
> >
> > Signed-off-by: Wadim Mueller <wafgo01@gmail.com>
> > ---
> >  scripts/checkstack.pl | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
> > index d2c38584ece6..d48dfed6d3db 100755
> > --- a/scripts/checkstack.pl
> > +++ b/scripts/checkstack.pl
> > @@ -16,6 +16,7 @@
> >  #      AArch64, PARISC ports by Kyle McMartin
> >  #      sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
> >  #      ppc64le port by Breno Leitao <leitao@debian.org>
> > +#      riscv port by Wadim Mueller <wafgo01@gmail.com>
> >  #
> >  #      Usage:
> >  #      objdump -d vmlinux | scripts/checkstack.pl [arch]
> > @@ -108,6 +109,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack);
> >         } elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
> >                 # f0019d10:       9d e3 bf 90     save  %sp, -112, %sp
> >                 $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
> > +       } elsif ($arch =~ /^riscv(64)?$/) {
> > +               #ffffffff8036e868:      c2010113                addi    sp,sp,-992
> > +               $re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
> >         } else {
> >                 print("wrong or unknown architecture \"$arch\"\n");
> >                 exit
> > --
> > 2.25.1
> >
> >
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv
>


-- 
Best Regards
Masahiro Yamada

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] checkstack: add riscv support for scripts/checkstack.pl
  2022-07-26  4:47   ` Masahiro Yamada
@ 2022-07-26 20:11     ` Wadim Mueller
  0 siblings, 0 replies; 4+ messages in thread
From: Wadim Mueller @ 2022-07-26 20:11 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Conor.Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Linux Kernel Mailing List, open list:SIFIVE DRIVERS

Hi Conor, Hi Masahiro,

thank you for your support. Your help is much appreciated.

Best Regards
Wadim

On Tue, Jul 26, 2022 at 01:47:47PM +0900, Masahiro Yamada wrote:
> On Tue, Jul 26, 2022 at 2:40 AM <Conor.Dooley@microchip.com> wrote:
> >
> > On 13/07/2022 20:41, Wadim Mueller wrote:
> > > [You don't often get email from wafgo01@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> > >
> >
> > I feel like you might've been mislead by get_maintainer for this
> > patch. It looks like the maintainer covering this is Masahiro
> > Yamada <masahiroy@kernel.org> (at least he's taken the last few
> > patches for it).
> 
> 
> I can pick this up.
> 
> Applied to linux-kbuild. Thanks.
> 
> 
> >
> > I'll be honest, I don't know how to verify that the output is
> > correct - but I did run it & it does output something that looks
> > sane /shrug
> >
> > Thanks,
> > Conor.
> >
> > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > >
> > > scripts/checkstack.pl lacks support for the riscv architecture. Add
> > > support to detect "addi sp,sp,-FRAME_SIZE" stack frame generation instruction
> > >
> > > Signed-off-by: Wadim Mueller <wafgo01@gmail.com>
> > > ---
> > >  scripts/checkstack.pl | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
> > > index d2c38584ece6..d48dfed6d3db 100755
> > > --- a/scripts/checkstack.pl
> > > +++ b/scripts/checkstack.pl
> > > @@ -16,6 +16,7 @@
> > >  #      AArch64, PARISC ports by Kyle McMartin
> > >  #      sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
> > >  #      ppc64le port by Breno Leitao <leitao@debian.org>
> > > +#      riscv port by Wadim Mueller <wafgo01@gmail.com>
> > >  #
> > >  #      Usage:
> > >  #      objdump -d vmlinux | scripts/checkstack.pl [arch]
> > > @@ -108,6 +109,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack);
> > >         } elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
> > >                 # f0019d10:       9d e3 bf 90     save  %sp, -112, %sp
> > >                 $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
> > > +       } elsif ($arch =~ /^riscv(64)?$/) {
> > > +               #ffffffff8036e868:      c2010113                addi    sp,sp,-992
> > > +               $re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
> > >         } else {
> > >                 print("wrong or unknown architecture \"$arch\"\n");
> > >                 exit
> > > --
> > > 2.25.1
> > >
> > >
> > > _______________________________________________
> > > linux-riscv mailing list
> > > linux-riscv@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-riscv
> >
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-26 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-13 19:41 [PATCH] checkstack: add riscv support for scripts/checkstack.pl Wadim Mueller
2022-07-25 17:40 ` Conor.Dooley
2022-07-26  4:47   ` Masahiro Yamada
2022-07-26 20:11     ` Wadim Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).