Received: by 10.223.164.202 with SMTP id h10csp3500177wrb; Tue, 28 Nov 2017 12:19:23 -0800 (PST) X-Google-Smtp-Source: AGs4zMY/BDch24ms0UOofp08IHXVdgCszXDsQ83DiajKPgNRmO2sM/HGkI2uy+aSicnawyX8Kvzv X-Received: by 10.98.89.4 with SMTP id n4mr356586pfb.133.1511900363166; Tue, 28 Nov 2017 12:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511900363; cv=none; d=google.com; s=arc-20160816; b=0ZqT6SRjpVI651+YOm6n/Hj/A6sxql1o03LFI1JijFS17IpKeLB/wzIE27+vj24+H4 /ZlfC1kLH1/fYN4RoXL2GE8Sn3nV2Nuk2NsCItOWuAYMRkcxBCW6NEHce6DHsb2XdFOg BL1XubQhPNr9OgVCSh9XKptaFfoIlPNaRJuCT5wnRCdkdFdAeXr9XNeZ7zALR7J9ozgO wyh69YBEm34Ram1vyRidzArMLANZt2y8hYXorlQBt46Y8Nf+9GQQ+ZL5yAAFdIJOsspe goqKchJgu9E1ZW33aszRH8jMNtS8zy/rraHmvkclG1IH47oELPj0i7K3Vb0Q4T5fqpth uUBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=b7vMZ4uN+XrefWOYBT/JfaEPIvxKl96pGuxdGcUPcMU=; b=vE1T40ivvHFLbes7jpx7dNrWUAF7j5pk41CMfJ+4/eC/O81RVL3fYYXPRsLR38Mnuc rvqP0OkDSWfq0HweiVtw4Zu4kVwxeynypeRRr8y4CJZr7WBtLAzYRrOSfR1aWRiclYUD KZfx9VzL+6JTEPqn1A3tKN134Pg44BabNwTBdRvc5wFxKEKExlR2r968DqZFszA+ja/y JI3sGL1/oG3nOcRIMb3pTsoyScV5Nr4m6vJutv8hPszi84RKJK2AAo/UwGkoajpIONOJ ZWrdLSkG1Wdew0wWz8pkE+C38tdmVquTIPL9pTyQY0d7JnZyIaMxU19ZHmbOgmMVQ7jZ CTnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si131969pgr.822.2017.11.28.12.19.12; Tue, 28 Nov 2017 12:19:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754055AbdK1TcQ (ORCPT + 72 others); Tue, 28 Nov 2017 14:32:16 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60636 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752394AbdK1TcO (ORCPT ); Tue, 28 Nov 2017 14:32:14 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vASJTTcR118866 for ; Tue, 28 Nov 2017 14:32:13 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ehbgb7cfh-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 28 Nov 2017 14:32:13 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 28 Nov 2017 14:32:12 -0500 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 28 Nov 2017 14:32:10 -0500 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vASJWAJb37421098; Tue, 28 Nov 2017 19:32:10 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EADB2112034; Tue, 28 Nov 2017 14:30:32 -0500 (EST) Received: from debra.br.ibm.com (unknown [9.18.239.81]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id 5F8CD112047; Tue, 28 Nov 2017 14:30:32 -0500 (EST) From: Breno Leitao To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: Breno Leitao Subject: [PATCH] scripts: Add ppc64le support for checkstack.pl Date: Tue, 28 Nov 2017 17:29:34 -0200 X-Mailer: git-send-email 1.9.3 X-TM-AS-GCONF: 00 x-cbid: 17112819-0048-0000-0000-0000020C6B10 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008121; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000242; SDB=6.00952553; UDB=6.00481218; IPR=6.00732634; BA=6.00005719; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018231; XFM=3.00000015; UTC=2017-11-28 19:32:12 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112819-0049-0000-0000-0000434E1837 Message-Id: <1511897374-27408-1-git-send-email-leitao@debian.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-28_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711280261 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 64-bit ELF v2 ABI specification for POWER describes, on section "General Stack Frame Requirements", that the stack should use the following instructions when compiled with backchain: mflr r0 std r0, 16(r1) stdu r1, -XX(r1) Where XX is the frame size for that function, and this is the value checkstack.pl will find the stack size for each function. This patch also simplifies the entire Powerpc section, since just two type of instructions are used, 'stdu' for 64 bits and 'stwu' for 32 bits platform. Signed-off-by: Breno Leitao --- scripts/checkstack.pl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 7f4c41717e26..8ed217ddf2c9 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl @@ -14,6 +14,7 @@ # M68k port by Geert Uytterhoeven and Andreas Schwab # AArch64, PARISC ports by Kyle McMartin # sparc port by Martin Habets +# ppc64le port by Breno Leitao # # Usage: # objdump -d vmlinux | scripts/checkstack.pl [arch] @@ -81,13 +82,9 @@ my (@stack, $re, $dre, $x, $xs, $funcre); $re = qr/.*l\.addi.*r1,r1,-(([0-9]{2}|[3-9])[0-9]{2})/o; } elsif ($arch eq 'parisc' || $arch eq 'parisc64') { $re = qr/.*ldo ($x{1,8})\(sp\),sp/o; - } elsif ($arch eq 'ppc') { - #c00029f4: 94 21 ff 30 stwu r1,-208(r1) - $re = qr/.*stwu.*r1,-($x{1,8})\(r1\)/o; - } elsif ($arch eq 'ppc64') { - #XXX - $re = qr/.*stdu.*r1,-($x{1,8})\(r1\)/o; - } elsif ($arch eq 'powerpc') { + } elsif ($arch eq 'powerpc' || $arch =~ /^ppc(64)?(le)?$/ ) { + # powerpc : 94 21 ff 30 stwu r1,-208(r1) + # ppc64(le) : 81 ff 21 f8 stdu r1,-128(r1) $re = qr/.*st[dw]u.*r1,-($x{1,8})\(r1\)/o; } elsif ($arch =~ /^s390x?$/) { # 11160: a7 fb ff 60 aghi %r15,-160 -- 2.15.0 From 1585347292523101026@xxx Tue Nov 28 21:36:35 +0000 2017 X-GM-THRID: 1585347292523101026 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread