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: 10083915 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 727A66020B for ; Wed, 29 Nov 2017 23:45:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64A9A29C84 for ; Wed, 29 Nov 2017 23:45:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 588F029D55; Wed, 29 Nov 2017 23:45:35 +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 0D18829C84 for ; Wed, 29 Nov 2017 23:45:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753052AbdK2XpW (ORCPT ); Wed, 29 Nov 2017 18:45:22 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:40496 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753299AbdK2XpB (ORCPT ); Wed, 29 Nov 2017 18:45:01 -0500 Received: by mail-pl0-f68.google.com with SMTP id 1so3065578pla.7 for ; Wed, 29 Nov 2017 15:45:01 -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=rl45kINTEhl+WLVFKfdwMe4X7xfnnVP/MhfghjDZzgNH/h2UZvep5TauhvXvw27q+M z849oUvQLpRZe8izvd8zDQsGsdyNVuajbRKuzHyzMsOGbIxSjPJOXXtbjNyt77bGybaT 2v0d6WgKqCQR8Hu3CIrbonNrij6LOYD8lZ8GgOUQvbLHcu+deY3xRR56uZu73BXJSXqV JIpDi+IbD4fF/gt+1Ib9IVTlFpfovppVveXH7XmIyS0L9+MxXUVcWfzQBirmW4UkvCVx eU2AFRfTY1vN33IT8crzTyHIfZvc1kSE+JsovXGjHSUeOfSfoLhvyzfxfNG7vHCMQQTS a3jw== X-Gm-Message-State: AJaThX7GNAfLdkbqe/rzTzuZ/zUljwwwpb/7f3OwDhdOye+RDp/lkFcH +cjL4VupWt3lL0YhJDpeZ9S0zA== 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 Cc: Sami Tolvanen 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> 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 --- 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