From patchwork Wed Nov 29 23:44:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10083939 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 C76F860353 for ; Wed, 29 Nov 2017 23:46:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B89CA29D52 for ; Wed, 29 Nov 2017 23:46:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9F9C29C84; Wed, 29 Nov 2017 23:46:53 +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, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3A1CE29C84 for ; Wed, 29 Nov 2017 23:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=CQHmEBTnPMlseivURV27wBvlab9xyrl+a++dZ5whbiM=; b=bh/6gOWfnATJJH/mWcM4C3xECZ NIXYLiVpPG8Dx0niwIf4XcaWN5C6PeX43ZFogAfqerhysc+xnqpFG4U4/VIAA/ksOEol91V0WDqSW Mqx3GOyjqvCEmREFNWghzQ+tFkzLQ86htiVCyj9Zt7hESDSZNMmSjVIB4UBsOCe1BdlWUSa6x7P1r S3T40ROWUwdcbJMZ14TEzl+F87SKdIz9XpGqVSx2zPSVGROYMo5U6McOyz+O0r0gUC2fFS31F001T zajZYzGH9nbZmhTZ/JNDWq/BDvDmETjZS1rZ8fQJPE3j3N67ZFhcvWdHdssRHWzaPcpH9c4zmhheY OaVagrew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eKC44-0006EQ-1i; Wed, 29 Nov 2017 23:46:52 +0000 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKC2X-0003ba-90 for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2017 23:45:33 +0000 Received: by mail-pl0-x241.google.com with SMTP id bd8so3068891plb.9 for ; Wed, 29 Nov 2017 15:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QUfr5Cu91BAs7utoLZKS2jKsjdcyqfjQ883Hd80Y/1s=; b=GhgK2lO5+eHE3eu/B1lc7cVAdbRGpn/iHleloj8MEbwJmOqMQfrncTGD141yzGhhrm TIyUkc1htecEQVTJuYBArRlBrfgZtgFI7qeLQ7ZWB+GUy1j5V6HGLgG0DQwUBqe49QnJ a6XqFvZ1cMP1VdH55J80DNhA5fwrfSb6cqGQtpEdCiKYj7+y94UrrdTQTLFmrTjxgkl8 cro5M44Wotz7A6n074GOEUSfsZrcxE6mMb3S/Y7kTLraNFXEuG6glqMY7TVsVsAghGzR G4Dy3/F2dbAaxvIrFdy8CNvGVf+LfsZ6RhflTbYcP2B8H5l9lG+xcc2rPF+jf/4IP17F 01RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QUfr5Cu91BAs7utoLZKS2jKsjdcyqfjQ883Hd80Y/1s=; b=SuiVE/16yZ7jxoz5Vr9+Thz3JRFZE4zcdWDcyj7sp0dMLIIM/3QVFVbyc+9UMFTka3 +pMLcJTdGzQ3vpUMkddwuF/MXNMrXnaqlCJZcSHrEG6GAHAbG3FZ3rYYPH1O/GH5gGag U8kHS8lgmrkSyEY/Yt+0yDwiZLzdQLohrhWn4KdSH/+YgJHdcCxB+F2X5VPDtXKJEbQV Y9kfraXM22KXVghR1uZKYGjTX3FJtSQwDxIjwXiF8hA3a1sQmDhYhxrxbTRsCxduYl0a SpAj9lNjdo2K/eO7AbUpolcTPU+l3UEAdBL60XtdbXvSG6H4jS66HSMo3IEI7BtlJ8Zk +XuQ== X-Gm-Message-State: AJaThX4PPyw3DIXGoKSgZoYMz6P7jEe927tjaQm03v0S/bpeGkt18g4I UWgZFKcQOqGeK6RB6plRN5nKaA== X-Google-Smtp-Source: AGs4zMbLC4Po58EArBStJ6+5QKgLUGYeLOjqhQzHADxf+wDfHWAc2xMkKgTLbGjCkpOJi+hq35NAnQ== X-Received: by 10.84.174.67 with SMTP id q61mr591587plb.184.1511999101047; Wed, 29 Nov 2017 15:45:01 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id s14sm5326948pfe.36.2017.11.29.15.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 15:45:00 -0800 (PST) From: Sami Tolvanen To: Alex Matveev , Andi Kleen , Ard Biesheuvel , Greg Hackmann , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke , Nicholas Piggin Subject: [PATCH 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold Date: Wed, 29 Nov 2017 15:44:41 -0800 Message-Id: <20171129234442.655-7-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129234442.655-1-samitolvanen@google.com> References: <20171129234442.655-1-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_154517_705655_47199FEC X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sami Tolvanen 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 Some versions of GNU gold are known to produce broken code with --fix-cortex-a53-843419 as explained in this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21491 If ARM64_ERRATUM_843419 is disabled and we're using GNU gold, pass --no-fix-cortex-a53-843419 to the linker to ensure the erratum fix is not used even if the linker is configured to enable it by default. This change also adds a warning if the erratum fix is enabled and gold version <1.14 is used. Signed-off-by: Sami Tolvanen --- arch/arm64/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 82a0df6e865e..81a12713f7af 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -26,10 +26,19 @@ 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) else + ifeq ($(call gold-ifversion, -lt, 114000000, y), y) +$(warning This version of GNU gold may generate incorrect code with --fix-cortex-a53-843419;\ + see https://sourceware.org/bugzilla/show_bug.cgi?id=21491) + endif LDFLAGS_vmlinux += --fix-cortex-a53-843419 endif endif +ifeq ($(CONFIG_ARM64_ERRATUM_843419),) +# https://sourceware.org/bugzilla/show_bug.cgi?id=21491 +LDFLAGS_GOLD += --no-fix-cortex-a53-843419 +endif + KBUILD_DEFCONFIG := defconfig # Check for binutils support for specific extensions