All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: catalin.marinas@arm.com, will@kernel.org
Cc: mark.rutland@arm.com, ndesaulniers@google.com, trix@redhat.com,
	 linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev,
	 patches@lists.linux.dev, Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer
Date: Wed, 25 Oct 2023 10:21:28 -0700	[thread overview]
Message-ID: <20231025-disable-arm64-be-ias-b4-llvm-15-v1-1-b25263ed8b23@kernel.org> (raw)

A recent refactoring in the arm64 tree exposed an assembler bug in LLVM
with regards to the generation of NOPs for arm64 big endian, resulting
in near-immediate crashes on boot in QEMU.

Restrict CONFIG_CPU_BIG_ENDIAN to a known good assembler, which is
either GNU as or LLVM's IAS 15.0.0 and newer, which contains the linked
commit.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1948
Link: https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/arm64/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index adf2f8a327be..92d33ece4c45 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1360,6 +1360,8 @@ choice
 config CPU_BIG_ENDIAN
 	bool "Build big-endian kernel"
 	depends on !LD_IS_LLD || LLD_VERSION >= 130000
+	# https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c
+	depends on AS_IS_GNU || AS_VERSION >= 150000
 	help
 	  Say Y if you plan on running a kernel with a big-endian userspace.
 

---
base-commit: 22e877699642285c47f5d7d83b2d59815c29ebe8
change-id: 20231025-disable-arm64-be-ias-b4-llvm-15-b6f30f3f24be

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <nathan@kernel.org>
To: catalin.marinas@arm.com, will@kernel.org
Cc: mark.rutland@arm.com, ndesaulniers@google.com, trix@redhat.com,
	 linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev,
	 patches@lists.linux.dev, Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer
Date: Wed, 25 Oct 2023 10:21:28 -0700	[thread overview]
Message-ID: <20231025-disable-arm64-be-ias-b4-llvm-15-v1-1-b25263ed8b23@kernel.org> (raw)

A recent refactoring in the arm64 tree exposed an assembler bug in LLVM
with regards to the generation of NOPs for arm64 big endian, resulting
in near-immediate crashes on boot in QEMU.

Restrict CONFIG_CPU_BIG_ENDIAN to a known good assembler, which is
either GNU as or LLVM's IAS 15.0.0 and newer, which contains the linked
commit.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1948
Link: https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/arm64/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index adf2f8a327be..92d33ece4c45 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1360,6 +1360,8 @@ choice
 config CPU_BIG_ENDIAN
 	bool "Build big-endian kernel"
 	depends on !LD_IS_LLD || LLD_VERSION >= 130000
+	# https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c
+	depends on AS_IS_GNU || AS_VERSION >= 150000
 	help
 	  Say Y if you plan on running a kernel with a big-endian userspace.
 

---
base-commit: 22e877699642285c47f5d7d83b2d59815c29ebe8
change-id: 20231025-disable-arm64-be-ias-b4-llvm-15-b6f30f3f24be

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2023-10-25 17:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 17:21 Nathan Chancellor [this message]
2023-10-25 17:21 ` [PATCH] arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer Nathan Chancellor
2023-10-25 18:01 ` Mark Rutland
2023-10-25 18:01   ` Mark Rutland
2023-10-25 18:31   ` Nathan Chancellor
2023-10-25 18:31     ` Nathan Chancellor
2023-10-26 15:28     ` Catalin Marinas
2023-10-26 15:28       ` Catalin Marinas
2023-10-26 15:31       ` Mark Rutland
2023-10-26 15:31         ` Mark Rutland
2023-10-26 15:33         ` Catalin Marinas
2023-10-26 15:33           ` Catalin Marinas
2023-10-26 16:36 ` Catalin Marinas
2023-10-26 16:36   ` Catalin Marinas

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=20231025-disable-arm64-be-ias-b4-llvm-15-v1-1-b25263ed8b23@kernel.org \
    --to=nathan@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=ndesaulniers@google.com \
    --cc=patches@lists.linux.dev \
    --cc=trix@redhat.com \
    --cc=will@kernel.org \
    /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.