From patchwork Thu Nov 30 23:39:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10085779 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 1A4BA602BC for ; Thu, 30 Nov 2017 23:39:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09D752A2DC for ; Thu, 30 Nov 2017 23:39:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F140C2A41F; Thu, 30 Nov 2017 23:39:37 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CEB12A2DC for ; Thu, 30 Nov 2017 23:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752054AbdK3XjW (ORCPT ); Thu, 30 Nov 2017 18:39:22 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:45815 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752025AbdK3XjT (ORCPT ); Thu, 30 Nov 2017 18:39:19 -0500 Received: by mail-it0-f67.google.com with SMTP id z6so507852iti.4 for ; Thu, 30 Nov 2017 15:39:19 -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=bpO8qxqQyluljw7SZYTW+L23pGovHvZXaNZkTCrVQ5A=; b=jDFPEu6c3HIf6zelR78n0BLbhwpbTvZOl1T4Gxuo6w61bdyp252bQjghATFQ5D8mr8 Sb+bGbtoabxgjsTi5l/+GgB1zoKxduNjBOQbumMejPbumVZX2xGSYMrGowbKCq0ES1Ip 5iBzo84jZqG+f9hmoerzBglC9Wi0w0nNrvyBk0IE7rqwSA3qLgoMALH5L7OfL16WO6SJ Y6mqcgEk41oRl8p7w8rEgld0kOd2YBJ5lGlzKjaDHcCPWkvBaIxDo9PU+Mgad5VNBiRP 9Ni/zkmO0/SY76VpCSZ635sCoQtGwg9csYRGIjiP1lg21hOX22sXcluqBOEH5XKtHO+m i4wA== 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=bpO8qxqQyluljw7SZYTW+L23pGovHvZXaNZkTCrVQ5A=; b=pNcf30GrsqGnXtLOMpWKlROyBsAWSxqIFeLDJUALiQrSoyaiG150Ward+/PKb28buF VRhPi4M6++rhrq22XGSa6q36xscmrfsgWekicGGo0//PuBjYl9VI0HLh19hv+S7kPk82 nkTNf9N1bRiEJ5A44MLlslqlCP6iSRLDxl8g9jw/tt6+H9cEsFaMZzabhZsM+GW7xED9 qFn9JgXe3onCPX5KbU7XMyzkZSN0T7sbU2s44eE7bFo3vIKJuigglg6j/G7tifv8aAuG imOLKhLD082LvbfzjbX9iQzdKMapJDO5VEdM6tk7/kGwasWa6tklQu3J7YqN1h9vJdEf rXBQ== X-Gm-Message-State: AJaThX7TnyiD++KYSI7fAqJ/RCQwlHijqm22ybIcIiZTq87fErIgMyKb n9DcZSOVne56J9PGEBQO0GzRLg== X-Google-Smtp-Source: AGs4zMZeua7ZgpzGS2270Zb9eS8FpNGXycTS/InKp7xVAJ75H+x2EI2UCRpVDkFQJVm+hNt5M5E0vA== X-Received: by 10.36.51.67 with SMTP id k64mr5255250itk.12.1512085158741; Thu, 30 Nov 2017 15:39:18 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id h73sm2896676itb.21.2017.11.30.15.39.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 15:39:17 -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 Cc: Sami Tolvanen Subject: [PATCH v2 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold Date: Thu, 30 Nov 2017 15:39:04 -0800 Message-Id: <20171130233905.130602-7-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171130233905.130602-1-samitolvanen@google.com> References: <20171129234442.655-1-samitolvanen@google.com> <20171130233905.130602-1-samitolvanen@google.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.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 Reviewed-by: Nick Desaulniers --- arch/arm64/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 82a0df6e865e..68eed687e468 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -26,8 +26,17 @@ 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 +else + ifeq ($(ld-name),gold) +# Pass --no-fix-cortex-a53-843419 to ensure the erratum fix is disabled +LDFLAGS += --no-fix-cortex-a53-843419 + endif endif KBUILD_DEFCONFIG := defconfig