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 D79791A683C; Wed, 8 Apr 2026 18:15:41 +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=1775672141; cv=none; b=ub3XUB6pWnSqcbsvd9q9OAWquxZkM+ubVEfD9dB1O/nMybpIwklzRZcS6yygqUw+AE01alt2Lyj8lIUxTxkC9muUR52cEaYpHywAOzUdE0SJ8MSFovAn6m9rvROxCRqhDj0L2xdYWcwfiE0ioA9sagyIubRALKVuia1tYwNfnQw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672141; c=relaxed/simple; bh=I8r4XUnjGFgLNuTVLLZlB3VAYa53sE3ttTIFXAJQppQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FKXy1GUPnpa6BeKhfHB22FdocRgY9xGZwrksKJnltXvHwxIh1msY30GIbhB/63ojzmE1Fq1fVupOJR3+3mHcekj149EwzoOUT48Z83eS3Y7na9BIB0zT2m7lYitq1nUFvwhrIYzktKIco6WJYatDKWu+MILkzSm42x2U47FjWq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PqD1a8CW; 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="PqD1a8CW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 657A6C19421; Wed, 8 Apr 2026 18:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775672141; bh=I8r4XUnjGFgLNuTVLLZlB3VAYa53sE3ttTIFXAJQppQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PqD1a8CWu3lNxnEX8JaIZ+NDb48Nt6uRSdvK6ak6O/enj/I6KuehUoT6Z0IGW5Hwr AkB0e4OFWET+5jgd5XjGl3EML2wQUeBL7mjsAUVSCiOqsHctY8HpYxyUAwajiSqAEp GVWiozOK6wkTeZVLJTY5zhCEEqoIMSzL+YR8n7kk= 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.1 206/312] MIPS: Fix the GCC version check for `__multi3 workaround Date: Wed, 8 Apr 2026 20:02:03 +0200 Message-ID: <20260408175941.454447945@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175933.715315542@linuxfoundation.org> References: <20260408175933.715315542@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.1-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 */