All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkstack.pl: fix for aarch64
@ 2018-12-07 19:58 Qian Cai
  2018-12-07 20:24 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Qian Cai @ 2018-12-07 19:58 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, Qian Cai

There is actually a space after "sp," like this,

ffff2000080813c8:       a9bb7bfd        stp     x29, x30, [sp, #-80]!

Signed-off-by: Qian Cai <cai@lca.pw>
---
 scripts/checkstack.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 8081b6cf67d2..34414c6efad6 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -47,8 +47,8 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
 	$xs	= "[0-9a-f ]";	# hex character or space
 	$funcre = qr/^$x* <(.*)>:$/;
 	if ($arch eq 'aarch64') {
-		#ffffffc0006325cc:       a9bb7bfd        stp     x29, x30, [sp,#-80]!
-		$re = qr/^.*stp.*sp,\#-([0-9]{1,8})\]\!/o;
+		#ffffffc0006325cc:       a9bb7bfd        stp     x29, x30, [sp, #-80]!
+		$re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o;
 	} elsif ($arch eq 'arm') {
 		#c0008ffc:	e24dd064	sub	sp, sp, #100	; 0x64
 		$re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
-- 
2.17.2 (Apple Git-113)


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

* Re: [PATCH] checkstack.pl: fix for aarch64
  2018-12-07 19:58 [PATCH] checkstack.pl: fix for aarch64 Qian Cai
@ 2018-12-07 20:24 ` Andrew Morton
  2018-12-07 20:46   ` Qian Cai
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2018-12-07 20:24 UTC (permalink / raw)
  To: Qian Cai; +Cc: linux-kernel

On Fri,  7 Dec 2018 14:58:43 -0500 Qian Cai <cai@lca.pw> wrote:

> There is actually a space after "sp," like this,
> 
> ffff2000080813c8:       a9bb7bfd        stp     x29, x30, [sp, #-80]!
> 

Confused.  Why does this matter?  Why is the patched version superior?

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

* Re: [PATCH] checkstack.pl: fix for aarch64
  2018-12-07 20:24 ` Andrew Morton
@ 2018-12-07 20:46   ` Qian Cai
  0 siblings, 0 replies; 3+ messages in thread
From: Qian Cai @ 2018-12-07 20:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On Fri, 2018-12-07 at 12:24 -0800, Andrew Morton wrote:
> On Fri,  7 Dec 2018 14:58:43 -0500 Qian Cai <cai@lca.pw> wrote:
> 
> > There is actually a space after "sp," like this,
> > 
> > ffff2000080813c8:       a9bb7bfd        stp     x29, x30, [sp, #-80]!
> > 
> 
> Confused.  Why does this matter?  Why is the patched version superior?

<Resend in plain text.>

Right now, checkstack.pl won’t be able to  print anything on aarch64, because it
won’t be able to match the stating objdump line of a function due to this
missing space. Hence, it saw every stack is zero-size.

After applied this patch, checkpatch.pl is able to match the start of a
function’s objdump, and then be able to calculate each function’s stack
correctly.

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-07 19:58 [PATCH] checkstack.pl: fix for aarch64 Qian Cai
2018-12-07 20:24 ` Andrew Morton
2018-12-07 20:46   ` Qian Cai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.