Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4616004rwj; Tue, 20 Dec 2022 12:40:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXuGwIMideTB/UcKTwtO7Npb7NtaIX5U4pUtSsibQYMYwEbHkvcxEw8iWogIjVSxA8hqmlF1 X-Received: by 2002:a17:902:9895:b0:189:340c:20d2 with SMTP id s21-20020a170902989500b00189340c20d2mr16083223plp.23.1671568806608; Tue, 20 Dec 2022 12:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671568806; cv=none; d=google.com; s=arc-20160816; b=oa4hJK9wnqHHwT7aC58Z8nB445IzxOiClJjLPv6twsUZ6SE7QuIjzD4+rtZMd56cfv /jydqK7qI3FG/8h1UQ1nmpO5X44KUEDh36X1XpX8thAOb7nzA8MtrsD40RuLRON20hHq Ie9nIEn38qGIHPr2ohjCmNCgentqNVQwrpN1conIX8RplzzJgEBFiwPqIpjhEjqiBKq9 JLrQwyU68tgLyBpjcegni948qCR3+bnm0uSqfkzbmnej+VWM7Z7qFeuA8xiFoufh/wwa n4cofQAk8L9EFKVjEmZ2hgtX1P/gQ3L8bqec8l8MP6q9sEXqFqduFkmPCAe5kv/wePGj hpNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=z/2N+Pf6+FoY4ifUVV5PUZFAxx8tzbdLRNXbdzc0JAk=; b=bq+KnEswiq9SfTqm20G/QXZ5Fy/tbcGDa8RU6bx2dodEd5t55NhCs0NugPvfvUci3h MbvESIJc0Uigyfs1D8jhXT4iMcPToSjHwYyT8eqyIdjVAn8kluFWEhCH4P8w2js6je7s cPFvZUoorFcWBmxllN1aCmts8e2rRsj3n6ebKQkbKZFax28Jysbwy2jbWzZ0XJotJlBF LFfFNY8KBwnZbNkl52AUkSdVsqqK88t52oJIB5+vELzSYjj36N08vtF2o478UiWaGpE+ x0LthiiGneyioUEKe1x2S4cciKfjWWtIuW2iAyph1HRZWxBDKrAQglQz5QeQDyv8XxC6 XrgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Nri9+1AV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a170902cec100b0019144825f7esi650147plg.332.2022.12.20.12.39.48; Tue, 20 Dec 2022 12:40:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Nri9+1AV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229720AbiLTUe3 (ORCPT + 99 others); Tue, 20 Dec 2022 15:34:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233534AbiLTUe2 (ORCPT ); Tue, 20 Dec 2022 15:34:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8C97FA; Tue, 20 Dec 2022 12:34:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8DFB3B8133B; Tue, 20 Dec 2022 20:34:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B335C433EF; Tue, 20 Dec 2022 20:34:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671568460; bh=ZpDboU70AuwgCMB7rmWdlbACrVOmBDBpoLpC/ji7esY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Nri9+1AVWka/i9XSGOFX5YomLKxf7ybZR/JF+ApDsAkxJxFXnQYLCsOC0/I0AN/lX VLhyLWOlMzpOCy4B1dIWtMU0wSKwglvEHbsad3/dyBOePeDaReRokdsra6PqeaR4Zz Pbux7j5lub2IbPqOg/llzb9VmaDyTngy3Eg19+VeuTWcywg055XSRsUmCOfa6l8z1F 2kD92+PH4IIZLQ1Is/BzytR9HORQeFYpKJg/Mbn54cPMyMioux4n4YBWeg9bfWajpT nVyb/neZnpz2zVm8bTipzdh1rr2pDMIbgMcDsX+RUkVZVhLLiFNF8aeQfVIoUIGRFS KevaXpH+IWVOA== Date: Tue, 20 Dec 2022 20:34:18 +0000 From: Eric Biggers To: Herbert Xu Cc: "Chen, Rong A" , kernel test robot , "Jason A. Donenfeld" , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Linux Crypto Mailing List Subject: Re: [PATCH] crypto: lib/blake2s - Split up test function to halve stack usage Message-ID: References: <202211072109.qvrnjNKo-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sun, Dec 11, 2022 at 02:22:29PM +0800, Herbert Xu wrote: > On Thu, Dec 08, 2022 at 02:37:45PM +0800, Chen, Rong A wrote: > > > > Thanks for the information, I checked the result of the fix commit, > > it reduced the stack frame but the warning still exists: > > > > lib/crypto/blake2s-selftest.c:632:1: warning: the frame size of 1056 bytes > > is larger than 1024 bytes [-Wframe-larger-than=] > > Sorry, I didn't realise that you could still reproduce it. I tried > reproducing it on multiple architectures and failed (all were in > the 900 range). > > Anyhow, this patch reduces it by half for me so hopefully it should > put this to rest. > > ---8<--- > Reduce the stack usage further by splitting up the test function. > > Also squash blocks and unaligned_blocks into one array. > > Signed-off-by: Herbert Xu > > diff --git a/lib/crypto/blake2s-selftest.c b/lib/crypto/blake2s-selftest.c > index 7d77dea15587..484b89332c83 100644 > --- a/lib/crypto/blake2s-selftest.c > +++ b/lib/crypto/blake2s-selftest.c > @@ -545,7 +545,7 @@ static const u8 blake2s_testvecs[][BLAKE2S_HASH_SIZE] __initconst = { > 0xd6, 0x98, 0x6b, 0x07, 0x10, 0x65, 0x52, 0x65, }, > }; > > -bool __init blake2s_selftest(void) > +static bool __init blake2s_digest_test(void) > { > u8 key[BLAKE2S_KEY_SIZE]; > u8 buf[ARRAY_SIZE(blake2s_testvecs)]; > @@ -589,11 +589,20 @@ bool __init blake2s_selftest(void) > } > } > > + return success; > +} > + > +static bool __init blake2s_random_test(void) > +{ > + struct blake2s_state state; > + bool success = true; > + int i, l; > + Shouldn't these functions have 'noinline_for_stack' added to them? - Eric