Kernel: Move smp_initialized flag after schedulers are initialized

Before this real hardware failed to boot with smp enabled. Allocating
the idle thread does a page mapping which ends up broadcasting TLB
shootdown to other processes. This ends up failing somewhere halting the
processors never allowing them to initialize their scheduler
This commit is contained in:
Bananymous 2026-01-03 23:39:07 +02:00
parent a8aa89362d
commit 706c0816dd
3 changed files with 6 additions and 4 deletions

View File

@ -57,8 +57,9 @@ namespace Kernel
static ProcessorID current_id() { return read_gs_sized<ProcessorID>(offsetof(Processor, m_id)); }
static ProcessorID id_from_index(size_t index);
static uint8_t count() { return s_processor_count; }
static bool is_smp_enabled() { return s_is_smp_enabled; }
static uint8_t count() { return s_processor_count; }
static bool is_smp_enabled() { return s_is_smp_enabled; }
static void set_smp_enabled() { s_is_smp_enabled = true; }
static void wait_until_processors_ready();
static void toggle_should_print_cpu_load() { s_should_print_cpu_load = !s_should_print_cpu_load; }

View File

@ -189,8 +189,6 @@ namespace Kernel
__builtin_ia32_pause();
}
}
s_is_smp_enabled = true;
}
void Processor::handle_ipi()

View File

@ -136,6 +136,9 @@ namespace Kernel
while (s_schedulers_initialized < Processor::count())
__builtin_ia32_pause();
if (Processor::count() > 1)
Processor::set_smp_enabled();
return {};
}