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:
parent
a8aa89362d
commit
706c0816dd
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -189,8 +189,6 @@ namespace Kernel
|
|||
__builtin_ia32_pause();
|
||||
}
|
||||
}
|
||||
|
||||
s_is_smp_enabled = true;
|
||||
}
|
||||
|
||||
void Processor::handle_ipi()
|
||||
|
|
|
|||
|
|
@ -136,6 +136,9 @@ namespace Kernel
|
|||
while (s_schedulers_initialized < Processor::count())
|
||||
__builtin_ia32_pause();
|
||||
|
||||
if (Processor::count() > 1)
|
||||
Processor::set_smp_enabled();
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue