From 173a085e48a1d99d23502f308fa62f77d9cd3443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Holz?= Date: Thu, 30 Nov 2023 18:09:26 +0100 Subject: [PATCH] Kernel: Only unmap prekernel on x86_64 Other arches don't use the prekernel, so don't try to unmap it on non-x86 platforms. For some reason, this didn't cause aarch64 to crash, but on riscv64 this would cause a panic. --- Kernel/Arch/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Arch/init.cpp b/Kernel/Arch/init.cpp index 9708833d5f..5843c19821 100644 --- a/Kernel/Arch/init.cpp +++ b/Kernel/Arch/init.cpp @@ -267,9 +267,9 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init([[maybe_unused]] BootInfo con } dmesgln("Starting SerenityOS..."); +#if ARCH(X86_64) MM.unmap_prekernel(); -#if ARCH(X86_64) // Ensure that the safemem sections are not empty. This could happen if the linker accidentally discards the sections. VERIFY(+start_of_safemem_text != +end_of_safemem_text); VERIFY(+start_of_safemem_atomic_text != +end_of_safemem_atomic_text);