From patchwork Fri Jun 19 14:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 191233 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp647687ilo; Fri, 19 Jun 2020 08:50:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcTI3pgPLNsix08VPvt/VYODHaB9/x1vfK7L357/x7RdR14vTC2rEM2+8xDvru0s/LVz+b X-Received: by 2002:a17:906:6441:: with SMTP id l1mr4081402ejn.169.1592581821488; Fri, 19 Jun 2020 08:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592581821; cv=none; d=google.com; s=arc-20160816; b=Oz0f8nF2FndQlGbcY6d8GQBOFwiECsbm1dfBLgQJSG6H7VAkzugXs5itbgVIBGh8vU qlInOrkuk5uGzuMRR4qtS3iaRZThsuE5pxwFc37DSiDXK0EZKuArD4meZO+2RYB5BIKr n5HtcSqjpR3b6zEWOydALtIETzIveM/CetMJYhBYdnntwJv9jcNtcMF0oA/EgSYMgYc3 a8u7nhUtvm2OpiW9G5IIXg4Yopt0tYX1KBg+1CmrnqfKykuWgR0QvIISVSVZ0fUZvnlo HdfdcWTNHaRTA0TmtE8y9ve11ktEudpWPxDKAWG37JJLohKX467HnGd6Hhfe5uInIwwh 2Hhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kHGYrHd92nuK5oed9uJ8xYTYFrHqF69mhr+lS1jTiaQ=; b=p+23C+wapVzsn0Xooq9KX9PvQiVpKUCprQW9DVP5XxAWYjcMk+E1rAEnIsDMKkFaTt bsFQCTy84LZrTElsdh6KjuqbvKXvc2XPU06qoJT//nMzFjt6xf7is8xZNCU68Jopuwdt GFPux9+GqO1tdcTPw4zpp9bcUDVxPVz3ab1Dcwbb8G32A2MqDfhCGHOFilLZdSmUY77m eB3eNumM6BCK/oXrFdGXFJ7d7HeOXUwKX8yNH8QzucNqT7pywp/uKyZ+bOPwIvkV0MCw +I3kcj+VdlcLxOEREhwzvj1amXdv5nNkR6Gt9eCq5En/uDOglBu2Tkl9PC8uM5zuDkwi rd+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P1sxoM4x; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si4156895ejh.152.2020.06.19.08.50.21; Fri, 19 Jun 2020 08:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@kernel.org header.s=default header.b=P1sxoM4x; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393312AbgFSPYp (ORCPT + 15 others); Fri, 19 Jun 2020 11:24:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:56452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393304AbgFSPYo (ORCPT ); Fri, 19 Jun 2020 11:24:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8D0F721548; Fri, 19 Jun 2020 15:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580283; bh=73KsjooSBJpJiiH+QOeAQXNpAvN1RJ9iKUFTKw70dcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P1sxoM4xZesr1QPSS14fgEbG7C0oRzjSeRl8WaxqA8k/pL7oIKRn6kzI7CojaroAj W1yDdG0fINZZ+OZRgGzJPPL01wBSqzCfIjwS6/JFX0fzhj4S5a423VbWf8Mcf0uiT5 v/miqoeM5g1A7+Odxs8kSvTRrFxbEWJZiNWffReA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nathan Chancellor , Herbert Xu , Sasha Levin Subject: [PATCH 5.7 191/376] crypto: blake2b - Fix clang optimization for ARMv7-M Date: Fri, 19 Jun 2020 16:31:49 +0200 Message-Id: <20200619141719.393689693@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 0c0408e86dbe8f44d4b27bf42130e8ac905361d6 ] When building for ARMv7-M, clang-9 or higher tries to unroll some loops, which ends up confusing the register allocator to the point of generating rather bad code and using more than the warning limit for stack frames: warning: stack frame size of 1200 bytes in function 'blake2b_compress' [-Wframe-larger-than=] Forcing it to not unroll the final loop avoids this problem. Fixes: 91d689337fe8 ("crypto: blake2b - add blake2b generic implementation") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/blake2b_generic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/crypto/blake2b_generic.c b/crypto/blake2b_generic.c index 1d262374fa4e..0ffd8d92e308 100644 --- a/crypto/blake2b_generic.c +++ b/crypto/blake2b_generic.c @@ -129,7 +129,9 @@ static void blake2b_compress(struct blake2b_state *S, ROUND(9); ROUND(10); ROUND(11); - +#ifdef CONFIG_CC_IS_CLANG +#pragma nounroll /* https://bugs.llvm.org/show_bug.cgi?id=45803 */ +#endif for (i = 0; i < 8; ++i) S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; }