Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp113560ybg; Mon, 8 Jun 2020 17:59:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzA5ADnWdqt2++/q2+9GqYBW1t04U5npab0KsCBRrMQEOYBkcC6Qu9Fch+oiKZm9FdDCg3U X-Received: by 2002:a17:906:57d3:: with SMTP id u19mr23853490ejr.401.1591664390425; Mon, 08 Jun 2020 17:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664390; cv=none; d=google.com; s=arc-20160816; b=XwXPqEqw/EvUPqDV9TeXdXrued7Eo6+e1DvduaBDb/84DZOwQfP9zXbh0ewxV+HeoV m78V2umeGlcv5fA0Ym5cMEso2kkZd3Pu0u6pVGjQUhlG9auVloq8oTVejrbLThyuPf3l WPLvhuLMg0QySdAnN+XYUZsm2X669r+PKIMSJ05HV7trxz92tTH6NQKA/JEQbU1neA54 5B2bQ8/aGAI1lI97CJyNQfAgDPeyiXTJY4kp2ZWpDT1G9ateSNROV406S8N1MeKaJRHH xNyTPRz5yvkIyZ7GW58t5V3+kHuFiaYlQvDS2hRQHuGWHZ4TzJr6xwldW23FRdS1wv+V K/4A== 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=vlulF8haCBRq4xRq19eQFeilth61ttv7PowdOH//y4s=; b=rPLapsOTdaLVAE7szhLMngmFXpo0fesKARtjg2ZiMpgY5o6dOpUnb3JXwQ2ezB6BBo XSRyjOagAroIxKHlqXRF7Hz63SYkhV+DbMrQskgKwje+XjJr9fbIHHel0YHxdseE5us9 OWbof2IZC4iduKHbeSal9vc8qMmLmKjZxzfTh3ea+HnqPdQmWhT5JatZdIMArk47Tguj jOF6E/V+/nHWmR6KcgroeTowoRAbeOhGHTSOGCUfjuSInV6m7AT1Zvyh8szbmGGNQfTe YqmvsQdKdS+/f9SlnF1U/03KPlc0Is1F7Zs6l25BJu3cNvn73ae/iEwPebhr6sEJs1Hd Phbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iFs9iKl+; 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 m14si10844129eja.139.2020.06.08.17.59.27; Mon, 08 Jun 2020 17:59:50 -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=iFs9iKl+; 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 S1728540AbgFIAzo (ORCPT + 99 others); Mon, 8 Jun 2020 20:55:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:54986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728377AbgFHXJQ (ORCPT ); Mon, 8 Jun 2020 19:09:16 -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 B1E2120890; Mon, 8 Jun 2020 23:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657755; bh=shKfPmny0Xk+z6QTEuZIiryuf3ktSCpn4+P8VnIPKmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iFs9iKl+90UzgJN8wlwBZyDZ+0q2sMLFIpwErgqLD+ZTuOzusiv547ZAAn2l/VhjY 7kgb9NOnrhSMjjXXOSbY4gBlpIf3koGIT4ax+oH07l4uFqbCDZOcawRPghWvU/a2Gy FskhDJWRzJuNFZiGRzy9QDTAFkbup53ehIlCj+dM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Dmitry Golovin , Herbert Xu , Sasha Levin , clang-built-linux@googlegroups.com Subject: [PATCH AUTOSEL 5.7 141/274] lib/mpi: Fix 64-bit MIPS build with Clang Date: Mon, 8 Jun 2020 19:03:54 -0400 Message-Id: <20200608230607.3361041-141-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: 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 891e1c3549c4..afbd99987cf8 100644 --- a/lib/mpi/longlong.h +++ b/lib/mpi/longlong.h @@ -653,7 +653,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