From patchwork Mon Oct 31 19:44:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 9406341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9F2A360234 for ; Mon, 31 Oct 2016 19:46:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F8D228DC3 for ; Mon, 31 Oct 2016 19:46:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 840E328E0F; Mon, 31 Oct 2016 19:46:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 332D628DC3 for ; Mon, 31 Oct 2016 19:46:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1IVx-00077B-RL; Mon, 31 Oct 2016 19:45:01 +0000 Received: from smtp-out-so.shaw.ca ([64.59.136.138]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1IVs-000744-FO for linux-arm-kernel@lists.infradead.org; Mon, 31 Oct 2016 19:44:57 +0000 Received: from triton.mmayer.net ([70.71.160.251]) by shaw.ca with SMTP id 1IVUcQ4M5Kjjy1IVVc3dU5; Mon, 31 Oct 2016 13:44:34 -0600 X-Authority-Analysis: v=2.2 cv=SPoybKnH c=1 sm=1 tr=0 a=6xzog4CasRozao6qlzTIAw==:117 a=6xzog4CasRozao6qlzTIAw==:17 a=CH0kA5CcgfcA:10 a=Q-fNiiVtAAAA:8 a=CCpqsmhAAAAA:8 a=uKRAqrWVPOqCGxYQ4_8A:9 a=Fp8MccfUoT0GBdDC_Lng:22 a=ul9cdbp4aOFLsgKbc677:22 Received: by triton.mmayer.net (Postfix, from userid 501) id C55182A086E9; Mon, 31 Oct 2016 12:44:30 -0700 (PDT) From: Markus Mayer To: Will Deacon , Catalin Marinas Subject: [PATCH] arm64: errata: Check for --fix-cortex-a53-843419 and --fix-cortex-a53 Date: Mon, 31 Oct 2016 12:44:14 -0700 Message-Id: <20161031194414.61287-1-code@mmayer.net> X-Mailer: git-send-email 2.9.2 X-CMAE-Envelope: MS4wfH753wEl4+IMHe4bl7YnrJuKf+mTrBG/nEstymEE2i1urHmXlakotbsrsS2aaPJKlSCG+vZUAKq7yVrzfOBi1ca49dUAlpTE4ubML2ikvltKvW+bCsmj cgjSdbA1rCTlQvvhcczdGzD/jol01jkStDOFrp1IAZmEv+fcHbJgX4+UEXSkelmyS0jExpDWPAo97L/VGUwzqftANtfGunNudanC/dtFg6Vb1vl4Yl+m/Rww GGRG/7sLfxY3J5kM/yoinyK8RCQqwnQBz38vaf8FriybXAXgdWDTVna9vy0aZZdZWNQgyN0+n5DB0GZZNteSJpVomhUchNbZBGaFnM/sdvo= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161031_124456_639933_6A585FBD X-CRM114-Status: GOOD ( 10.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Mayer , Linux Kernel Mailing List , ARM Kernel Mailing List MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Mayer The new errata check leads to a warning with some older versions of the linker that do know how to work around the errata, but still use the original name of the command line option: --fix-cortex-a53. The commit in question that changed the name of the option can be found at [1]. It looks like only "gold" is affected by this rename. Traditional "ld" isn't. (There, the argument was always called --fix-cortex-a53-843419.) To allow older versions of gold to properly handle the erratum if they can, check whether ld supports the old name of this option in addition to checking the new one. [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=7a2a1c793578a8468604e661dda025ecb8d0bd20;hp=cfbf0e3c5b637d66b2b1aeadecae9c187b825b2f Signed-off-by: Markus Mayer --- Using the change proposed here, things work for me as expected: $ aarch64-linux-ld -v GNU ld (GNU Binutils) Linaro 2014.11-2 2.24.0.20141017 $ grep fix-cortex aarch64.log /bin/bash scripts/link-vmlinux.sh aarch64-linux-ld -EL -p --no-undefined -X --fix-cortex-a53 --build-id ; true + aarch64-linux-ld -EL -p --no-undefined -X --fix-cortex-a53 --build-id -o .tmp_vmlinux1 -T ./arch/arm64/kernel/vmlinux.lds arch/arm64/kernel/head.o init/built-in.o --start-group usr/built-in.o arch/arm64/kernel/built-in.o arch/arm64/mm/built-in.o arch/arm64/net/built-in.o arch/arm64/kvm/built-in.o arch/arm64/xen/built-in.o arch/arm64/crypto/built-in.o ./drivers/firmware/efi/libstub/lib.a kernel/built-in.o certs/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o block/built-in.o arch/arm64/lib/lib.a lib/lib.a arch/arm64/lib/built-in.o lib/built-in.o drivers/built-in.o sound/built-in.o firmware/built-in.o net/built-in.o virt/built-in.o --end-group [...] arch/arm64/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index ab51aed..231ba69 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -20,7 +20,13 @@ endif ifeq ($(CONFIG_ARM64_ERRATUM_843419),y) ifeq ($(call ld-option, --fix-cortex-a53-843419),) -$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum) + ifeq ($(call ld-option, --fix-cortex-a53),) +$(warning ld does not support --fix-cortex-a53-843419 or --fix-cortex-a53; kernel may be susceptible to erratum) + else +# When this option was first introduced, it was called --fix-cortex-a53 in gold. +# So, let's use that as fall-back if the linker understands it. +LDFLAGS_vmlinux += --fix-cortex-a53 + endif else LDFLAGS_vmlinux += --fix-cortex-a53-843419 endif