Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp829309ybt; Fri, 19 Jun 2020 15:06:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaC9mG+OVhg3GU81bXJcThqJanQQdB55WIHSd6x3w5RWlYAjkJmdaKKdi5SSlDE/qc77nV X-Received: by 2002:a17:906:55c9:: with SMTP id z9mr5851548ejp.276.1592604366612; Fri, 19 Jun 2020 15:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592604366; cv=none; d=google.com; s=arc-20160816; b=eCLGsx5gCgPwswnp1dmmpeGTpKvJa1STmjBUS1ouMF5+7/0YCqQxJ4j3Y3Q2ggtfEQ 6Ygjo5v+2ihS4a7TXWWjhJykU6yxzefK97K0hQsVOszcEPXGMZYogMMhNaXHlO/wg6JX 9ZHIOVnnRFq4VE64nT/Fj+43oMFoaH6LZaILIZ1A3WpfEg7SrGfnbZizIW+hlbtMSB4H EZtSrReYJL2tVVjhox0wwJ+4cay/Oa5qr91RoM5fTePlV44IcYt7F4pFFGlbuZj/2xhJ HDlW8RJ3vJB4pswYA0FKK0IuOUmAnYV8MkZREeOmyFjg1Z3vsZQLZrXzzZLFth+19JWF w5Yw== 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=vlulF8haCBRq4xRq19eQFeilth61ttv7PowdOH//y4s=; b=ue/3FDZNCLCqblnovfr8RaU8VK+Ni7cwcYKnNpq6g+g6F2WM+77UskfHUT3gTztFzG RTUxeqNqTFqTBc34Ghz6fciMl5yPbssmQzlOxF79xje+foY589CPJQUzJ8lwItgQocww Xc6/hlwik81z2aQfxU8mrErIpeQK/v4qnhGqNMxUp+P6WaMplJXRMf+0ugNOhcoW3Bd1 ILPAWK4bEkUtcT4AxU3+CdLyyITxeXzUVrPTVJMybiNu4PXYNPGQsTwPMvyj/gpXV3O3 x32kGNi+3KTfZXWPpo5oRp4PiJDMhkUfYDkVxAtccG4T3Vo8If2DGjyyqlnUWJHJizS8 oB1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aDLSMywN; 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 c11si4743621edk.514.2020.06.19.15.05.45; Fri, 19 Jun 2020 15:06:06 -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=aDLSMywN; 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 S2404154AbgFSPZC (ORCPT + 99 others); Fri, 19 Jun 2020 11:25:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:53554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391036AbgFSPWL (ORCPT ); Fri, 19 Jun 2020 11:22:11 -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 F040021548; Fri, 19 Jun 2020 15:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580130; bh=shKfPmny0Xk+z6QTEuZIiryuf3ktSCpn4+P8VnIPKmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aDLSMywNEHW4YfOSYj+TMdGyb1knlJzi0JdY9rqlC64JO+6M2Oq5GdHx1i91Lgj5w 14DSB6sYfD1DLcmjNeQvfP9mM2xLL+SF3DMLKuM63sQC1cBfARmvgvKtU/hdfq40V4 PLNN9uQOFCd9BYymkigLDJJ/wO73hQyI+qgJd13M= 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 5.7 133/376] lib/mpi: Fix 64-bit MIPS build with Clang Date: Fri, 19 Jun 2020 16:30:51 +0200 Message-Id: <20200619141716.631703861@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 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 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