Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

checkstack: add loongarch support for scripts/checkstack.pl

scripts/checkstack.pl lacks support for the loongarch architecture. Add
support to detect "addi.{w,d} $sp, $sp, -FRAME_SIZE" stack frame
generation instruction.

Link: https://lkml.kernel.org/r/MW4PR84MB314514273F0B7DBCC5E35A978192A@MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Youling Tang and committed by
Andrew Morton
d089622b d738bced

+4
+4
scripts/checkstack.pl
··· 16 16 # sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk> 17 17 # ppc64le port by Breno Leitao <leitao@debian.org> 18 18 # riscv port by Wadim Mueller <wafgo01@gmail.com> 19 + # loongarch port by Youling Tang <tangyouling@kylinos.cn> 19 20 # 20 21 # Usage: 21 22 # objdump -d vmlinux | scripts/checkstack.pl [arch] ··· 105 104 } elsif ($arch =~ /^riscv(64)?$/) { 106 105 #ffffffff8036e868: c2010113 addi sp,sp,-992 107 106 $re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o; 107 + } elsif ($arch =~ /^loongarch(32|64)?$/) { 108 + #9000000000224708: 02ff4063 addi.d $sp, $sp, -48(0xfd0) 109 + $re = qr/.*addi\..*sp, .*sp, -([0-9]{1,8}).*/o; 108 110 } else { 109 111 print("wrong or unknown architecture \"$arch\"\n"); 110 112 exit