All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sami Tolvanen <samitolvanen@google.com>
To: Alex Matveev <alxmtvv@gmail.com>, Andi Kleen <ak@linux.intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Greg Hackmann <ghackmann@google.com>,
	Kees Cook <keescook@chromium.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Yury Norov <ynorov@caviumnetworks.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	Nicholas Piggin <npiggin@gmail.com>
Cc: Sami Tolvanen <samitolvanen@google.com>
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	[thread overview]
Message-ID: <20171130233905.130602-7-samitolvanen@google.com> (raw)
In-Reply-To: <20171130233905.130602-1-samitolvanen@google.com>

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 <samitolvanen@google.com>
---
 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
-- 
2.15.0.531.g2ccb3012c9-goog

WARNING: multiple messages have this Message-ID (diff)
From: samitolvanen@google.com (Sami Tolvanen)
To: linux-arm-kernel@lists.infradead.org
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	[thread overview]
Message-ID: <20171130233905.130602-7-samitolvanen@google.com> (raw)
In-Reply-To: <20171130233905.130602-1-samitolvanen@google.com>

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 <samitolvanen@google.com>
---
 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
-- 
2.15.0.531.g2ccb3012c9-goog

  parent reply	other threads:[~2017-11-30 23:39 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 23:44 [PATCH 0/7] Add support for GNU gold Sami Tolvanen
2017-11-29 23:44 ` Sami Tolvanen
2017-11-29 23:44 ` [PATCH 1/7] kbuild: add ld-name macro and " Sami Tolvanen
2017-11-29 23:44   ` Sami Tolvanen
2017-11-30  0:32   ` Nick Desaulniers
2017-11-30  0:32     ` Nick Desaulniers
2017-11-30 17:38     ` Sami Tolvanen
2017-11-30 17:38       ` Sami Tolvanen
2017-11-29 23:44 ` [PATCH 2/7] kbuild: add ld-if-name-version and linker-specific macros Sami Tolvanen
2017-11-29 23:44   ` Sami Tolvanen
2017-11-29 23:44 ` [PATCH 3/7] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION with GNU gold Sami Tolvanen
2017-11-29 23:44   ` Sami Tolvanen
2017-11-30  2:10   ` Nicholas Piggin
2017-11-30  2:10     ` Nicholas Piggin
2017-11-29 23:44 ` [PATCH 4/7] arm64: fix -m for " Sami Tolvanen
2017-11-29 23:44   ` Sami Tolvanen
2017-11-29 23:44 ` [PATCH 5/7] arm64: keep .altinstructions and .altinstr_replacement Sami Tolvanen
2017-11-29 23:44   ` Sami Tolvanen
2017-11-29 23:57   ` Nick Desaulniers
2017-11-29 23:57     ` Nick Desaulniers
2017-11-30  1:58     ` Nicholas Piggin
2017-11-30  1:58       ` Nicholas Piggin
2017-11-30 17:00       ` Nick Desaulniers
2017-11-30 17:00         ` Nick Desaulniers
2017-12-01  0:36         ` Nicholas Piggin
2017-12-01  0:36           ` Nicholas Piggin
2017-11-30 17:48       ` Sami Tolvanen
2017-11-30 17:48         ` Sami Tolvanen
2017-11-29 23:44 ` [PATCH 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold Sami Tolvanen
2017-11-29 23:44   ` Sami Tolvanen
2017-11-30  0:30   ` Nick Desaulniers
2017-11-30  0:30     ` Nick Desaulniers
2017-11-30 17:50     ` Sami Tolvanen
2017-11-30 17:50       ` Sami Tolvanen
2017-11-29 23:44 ` [PATCH 7/7] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS Sami Tolvanen
2017-11-29 23:44   ` Sami Tolvanen
2017-11-30  9:31   ` Ard Biesheuvel
2017-11-30  9:31     ` Ard Biesheuvel
2017-11-30  9:31     ` Ard Biesheuvel
2017-11-30 23:38 ` [PATCH v2 0/7] Add support for GNU gold Sami Tolvanen
2017-11-30 23:38   ` Sami Tolvanen
2017-11-30 23:38   ` [PATCH v2 1/7] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION Sami Tolvanen
2017-11-30 23:38     ` Sami Tolvanen
2017-11-30 23:39   ` [PATCH v2 2/7] arm64: keep .altinstructions and .altinstr_replacement Sami Tolvanen
2017-11-30 23:39     ` Sami Tolvanen
2017-11-30 23:39   ` [PATCH v2 3/7] kbuild: add ld-name macro Sami Tolvanen
2017-11-30 23:39     ` Sami Tolvanen
2017-11-30 23:39   ` [PATCH v2 4/7] kbuild: add __ld-ifversion and linker-specific macros Sami Tolvanen
2017-11-30 23:39     ` Sami Tolvanen
2017-11-30 23:39   ` [PATCH v2 5/7] arm64: fix -m for GNU gold Sami Tolvanen
2017-11-30 23:39     ` Sami Tolvanen
2017-11-30 23:39   ` Sami Tolvanen [this message]
2017-11-30 23:39     ` [PATCH v2 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to " Sami Tolvanen
2017-12-01  0:13     ` Nick Desaulniers
2017-12-01  0:13       ` Nick Desaulniers
2017-11-30 23:39   ` [PATCH v2 7/7] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS Sami Tolvanen
2017-11-30 23:39     ` Sami Tolvanen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171130233905.130602-7-samitolvanen@google.com \
    --to=samitolvanen@google.com \
    --cc=ak@linux.intel.com \
    --cc=alxmtvv@gmail.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ghackmann@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maxim.kuvyrkov@linaro.org \
    --cc=michal.lkml@markovi.net \
    --cc=mka@chromium.org \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    --cc=ynorov@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.