Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp106801ybg; Mon, 8 Jun 2020 17:46:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYqYtY/gpbC/ezwus/s//hjHP4D0FruA0O0opXIWXktgy2dE7vj12ZL/5QYBxT2t3k7X5W X-Received: by 2002:aa7:c756:: with SMTP id c22mr24824673eds.239.1591663602484; Mon, 08 Jun 2020 17:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591663602; cv=none; d=google.com; s=arc-20160816; b=BGOIPsD/l3SM8fkW8yadZ8uXC/qU/8xDUDodW9Qsr/5upElaUy+sqpx+k9ezOGu3nf b4rpeX99ESKt+idmoHYXVzEM16OLxGNx8BWcfM6ifa9udq5/dFCTbW5qyB5iSMaHKhUX 1XoseMnmBCbDdOKCRbcm8Lzq0nvXR9txww5ec8PEAiy6JbOispWdDKQSPYzpN+3oIHJ8 wvw7k/IPShRecq45OktHTVRRVdktFao7n3lZIfJbnQNsYE8ajwqhcHD5Wwi+RTVCY43M 4RJvPcGvANKfl0wrlNZ2CroYfui60gBF/yl6RxWa6SUlIA3ZP0YWsugSjtkHCrLZP8Pc Oklw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kHGYrHd92nuK5oed9uJ8xYTYFrHqF69mhr+lS1jTiaQ=; b=aoJqJ1o4mtfJIsCB+IwlVH6igm35y1iE0Tnkpgx39muaawN98vN0Oaxux1uc7mKpI8 PgyBp197rEz9261vV2JnycdUSY44UwG0DUaj44T6If7rBwKl5TC0cDwdZdfqMau4lhIV Bz7QgeK3V6Hbp75fLM61dK5Mv5CKA4y9zOfcjrpcxbEL7eXv90s3rFXc35O82qu/5KK8 jR8HWQpW6gOCEixnaKY6Rqw/0mBdC+573SAluSDrP2Wmf8dpDC8x4Tol5Wscr9bbW9AT l+BZ6oor5RolduSvXcRqp/SBdHJbKvvze9M6o8OZCI2rmQxTehHV9S4Lwfi8GNT79Ucf tHfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K0KciWcB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp4si12074412ejc.258.2020.06.08.17.46.19; Mon, 08 Jun 2020 17:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=K0KciWcB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1729084AbgFHXMX (ORCPT + 99 others); Mon, 8 Jun 2020 19:12:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:56738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728703AbgFHXKg (ORCPT ); Mon, 8 Jun 2020 19:10:36 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89C4F20890; Mon, 8 Jun 2020 23:10:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657836; bh=73KsjooSBJpJiiH+QOeAQXNpAvN1RJ9iKUFTKw70dcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K0KciWcBM2kpYve8pyLzVAxScAx6+scfH6ot15zpKsh/6l2jOU5Zy6grIDlCgZ6uY /ySlNXhU519zSc9a9PmiXoEZVQ1Dm4FqP0+/bKAWgGYOS7GmC6ANWt/dRhEthEHesP JwBcB0a4QvEkOv7C2tTOavgkOIAb89xJgqfp9iH8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnd Bergmann , Nathan Chancellor , Herbert Xu , Sasha Levin , linux-crypto@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH AUTOSEL 5.7 205/274] crypto: blake2b - Fix clang optimization for ARMv7-M Date: Mon, 8 Jun 2020 19:04:58 -0400 Message-Id: <20200608230607.3361041-205-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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]; } -- 2.25.1