From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD8E4C4321A for ; Fri, 28 Jun 2019 04:19:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B205C2133F for ; Fri, 28 Jun 2019 04:19:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T7HPZOUb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B205C2133F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gondor.apana.org.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qvqiUftCx6VYA0s1LjxUxnKUVHsLMVNdM0DOLu7iUbA=; b=T7HPZOUbAjBwzg A3ljnQO3uZgzu4lgAL6pDWdg9i3K5fv4Y2eDsCFOoznNrLSjSzD2ZChu9q4DyLpWdGEvYgtU1CS43 +sfLHD4wb4XWds8PjFULdir4tWG5RT5x5vERr/MjSkXuNXZVQt9kPviOmTHI/791bmrWYZsBWbiF1 qo5yzHcDIeMf/+7XwbR/8yDEoSNnE/JTJ5dLsYBst/hLCiVR9vyxzGHsdmcyP0k37wKTjkiDC/p0u 2JR7nfdq5yPucaSsqfGyRRBkkHeDjIA7Rq6kIeL2HZaRkkl7Dm+ep77CiYmWFG1d5pMXp24ZOGrzc PwBcdofkVFgMK0VLQ9Kg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgiLi-0000Py-40; Fri, 28 Jun 2019 04:18:58 +0000 Received: from helcar.hmeau.com ([216.24.177.18] helo=deadmen.hmeau.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgiLe-0000Ou-Gy for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2019 04:18:56 +0000 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hgiLP-0004t1-AS; Fri, 28 Jun 2019 12:18:39 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hgiLJ-00024w-8D; Fri, 28 Jun 2019 12:18:33 +0800 Date: Fri, 28 Jun 2019 12:18:33 +0800 From: Herbert Xu To: Arnd Bergmann Subject: Re: [PATCH] crypto: sun4i-ss - reduce stack usage Message-ID: <20190628041833.olvmbzj5z2hmtruq@gondor.apana.org.au> References: <20190617132538.2759714-1-arnd@arndb.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190617132538.2759714-1-arnd@arndb.de> User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_211854_708923_C4B5CAA4 X-CRM114-Status: GOOD ( 13.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Biggers , Maxime Ripard , linux-kernel@vger.kernel.org, Chen-Yu Tsai , Corentin Labbe , linux-crypto@vger.kernel.org, "David S. Miller" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 17, 2019 at 03:25:17PM +0200, Arnd Bergmann wrote: > After the latest addition, the stack usage of sun4i_ss_cipher_poll > grew beyond the warning limit when KASAN is enabled: > > drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:118:12: error: stack frame size of 1152 bytes in function 'sun4i_ss_cipher_poll' [-Werror,-Wframe-larger-than=] > static int sun4i_ss_cipher_poll(struct skcipher_request *areq) > > Reduce it in three ways: > > - split out the new code into a separate function so its stack > usage can overlap that of the sun4i_ss_opti_poll() code path > - mark both special cases as noinline_for_stack, which should > ideally result in a tail call that frees the rest of the > stack > - move the buf and obuf variables into the code blocks in > which they are used. > > The three separate functions now use 144, 640 and 304 bytes of kernel > stack, respectively. > > Fixes: 0ae1f46c55f8 ("crypto: sun4i-ss - fallback when length is not multiple of blocksize") > Signed-off-by: Arnd Bergmann > --- > drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 47 +++++++++++++++-------- > 1 file changed, 30 insertions(+), 17 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel