Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1811637imm; Mon, 3 Sep 2018 10:03:42 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda/HP/MWqB5Xxr3AKZhPS22RwqfI5J6yJCNVmwFKHkwymt3dOdryHa0IaiA6ecNFiso4gJa X-Received: by 2002:a62:778c:: with SMTP id s134-v6mr30454604pfc.189.1535994222830; Mon, 03 Sep 2018 10:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535994222; cv=none; d=google.com; s=arc-20160816; b=e3BwKXuwNGE/QAqOpH2gMDcwf3vPaYf4b95eqHAaZiAve9u0HXdggiTCWc7ZxoWtKd aX+SySFUcFs7g3pECmTuRyQYqtyNok2yBpism+1u9UTI7GHi2HsEMw/fwCkbJhLnE3F8 48npdny89AAldN9TqmjqEn7V8AgDVta62rHVF7DrNaAy86LGy6y83JxE8A2dujSvItj8 4xx5KkmRSvjGdPvmlvR02IvcWkuCHzhGILg0Ou1H0GPHjj1Z7/WBhoIgFlY9MB0U0bv5 aKK+OQ5soI3rlO5boGchb+Gf2idjfFsRRn41guU2sfF2iwZah2BUtrjfYY1lwmhx2CMg X+uQ== 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=dmpGCvcSi1CU0Y/YNLGfCF1lDlaN/SAKkjDMej4oirw=; b=gm40OM+Mj06mQZT4rkwqHFuXJQYmiGJbXzy3T/2g0aCjL3beZotUoNFrpO+GiKDSvX Gx2xjBQOjvEyPwQFMWPr13Ta33uDquEFfbFgjjHHdokdE8xZ3wol9ZfHmgGscBHcE/Fu CwzG274p7mztfQUaOOGQRdQvef/ZtNGBfbIKcudKZhAECKKonqIXDXfaTSVwtab6VYDJ qiHv2CtPn67GZG3lHKDwH1AQPsJNZ1rikVSkta8G/+XWtJiwEMrVJpRPnNsn7eZTqVBC BNysv5JJkhmCn8Mvitf6C/5q6Cp8cOA/+Fgb6G/hGBFek2W41F/m14xhAD7N4AxOSXK7 rqxA== 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 y5-v6si13753027plt.438.2018.09.03.10.03.28; Mon, 03 Sep 2018 10:03:42 -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 S1728956AbeICVXX (ORCPT + 99 others); Mon, 3 Sep 2018 17:23:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38928 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728616AbeICVXX (ORCPT ); Mon, 3 Sep 2018 17:23:23 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 79617CFB; Mon, 3 Sep 2018 17:02:23 +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.4 76/80] MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7 Date: Mon, 3 Sep 2018 18:49:54 +0200 Message-Id: <20180903164937.181652831@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903164934.171677301@linuxfoundation.org> References: <20180903164934.171677301@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.4-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)