Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp633382ybt; Fri, 19 Jun 2020 09:48:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwr6RJrkEqz7MdSsw0/E+KLbDaKMcvWkhLVBnke2/QjXi1LaYtPie/ZTUor2f+SUFIZEwg+ X-Received: by 2002:a17:906:31d2:: with SMTP id f18mr4443841ejf.110.1592585305947; Fri, 19 Jun 2020 09:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592585305; cv=none; d=google.com; s=arc-20160816; b=uim28G1yGxkwyh8fRBUJKdOSCJj7j5FySanv2fHaSvu/SN5oxNNX6F2a8Dlz69zkxl ziHcjU+mYLg05u58ULyDkvYXAO4T9gjcHXxThCya66zB0pnwOuF+E7qwNCGeMFvKMUAz fo/w+AXm8RCtrvxHgLtxHAj0SoW/AyiEBhXHmsqoyiQC/zdXxIv8w+++6VA1RoZlDlag nOMFUmx/JJayEzS3uYW022fRthfDtpj5t9PVLErldxbnY0bzrzwfwyrvvDVQdGQLQamh cijPHWEoLlsK8GEaoEfUTYMcI+9DBJocTgG8Gi3Pj7sKhITgSF6wFk0ZzD/K1HYon12Y 0/uA== 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=PgpKfxpi5HZXo+ubEU8uBQEYC+3P4keMIiiJWgafASg=; b=ntRXOLvKQ03QPuYNZwJPnV0SW2q5BTgB1p+KGJjl5jWE8c/vZngoeyWw9gsc+4R3Hu PVN1b2tW2+IAbUZOQWaJbcB9M1WpE4wqw1gurmtom/G3qrA6RjHjsPJ+rjWcfKajtFGH 8gD6F+k2XYsIL+ei2J70mBlphOY+yaiYw/GcUQgQx0MrJ/i1QGJ8SnQ/aGhE6NHrth4B XDIo2BKbb/ooUXPk84ytM+oew2jGZbc8umWOB2QLWYGZN7oxJwRSdWF1OqfErPO1fA10 5leP7snwi0MaaLc1sA3Xo232JftYt6LbJlSKIg9h2vlNUsDYR1DFu/NKEulSfktY4a0b jDYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NL700PS6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz7si4453610ejb.455.2020.06.19.09.48.04; Fri, 19 Jun 2020 09:48:25 -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=NL700PS6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388379AbgFSOmf (ORCPT + 99 others); Fri, 19 Jun 2020 10:42:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:33194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387827AbgFSOm3 (ORCPT ); Fri, 19 Jun 2020 10:42:29 -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 3744C20CC7; Fri, 19 Jun 2020 14:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577748; bh=1sDm6efkE6nUzcgVIsySaFaYUqIUIjrhlE1ECDiwrtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NL700PS6WZ2jkmnGwsVFQ7szjvTNL8dmtTLipAjxnTxcRusXy5AnA+upehLxpuVhW MCT+HqSVhySOzaw0coaL5gPrODUizhQUP665UkhZCmNukKdHDoRPlMQ28pk+GmGkn8 uThszPYoAEKbn/lonWo66zTLVZgAZuIeFbBTe2ro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Golovin , Nathan Chancellor , Herbert Xu , Sasha Levin Subject: [PATCH 4.9 074/128] lib/mpi: Fix 64-bit MIPS build with Clang Date: Fri, 19 Jun 2020 16:32:48 +0200 Message-Id: <20200619141624.103848907@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141620.148019466@linuxfoundation.org> References: <20200619141620.148019466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 18f1ca46858eac22437819937ae44aa9a8f9f2fa ] When building 64r6_defconfig with CONFIG_MIPS32_O32 disabled and CONFIG_CRYPTO_RSA enabled: lib/mpi/generic_mpih-mul1.c:37:24: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/mpi/longlong.h:664:22: note: expanded from macro 'umul_ppmm' : "=d" ((UDItype)(w0)) ~~~~~~~~~~^~~ lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/mpi/longlong.h:668:22: note: expanded from macro 'umul_ppmm' : "=d" ((UDItype)(w1)) ~~~~~~~~~~^~~ 2 errors generated. This special case for umul_ppmm for MIPS64r6 was added in commit bbc25bee37d2b ("lib/mpi: Fix umul_ppmm() for MIPS64r6"), due to GCC being inefficient and emitting a __multi3 intrinsic. There is no such issue with clang; with this patch applied, I can build this configuration without any problems and there are no link errors like mentioned in the commit above (which I can still reproduce with GCC 9.3.0 when that commit is reverted). Only use this definition when GCC is being used. This really should have been caught by commit b0c091ae04f67 ("lib/mpi: Eliminate unused umul_ppmm definitions for MIPS") when I was messing around in this area but I was not testing 64-bit MIPS at the time. Link: https://github.com/ClangBuiltLinux/linux/issues/885 Reported-by: Dmitry Golovin Signed-off-by: Nathan Chancellor Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- lib/mpi/longlong.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h index 8f383cca6bb1..623440d3d365 100644 --- a/lib/mpi/longlong.h +++ b/lib/mpi/longlong.h @@ -671,7 +671,7 @@ do { \ ************** MIPS/64 ************** ***************************************/ #if (defined(__mips) && __mips >= 3) && W_TYPE_SIZE == 64 -#if defined(__mips_isa_rev) && __mips_isa_rev >= 6 +#if defined(__mips_isa_rev) && __mips_isa_rev >= 6 && defined(CONFIG_CC_IS_GCC) /* * GCC ends up emitting a __multi3 intrinsic call for MIPS64r6 with the plain C * code below, so we special case MIPS64r6 until the compiler can do better. -- 2.25.1