Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2841115ybd; Thu, 27 Jun 2019 21:19:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyI+lKZrBymXflDzf9j770aJBwyQ59JFxFmSAKZy2VmmhligDHWc+aA/k6Moj3Ylh5wX5N7 X-Received: by 2002:a17:90a:b78b:: with SMTP id m11mr10750095pjr.106.1561695549434; Thu, 27 Jun 2019 21:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561695549; cv=none; d=google.com; s=arc-20160816; b=yQegZ5DZifHao7OZxffejaT4Terie0gG28FIj8+esoqc4vzq5cKtzVMRSMlqqIz91m Xsdj5hhHCfN/W/0BdQY+XBEBaqd3uxSmsBxXq0inVy0CcfDDTaAyW7oSwEF+SDgYH5rt /neHUCHRFjKJGfKN85QBEFoNvrJfcFkYuijD1GsveNxek+9RHFon9+T5Y5QTc+U7IaQc EsHQjC7x9uTXiRfPgRtIwPnQ6ieT9rTr3H2jso4fJM4EGrtbdQg383zZjPIj94P8/Rbd elPDCr9P2CC5hq1o/4I7807elWA9mlxU+Onjmc3VQDfSmzrlxTYZMyMSwZH3UxZe2a7N cKmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=UbDrDOgraMM+XqKMI38HFZJL87iyGfIxq8QGE+tegG0=; b=Gc+OBfzDuUChOzJ9LLsoGMKWf3ns0TtoMyXbqtDNfNGyaQhZC0ERoBb8VUd+vq/pJE ajpQ9uClqS5oxAkBYB1SMrJbGPojHXvprGfSC6UnCToVr2l0URNTMTF/Ni0ozZJawcux U1a//BiikQAsYNDWayyUlUPLy5TOhz/9qEyo5dn6MCuLVsPctmLoRvOfY9HukvC3/hTI YU/UmVOW7OGdRYqBAKjULPFrh0ajX0lvqNPbAACz8Hq3s6r905Zow52glNk7k+3tml4u oRzqEI6qW+8NAf4MpbvrTW+/7OshCLm1yYuFMhYIeKpk+3Q9AJxwM0Yq1JkG/8+62cAr ddJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 x8si1138711pfa.186.2019.06.27.21.18.55; Thu, 27 Jun 2019 21:19:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbfF1ESv (ORCPT + 99 others); Fri, 28 Jun 2019 00:18:51 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:55892 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725770AbfF1ESv (ORCPT ); Fri, 28 Jun 2019 00:18:51 -0400 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 Cc: Corentin Labbe , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , Eric Biggers , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190617132538.2759714-1-arnd@arndb.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.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