Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1835560imm; Mon, 3 Sep 2018 10:40:03 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdab/yjWX3uYtH+CChXgj3Mcbx9y+xOa+StiLLZ/uff3zdsJwgtMSPx+4VJRflboI5wQ/old X-Received: by 2002:a63:e841:: with SMTP id a1-v6mr12596504pgk.126.1535996403661; Mon, 03 Sep 2018 10:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535996403; cv=none; d=google.com; s=arc-20160816; b=JQZdf+XiufiSH/jXlRIKrK8dT4mhF3N3iLSyk+uTrAUR31McaHmSgx7U/xqEAh7vRs WzEHT4At+NaKV6hsGh7szKedxP7VQfRxvMgChIkjcvDy5xPl42hAstomxIF6ycVBtvWl rf62KTRsOBw03eJchosBCEDF9AkWomIaEw4pT5Na/JDeX1MOTFuVAZYDUMGqGlstKSZX ZQB+6kH32erjmoZwn9bvVEO1LwKoFbU38MEliJXXQNDXd1ClTkmnmMd10liXiUFnzJu4 ftQw9XDuUp6saXN65TpI+/gNfAazJrmOFAVZOstBrmUhNY4qF8+GMqU3xE3NO2PlD2z7 ribw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8tkhhQVm9KChYl85LfEl8B+lZItyCIYeRhi+xYMzhZ4=; b=0DFUj3RKL2gEzgggf5wuzRgD8X9P/I9daxl75hHX41J95Spo59g+EQESbuQNNXHSdC SkUozga/oEpZox6TpjtmLfGFjALDXOQCqdp1tTS0Oq6y4hFcqH4EATit9KFbRVpNx+vO 11DsuDFu6uHVdHlkOFj2brKr6+xrAmxPnIup0DNfAo8tBMoHDxaUtAyclN0dDLMuSqGq 6hclEVnX4PGgn+6aIqZi7Iu6jDBAQg6q+vGx5OTdy2bMASmmAMydr889mwC8d3mu2JHX nTmbyjpeQkHpdPkMtybNcKCg8yx2uSkNCHC6Q2C399YYwi18F2EF3BAmkICldpX3hD/b gEtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24-v6si406461pls.497.2018.09.03.10.39.48; Mon, 03 Sep 2018 10:40:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731855AbeICV7w (ORCPT + 99 others); Mon, 3 Sep 2018 17:59:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48994 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbeICV7v (ORCPT ); Mon, 3 Sep 2018 17:59:51 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 308EDBC4; Mon, 3 Sep 2018 17:38:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , Vladimir Kondratiev , James Hogan , Ralf Baechle , linux-mips@linux-mips.org Subject: [PATCH 4.18 103/123] MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7 Date: Mon, 3 Sep 2018 18:57:27 +0200 Message-Id: <20180903165723.885045975@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165719.499675257@linuxfoundation.org> References: <20180903165719.499675257@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Burton commit 690d9163bf4b8563a2682e619f938e6a0443947f upstream. Some versions of GCC suboptimally generate calls to the __multi3() intrinsic for MIPS64r6 builds, resulting in link failures due to the missing function: LD vmlinux.o MODPOST vmlinux.o kernel/bpf/verifier.o: In function `kmalloc_array': include/linux/slab.h:631: undefined reference to `__multi3' fs/select.o: In function `kmalloc_array': include/linux/slab.h:631: undefined reference to `__multi3' ... We already have a workaround for this in which we provide the instrinsic, but we do so selectively for GCC 7 only. Unfortunately the issue occurs with older GCC versions too - it has been observed with both GCC 5.4.0 & GCC 6.4.0. MIPSr6 support was introduced in GCC 5, so all major GCC versions prior to GCC 8 are affected and we extend our workaround accordingly to all MIPS64r6 builds using GCC versions older than GCC 8. Signed-off-by: Paul Burton Reported-by: Vladimir Kondratiev Fixes: ebabcf17bcd7 ("MIPS: Implement __multi3 for GCC7 MIPS64r6 builds") Patchwork: https://patchwork.linux-mips.org/patch/20297/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # 4.15+ 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 suboptimally generates __multi3 calls for mips64r6, so for that - * specific case only we'll implement it here. + * GCC 7 & 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__ == 7) +#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 8) /* multiply 64-bit values, low 64-bits returned */ static inline long long notrace dmulu(long long a, long long b)