Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp788362ybj; Thu, 7 May 2020 07:40:20 -0700 (PDT) X-Google-Smtp-Source: APiQypJjOtmcCqOGMsc0MX8pIpW1zs6ZNwdj8DQ6cZzpvCxqTbWwjXk3mBJG2eDzQQnvq66pB5kC X-Received: by 2002:a05:6402:31b6:: with SMTP id dj22mr12472582edb.258.1588862420338; Thu, 07 May 2020 07:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588862420; cv=none; d=google.com; s=arc-20160816; b=SPzEJgygABSM3X7ScwKI2gjRQqkC4UBR8mlJxbEJ7CL5gT/N5Z0VIam5bfoNaIa9bU e31hqFtYPj2AATVDNGPCv/x6EZSQBfdMnWo5860ryvXjl8JDbJjGsbFx2KM5glwF52Vs DLb8lacClLDIF1rVTnpR3mAGVlJpYUkoCztzpeqhyllIIiWpWbRclgj7RY/trXsXp9fH hug0Gp7C8BZUs0+iuSoW34qxaPr6QRpHqqx56o2RAtssa0++8ZpTLtXBfgHs6jeIP7tX YwNrwaY48YOZcnVuaD8j8MiyzP0tC+CN2Ikqw1q4Cy19tJMhv3UB7zzlPL1wggOgAOLP xIJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:date:message-id:in-reply-to:cc:to:from :reply-to:subject:mime-version:dkim-signature:dkim-filter; bh=2Awnxc2MzaUIX6t7iwEDNHg3jVhYVQkwPUQrJI6Ykcw=; b=Vj7cewN+7xA8gtPTZOCKK6PL6dtiaNwTpKgUgu+qJECuCfs3KbiuwT/2BoOCHsAsNV l8T9VTDpyuQY87NxkBg2oDMULYmc6N7dVSkfvtRcJLKIVZv6BPPImKk/vupIxauGTkqT iBprzemgzXZmDgnyqYAkhODvCmHXrZOr88XmCPa4+vRdzrsfTkcAVXockZqNq8/DI4d9 K5jgKAQQ9cnTtDSvkKSHuUtkLclum4Gf3I7pPDLTQslGTyEy77FDSp1xISoztQdfqned niKQv7taQXre+3QTVA8oH+nSEUoug0i2Q9d/iaP4XV7DQcntEudlt5IecNFTTufyVso/ CQkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VfPcGUmj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si2649662edd.195.2020.05.07.07.39.57; Thu, 07 May 2020 07:40:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VfPcGUmj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728835AbgEGOfz (ORCPT + 99 others); Thu, 7 May 2020 10:35:55 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:55880 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728165AbgEGOfu (ORCPT ); Thu, 7 May 2020 10:35:50 -0400 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200507143548epoutp01e6a7c3555a260fdb1f24255e95312d76~MxbSuKm2_1666116661epoutp01e for ; Thu, 7 May 2020 14:35:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200507143548epoutp01e6a7c3555a260fdb1f24255e95312d76~MxbSuKm2_1666116661epoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1588862148; bh=2Awnxc2MzaUIX6t7iwEDNHg3jVhYVQkwPUQrJI6Ykcw=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=VfPcGUmj28bMrAH6jX6qDq6XevZ0RIQ7bQunfqm3Q9PiweS2saGpcs/VsTG0EcIke ttZyUTPJUoq28tH/W/adFNlBf8ojHg/n65eGCbJPhstcmdpn50jVnB+/Elr4ToawWA +7TYF/TkCalzVPUXi8vBrPArX/KAgxWa4gRqLBmY= Received: from epsmges5p1new.samsung.com (unknown [182.195.42.73]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20200507143547epcas5p3d349290cc0bab673d92e26a5d69b0ab0~MxbSJyzYt1912219122epcas5p3e; Thu, 7 May 2020 14:35:47 +0000 (GMT) X-AuditID: b6c32a49-71fff7000000271a-0d-5eb41cc34c41 Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C7.7E.10010.3CC14BE5; Thu, 7 May 2020 23:35:47 +0900 (KST) Mime-Version: 1.0 Subject: RE:(2) [PATCH 3/4] scripts/checkstack.pl: add arm push handling for stack usage Reply-To: v.narang@samsung.com From: Vaneet Narang To: Masahiro Yamada , Maninder Singh CC: "George G. Davis" , Linux Kernel Mailing List , AMIT SAHRAWAT , Arnd Bergmann , Andi Kleen X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20200507133220epcms5p87e370759fbc8aecca3093c503dd99b4c@epcms5p8> Date: Thu, 07 May 2020 19:02:20 +0530 X-CMS-MailID: 20200507133220epcms5p87e370759fbc8aecca3093c503dd99b4c Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P X-Brightmail-Tracker: H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ti+9j7QWnD ldbFE2Y7NH043hlc/3q1EktxRqKhFnNRcSIAQD/rEaUDAAA= X-CMS-RootMailID: 20200430124958epcas5p15ecc8e744ed0f78837a6d58274a5baf0 References: <1588250972-8507-1-git-send-email-maninder1.s@samsung.com> <1588250972-8507-3-git-send-email-maninder1.s@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro,=C2=A0=0D=0A=0D=0A>>=C2=A0To=C2=A0count=C2=A0stack=C2=A0usage= =C2=A0of=C2=A0push=C2=A0=7B*,=C2=A0fp,=C2=A0ip,=C2=A0lr,=C2=A0pc=7D=C2=A0in= struction=C2=A0in=C2=A0ARM,=0D=0A>>=C2=A0if=C2=A0FRAME=C2=A0POINTER=C2=A0is= =C2=A0enabled.=0D=0A>>=C2=A0e.g.=C2=A0c01f0d48:=C2=A0e92ddff0=C2=A0push=C2= =A0=7Br4,=C2=A0r5,=C2=A0r6,=C2=A0r7,=C2=A0r8,=C2=A0r9,=C2=A0sl,=C2=A0fp,=C2= =A0ip,=C2=A0lr,=C2=A0pc=7D=0D=0A>>=0D=0A>>=C2=A0c01f0d50=C2=A0:=0D=0A>>= =C2=A0c01f0d44:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0e1a0c00d=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0mov=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ip,= =C2=A0sp=0D=0A>>=C2=A0c01f0d48:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0e9= 2ddff0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0push=C2=A0=C2=A0=C2= =A0=C2=A0=7Br4,=C2=A0r5,=C2=A0r6,=C2=A0r7,=C2=A0r8,=C2=A0r9,=C2=A0sl,=C2=A0= fp,=C2=A0ip,=C2=A0lr,=C2=A0pc=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=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0492=0D=0A=C2=A0=C2=A0=0D=0A=C2=A0=0D=0A>=20Do=C2=A0you=C2=A0know=C2=A0CO= NFIG_FRAME_WARN?=0D=0A=C2=A0Yes=20we=20know=20this=20and=20we=20use=20it=20= to=20get=20compilation=20error=20if=20some=20function=20is=20using=20more= =20stack.=0D=0AThis=20config=20will=20report=20issue=20at=20compilation.=0D= =0A=C2=A0=0D=0A>I=C2=A0know=C2=A0checkstack.pl=C2=A0dumps=C2=A0the=C2=A0sta= ck=C2=A0size=0D=0A>of=C2=A0functions,=C2=A0which=C2=A0is=C2=A0different=C2= =A0from=C2=A0what=0D=0A>-Wframe-larger-than=C2=A0does,=C2=A0but=C2=A0the=C2= =A0goal=C2=A0is=0D=0A>quite=C2=A0similar,=C2=A0I=C2=A0think.=0D=0A>=C2=A0= =0D=0A>I=C2=A0just=C2=A0wondered=C2=A0if=C2=A0we=C2=A0need=C2=A0both.=0D=0A= =C2=A0=0D=0AWe=20feel=20purpose=20of=20this=20patch=20is=20different=20from= =20CONFIG_FRAME_WARN.=0D=0AThis=20patch=20is=20specific=20to=20ARM=20and=20= fixes=20bug=20in=20stack=20usage=20calculation.=0D=0A=0D=0AWe=20were=20comp= aring=20stack=20usage=20of=20ARM=20with=20ARM64=20and=20found=20big=20gap.= =0D=0AWe=20realised=20ARM=20is=20not=20calculating=20stack=20usage=20proper= ly.=0D=0AIt=20only=20considers=20stack=20used=20by=20local=20variables=20bu= t=20it=20doesn't=20consider=20=0D=0Astack=20used=20to=20store=20register=20= context=20at=20the=20start=20of=20functions.=20=0D=0AThis=20is=20not=20the= =20case=20with=20ARM64.=20It=20seems=20ARM64=20considers=20both.=0D=0A=0D= =0AWe=20found=20even=20stack=20variables=20are=20of=20same=20size=20on=20bo= th=20target=20but=20=0D=0Aarm64=20stack=20usage=20is=20high.=0D=0A=0D=0ACon= sidering=20below=20assembly,=20Actual=20stack=20usage=20is=20492=20but=20cu= rrent=20script=20reports=20448.=0D=0Apush=20instruction=20uses=2044=20bytes= =20of=20stack=20to=20take=20backup=20of=20registers=20as=20per=20ARM=20call= ing=0D=0Aconvention.=0D=0A=0D=0Ac01f0d44:=20=20=20=20=20=20=20e1a0c00d=20= =20=20=20=20=20=20=20mov=20=20=20=20=20ip,=20sp=0D=0Ac01f0d48:=20=20=20=20= =20=20=20e92ddff0=20=20=20=20=20=20=20=20push=20=20=20=20=7Br4,=20r5,=20r6,= =20r7,=20r8,=20r9,=20sl,=20fp,=20ip,=20lr,=20pc=7D=0D=0Ac01f0d4c:=20=20=20= =20=20=20=20e24cb004=20=20=20=20=20=20=20=20sub=20=20=20=20=20fp,=20ip,=20= =234=0D=0Ac01f0d50:=20=20=20=20=20=20=20e24dd094=20=20=20=20=20=20=20=20sub= =20=20=20=20=20sp,=20sp,=20=23448=20=20=20=20;=200x1C0=0D=0A=0D=0AThanks=20= &=20Regards,=0D=0AVaneet=20Narang=0D=0A=C2=A0=0D=0A=C2=A0=C2=A0