From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DECA324B1F; Wed, 8 Apr 2026 18:23:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672631; cv=none; b=WJ0l+axTzyScppQRE3+Iyf1yDG9J4szLXkb4W5yxPFYb/iZsNpXzTFl9MJHgDe20VN3kOlTrinKqFfpszKmEF5eMeKBs3xaX4TytFJUMKmCgwY8okiyfRYVh/tvLXqSOo/765gze8//0CcrKllJXk6/4DahuBb349C/xc1jvPYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672631; c=relaxed/simple; bh=BmnlNLDNAN0nVC5dlPtlx8F/jxigXxbfox/QwNDXy4A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T7e8QFYNQGXqdQk7RuUgQkWWSPMA24FhST+mIxWNnfExfg/j1orG1Wi4j1wMtxlDnA1sIi6KjenU5BmSi3aIpZwG5I4/nqH5IHtT/3LMl/XCraqOwRKHgJOIOeWMkvWidAMqc2kEV5tPwLEotGc6gJrsmAGnk8yk18Qr9Bx9grY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VGB22ziG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VGB22ziG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B197C19421; Wed, 8 Apr 2026 18:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775672631; bh=BmnlNLDNAN0nVC5dlPtlx8F/jxigXxbfox/QwNDXy4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VGB22ziG64SrePdzOgJ8wJnQyjs8kihRT9VWWtD2BqvzWCEPITDGOiLyL7CSZml2y ojh1s+XWAS9b8UrikbJ8emZ4kq206hASRAK2zfUa8L0z1e+o0xfVI5vuOXuYCNflNT fBtuXcoo9hcIhHsn4wsnyY0sperh5soQ4suyacpw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, kernel test robot , "Maciej W. Rozycki" , Thomas Bogendoerfer Subject: [PATCH 6.6 081/160] MIPS: Fix the GCC version check for `__multi3 workaround Date: Wed, 8 Apr 2026 20:02:48 +0200 Message-ID: <20260408175916.219204089@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175913.177092714@linuxfoundation.org> References: <20260408175913.177092714@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maciej W. Rozycki commit ec8bf18814915460d9c617b556bf024efef26613 upstream. It was only GCC 10 that fixed a MIPS64r6 code generation issue with a `__multi3' libcall inefficiently produced to perform 64-bit widening multiplication while suitable machine instructions exist to do such a calculation. The fix went in with GCC commit 48b2123f6336 ("re PR target/82981 (unnecessary __multi3 call for mips64r6 linux kernel)"). Adjust our code accordingly, removing build failures such as: mips64-linux-ld: lib/math/div64.o: in function `mul_u64_add_u64_div_u64': div64.c:(.text+0x84): undefined reference to `__multi3' with the GCC versions affected. Fixes: ebabcf17bcd7 ("MIPS: Implement __multi3 for GCC7 MIPS64r6 builds") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202601140146.hMLODc6v-lkp@intel.com/ Signed-off-by: Maciej W. Rozycki Cc: stable@vger.kernel.org # v4.15+ Reviewed-by: David Laight Signed-off-by: Greg Kroah-Hartman --- arch/mips/lib/multi3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/mips/lib/multi3.c +++ b/arch/mips/lib/multi3.c @@ -4,12 +4,12 @@ #include "libgcc.h" /* - * GCC 7 & older can suboptimally generate __multi3 calls for mips64r6, so for + * GCC 9 & older can suboptimally generate __multi3 calls for mips64r6, so for * that specific case only we implement that intrinsic here. * * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82981 */ -#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 8) +#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 10) /* multiply 64-bit values, low 64-bits returned */ static inline long long notrace dmulu(long long a, long long b) @@ -51,4 +51,4 @@ ti_type notrace __multi3(ti_type a, ti_t } EXPORT_SYMBOL(__multi3); -#endif /* 64BIT && CPU_MIPSR6 && GCC7 */ +#endif /* 64BIT && CPU_MIPSR6 && GCC9 */