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 E02282D8364; Mon, 13 Apr 2026 16:37:23 +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=1776098244; cv=none; b=Q51iji3IRWxYuA0HoboG8h239f1pIVkcKQafmrOzihMk3MxfDH3DcmcMvMMOAa6ZdwbBobS3RPwRmVUESXzoSi4ABrUrAePH23oSeua6EGKMOalQ2xTxMeODwDfTpCvk71TAXR4RTILxGuUNXgI+auv9TSUaUg3OzYpAEY8jh7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098244; c=relaxed/simple; bh=vZoQtJGcbEV/IPRkn7oSP5o+/kvX1UpN4WLMF2ZvgLY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ahRH+q7roxBzPlALmrvUiYnW5VD/b1YoIuVcP+yENykvkpENhVbxUPeOOFMgIBwSrVm/ivJgj97vSa7q0WA7hw+T+0qQIsmHZ8kK8ZfwANi1M6V7NV0AoUWY51TQ2HsVKlU+TrmQNkkVvmLGahb3QFC8R3Wa4c+1FlabxD6jIAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BGH9FYy+; 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="BGH9FYy+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BA86C2BCAF; Mon, 13 Apr 2026 16:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776098243; bh=vZoQtJGcbEV/IPRkn7oSP5o+/kvX1UpN4WLMF2ZvgLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BGH9FYy+tOTBIfPiaueYNSZ8ljKg+dX9Sng8NTEXfwMgu5cgl84fyU1XpLAN+E3nT 0abEH+gSnK4sgs96/kuDlv944ClkIf710EIQpaMnp4BVA9lVZwbT7G07jcpd9FYU50 w4h5/F0mzbTNdQ3nIeFq8NY+P6eVHoYDpGrgazk0= 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 5.15 450/570] MIPS: Fix the GCC version check for `__multi3 workaround Date: Mon, 13 Apr 2026 17:59:41 +0200 Message-ID: <20260413155847.325273517@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-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 */