From 40fb41322e1a500a080cb8fa7af966f1950420d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Sat, 14 Oct 2023 14:56:57 +0200 Subject: [PATCH] Kernel: Fix SipHash aarch64 boot regression Moving the DeviceManagement initialization, which is only needed by userland in the first place, to after interrupt and time management initialization (like other things that require randomness) allows the SipHash initialization to access good randomness without problems. Note: There currently is another, unrelated boot problem on aarch64, which is not caused by SipHash as far as we know. This commit therefore only fixes the SipHash regression. --- Kernel/Arch/init.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Kernel/Arch/init.cpp b/Kernel/Arch/init.cpp index c1efed6860..8f3bcd12e0 100644 --- a/Kernel/Arch/init.cpp +++ b/Kernel/Arch/init.cpp @@ -262,12 +262,6 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init([[maybe_unused]] BootInfo con } dmesgln("Starting SerenityOS..."); - DeviceManagement::initialize(); - SysFSComponentRegistry::initialize(); - DeviceManagement::the().attach_null_device(*NullDevice::must_initialize()); - DeviceManagement::the().attach_console_device(*ConsoleDevice::must_create()); - DeviceManagement::the().attach_device_control_device(*DeviceControlDevice::must_create()); - MM.unmap_prekernel(); #if ARCH(X86_64) @@ -287,6 +281,12 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init([[maybe_unused]] BootInfo con // Initialize TimeManagement before using randomness! TimeManagement::initialize(0); + DeviceManagement::initialize(); + SysFSComponentRegistry::initialize(); + DeviceManagement::the().attach_null_device(*NullDevice::must_initialize()); + DeviceManagement::the().attach_console_device(*ConsoleDevice::must_create()); + DeviceManagement::the().attach_device_control_device(*DeviceControlDevice::must_create()); + __stack_chk_guard = get_fast_random(); Process::initialize();