Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2952592imu; Mon, 19 Nov 2018 08:32:38 -0800 (PST) X-Google-Smtp-Source: AJdET5eG1afYOJUArsNfNNt+IGA3khjzOxWt+BkLwy9SKi92gVF5UERrEuCQz5arGoltk6HmQvCP X-Received: by 2002:a62:29c4:: with SMTP id p187-v6mr23528974pfp.62.1542645158139; Mon, 19 Nov 2018 08:32:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645158; cv=none; d=google.com; s=arc-20160816; b=idN5mNR7+Lk4rfm+YYMuu+1t2ql7CVmwlAhY5kazT0Wm8Ct/j5JH7JjeTdEgGNYWhZ vBPqBQ2wH61oENShqk2jR+bn2dYUqH1yTBWwf1B7r3F+hmcgOJW5zJXVDIa3O/B3AQss 1LLeqSdf+WFOxxpaoT2ardMIheioabBxMcMwfl29td8vZD6x6yciyJcIt2GYxJAjY1A9 NQmp/XLXUurJXkmS/+YR8KaybIZxLqSjbHfskeWVO0VM38zlQ54hJPPafDetpqLH80Rd AaVz20ogF1jB6V9x/MN79urFImqwdFS0m/tXdsa1BNiz7Ht9KfsS64ltScfjCc2SVXe6 ZMiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=V/P6r1S8h+varRP5w8JQD+VUCxjvUDTakOO2WsZ6sLY=; b=lt3JW45Fsf+HM/slLhG4/STYUuc5f5sb8kv57wBsq+DUW3wzHMZDICdilVxschIpUr TAul7Uk08OsfVQt35bPrQZsyGgsrMPHKLCJ03dgD3t1cy5N00V3BkJcdApoA0bGZU4V3 s/n5NML94AA1/Rrn2IhCLYhzn1LbU51j2VdYRmeS/hCj6b6Qv/XfPTaSDayh4qP7v/Wd cF+domPKaz5EMYRzDMaPfX9lTeMoed1XRRaSSm432GexiSF2TFGE/7iblaRkAl06V0BN 8GI0QX51YJlS/o9hKxgcjRVoDD/Bhbo3GVsr5reQOdLO6VzulzAiqZEpWHt4rYxxWEGi Qk3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NfUazUBW; 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 c190-v6si9574134pfa.0.2018.11.19.08.32.22; Mon, 19 Nov 2018 08:32:38 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=NfUazUBW; 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 S1730336AbeKTCzR (ORCPT + 99 others); Mon, 19 Nov 2018 21:55:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:52878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730034AbeKTCzR (ORCPT ); Mon, 19 Nov 2018 21:55:17 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B94B720870; Mon, 19 Nov 2018 16:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645070; bh=UvO7wWR+PxZ2jgc1Co//ZpdECtmuq/bcH0QEIIu6Huw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NfUazUBWmkL34TUk5hsZS4kEFbR2Q3CSyjVIqk5g6Dq/Z3J+OIr6gdVASw7oPNhb7 sL44z7bdM4N9wbOq0y1xZZfv9Q22TnDffcJCMTwR3KOKQhapQrkMULUwt4vvhKZMQB YuNiskZDwyuzv+KnifCLbIjKxR/NLnafqWjry7xE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joel Stanley , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 007/205] powerpc/Makefile: Fix PPC_BOOK3S_64 ASFLAGS Date: Mon, 19 Nov 2018 17:25:14 +0100 Message-Id: <20181119162618.354142843@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joel Stanley [ Upstream commit 960e30029863db95ec79a71009272d4661db5991 ] Ever since commit 15a3204d24a3 ("powerpc/64s: Set assembler machine type to POWER4") we force -mpower4 to be passed to the assembler irrespective of the CFLAGS used (for Book3s 64). When building a powerpc64 kernel with clang, clang will not add -many to the assembler flags, so any instructions that the compiler has generated that are not available on power4 will cause an error: /usr/bin/as -a64 -mppc64 -mlittle-endian -mpower8 \ -I ./arch/powerpc/include -I ./arch/powerpc/include/generated \ -I ./include -I ./arch/powerpc/include/uapi \ -I ./arch/powerpc/include/generated/uapi -I ./include/uapi \ -I ./include/generated/uapi -I arch/powerpc -I arch/powerpc \ -maltivec -mpower4 -o init/do_mounts.o /tmp/do_mounts-3b0a3d.s /tmp/do_mounts-51ce54.s:748: Error: unrecognized opcode: `isel' GCC does include -many, so the GCC driven gas call will succeed: as -v -I ./arch/powerpc/include -I ./arch/powerpc/include/generated -I ./include -I ./arch/powerpc/include/uapi -I ./arch/powerpc/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -I arch/powerpc -I arch/powerpc -a64 -mpower8 -many -mlittle -maltivec -mpower4 -o init/do_mounts.o Note that isel is power7 and above for IBM CPUs. GCC only generates it for Power9 and above, but the above test was run against the clang generated assembly. Peter Bergner explains: When using -many -mpower4, gas will first try and find a matching power4 mnemonic and failing that, it will then allow any valid mnemonic that gas knows about. GCC's use of -many predates me though. IIRC, Alan looked at trying to remove it, but I forget why he didn't. Could be either a gcc or gas issue at the time. I'm not sure whether issue still exists or not. He and I have modified how gas works internally a fair amount since he tried removing gcc use of -many. I will also note that when using -many, gas will choose the first mnemonic that matches in the mnemonic table and we have (mostly) sorted the table so that server mnemonics show up earlier in the table than other mnemonics, so they'll be seen/chosen first. By explicitly setting -many we can build with Clang and GCC while retaining the -mpower4 option. Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -238,7 +238,11 @@ cpu-as-$(CONFIG_4xx) += -Wa,-m405 cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) cpu-as-$(CONFIG_E200) += -Wa,-me200 cpu-as-$(CONFIG_E500) += -Wa,-me500 -cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 + +# When using '-many -mpower4' gas will first try and find a matching power4 +# mnemonic and failing that it will allow any valid mnemonic that GAS knows +# about. GCC will pass -many to GAS when assembling, clang does not. +cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 -Wa,-many cpu-as-$(CONFIG_PPC_E500MC) += $(call as-option,-Wa$(comma)-me500mc) KBUILD_AFLAGS += $(cpu-as-y)