After upgrading past LLVM 11 import, I can't boot kernel. Console output stops after: [ 42.544826] kexec_core: Starting new kernel KDB: debugger backends: ddb KDB: current backend: ddb Rebuilding kernel from known-to-work revision with LLVM 11 also causes this issue, which is why it must be a compiler problem.
Created attachment 217398 [details] Compiler fix for kernel failure It turned out that this is an LLVM bug in code generation of mtsprg0-3. When a ppc64 variant was added, typos were introduced that prevented it from working correctly.
Reported upstream to https://bugs.llvm.org/show_bug.cgi?id=47259
A commit references this bug: Author: dim Date: Fri Aug 21 10:06:01 UTC 2020 New revision: 364455 URL: https://svnweb.freebsd.org/changeset/base/364455 Log: Merge commit 95e18b2d9d5f from llvm git (by Kang Zhang): [PowerPC] Fix a typo for InstAlias of mfsprg D77531 has a type for mfsprg, it should be mtsprg. This patch is to fix this typo. This should fix booting powerpc64 kernels, after LLVM 11 was imported. PR: 248763 Changes: head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstr64Bit.td
Fixed by the updated LLVM toolchain.
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a0108291bcc067384d5f70749ba6869e3390cda3 commit a0108291bcc067384d5f70749ba6869e3390cda3 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2020-08-21 10:06:01 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-12-22 09:58:32 +0000 Merge commit 95e18b2d9d5f from llvm git (by Kang Zhang): [PowerPC] Fix a typo for InstAlias of mfsprg D77531 has a type for mfsprg, it should be mtsprg. This patch is to fix this typo. This should fix booting powerpc64 kernels, after LLVM 11 was imported. PR: 248763 (cherry picked from commit 2a99bea5784f4b347a70967fe4b8faf1c7280f79) contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstr64Bit.td | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)