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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 05FA0C433E0 for ; Sat, 16 Jan 2021 01:59:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8196023A52 for ; Sat, 16 Jan 2021 01:59:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8196023A52 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A23628D01FD; Fri, 15 Jan 2021 20:59:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AB918D01F6; Fri, 15 Jan 2021 20:59:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84C508D01FD; Fri, 15 Jan 2021 20:59:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id 692958D01F6 for ; Fri, 15 Jan 2021 20:59:38 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2BEC0180AD806 for ; Sat, 16 Jan 2021 01:59:38 +0000 (UTC) X-FDA: 77709981636.11.farm01_050673a27534 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 0E488180F8B86 for ; Sat, 16 Jan 2021 01:59:38 +0000 (UTC) X-HE-Tag: farm01_050673a27534 X-Filterd-Recvd-Size: 6616 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Sat, 16 Jan 2021 01:59:37 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E23522075A; Sat, 16 Jan 2021 01:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610762376; bh=8DBfgcZmjZUV0p9L7RoJ9Btu1l4QjF7cBMCJGChwyXA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hfM1D+WoEpCDxjJksH/irYwrhNehrSOnNhUsOPpR6oWlNlbjZuFdvYSBLLNhJYDeR dZfI0BM0BwMpkVnfrXZqsbHB+XE4IB+ZRWyS7DixFl5wXQ5KL3T7/4xkf1qW0Qn8f8 dDiCNGk8FXa1usxVlNo7W3Uknf97g/q7Uli/QSCAObJh5wiQ5+U97kuz8+OgdlqsGJ 1GiYu7tj+u70z4Jhf79WrZE811HFhHbQfPpCNVdNcwV9uTtPWnHvrcYUR9kpLXvRq6 7a7oVCoYRH8l5+f4hc/Yo58xeuV5Cc2LJOPoobLPFY7XKckLFo6xnk9dE0XJu9tKqZ mLyZXZWrrNMUQ== Date: Fri, 15 Jan 2021 17:59:34 -0800 From: Eric Biggers To: kernel test robot Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Linux Memory Management List , Herbert Xu , linux-crypto@vger.kernel.org, Arnd Bergmann Subject: Re: [linux-next:master 952/3956] crypto/blake2b_generic.c:73:13: warning: stack frame size of 9776 bytes in function 'blake2b_compress_one_generic' Message-ID: References: <202101160841.jUXjdS7j-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202101160841.jUXjdS7j-lkp@intel.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Jan 16, 2021 at 08:59:50AM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: b3a3cbdec55b090d22a09f75efb7c7d34cb97f25 > commit: 28dcca4cc0c01e2467549a36b1b0eacfdb01236c [952/3956] crypto: blake2b - sync with blake2s implementation > config: powerpc64-randconfig-r021-20210115 (attached as .config) > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5b42fd8dd4e7e29125a09a41a33af7c9cb57d144) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install powerpc64 cross compiling tool for clang build > # apt-get install binutils-powerpc64-linux-gnu > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=28dcca4cc0c01e2467549a36b1b0eacfdb01236c > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 28dcca4cc0c01e2467549a36b1b0eacfdb01236c > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > >> crypto/blake2b_generic.c:73:13: warning: stack frame size of 9776 bytes in function 'blake2b_compress_one_generic' [-Wframe-larger-than=] > static void blake2b_compress_one_generic(struct blake2b_state *S, > ^ > 1 warning generated. > > > vim +/blake2b_compress_one_generic +73 crypto/blake2b_generic.c > > 48 > 49 #define G(r,i,a,b,c,d) \ > 50 do { \ > 51 a = a + b + m[blake2b_sigma[r][2*i+0]]; \ > 52 d = ror64(d ^ a, 32); \ > 53 c = c + d; \ > 54 b = ror64(b ^ c, 24); \ > 55 a = a + b + m[blake2b_sigma[r][2*i+1]]; \ > 56 d = ror64(d ^ a, 16); \ > 57 c = c + d; \ > 58 b = ror64(b ^ c, 63); \ > 59 } while (0) > 60 > 61 #define ROUND(r) \ > 62 do { \ > 63 G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ > 64 G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ > 65 G(r,2,v[ 2],v[ 6],v[10],v[14]); \ > 66 G(r,3,v[ 3],v[ 7],v[11],v[15]); \ > 67 G(r,4,v[ 0],v[ 5],v[10],v[15]); \ > 68 G(r,5,v[ 1],v[ 6],v[11],v[12]); \ > 69 G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ > 70 G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ > 71 } while (0) > 72 > > 73 static void blake2b_compress_one_generic(struct blake2b_state *S, > 74 const u8 block[BLAKE2B_BLOCK_SIZE]) > 75 { > 76 u64 m[16]; > 77 u64 v[16]; > 78 size_t i; > 79 > 80 for (i = 0; i < 16; ++i) > 81 m[i] = get_unaligned_le64(block + i * sizeof(m[i])); > 82 > 83 for (i = 0; i < 8; ++i) > 84 v[i] = S->h[i]; > 85 > 86 v[ 8] = BLAKE2B_IV0; > 87 v[ 9] = BLAKE2B_IV1; > 88 v[10] = BLAKE2B_IV2; > 89 v[11] = BLAKE2B_IV3; > 90 v[12] = BLAKE2B_IV4 ^ S->t[0]; > 91 v[13] = BLAKE2B_IV5 ^ S->t[1]; > 92 v[14] = BLAKE2B_IV6 ^ S->f[0]; > 93 v[15] = BLAKE2B_IV7 ^ S->f[1]; > 94 > 95 ROUND(0); > 96 ROUND(1); > 97 ROUND(2); > 98 ROUND(3); > 99 ROUND(4); > 100 ROUND(5); > 101 ROUND(6); > 102 ROUND(7); > 103 ROUND(8); > 104 ROUND(9); > 105 ROUND(10); > 106 ROUND(11); > 107 #ifdef CONFIG_CC_IS_CLANG > 108 #pragma nounroll /* https://bugs.llvm.org/show_bug.cgi?id=45803 */ > 109 #endif > 110 for (i = 0; i < 8; ++i) > 111 S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; > 112 } > 113 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Looks like the clang bug that causes large stack usage in this function (https://bugs.llvm.org/show_bug.cgi?id=45803 which is still unfixed) got triggered again. Note that the function only has 264 bytes of local variables, so there's no reason why it should use anywhere near 9776 bytes of stack space. I'm not sure what we can do about this. Last time the solution was commit 0c0408e86dbe which randomly added a 'pragma nounroll' to the loop at the end. Anyone have any better idea than randomly trying adding optimization pragmas and seeing what makes the report go away? Also this was reported with clang 12.0.0 which is a prerelease version, so I'm not sure how much I'm supposed to care about this report. - Eric