x86_64: zero-init BSP and AP CPU cpu_data before use
This commit is contained in:
@@ -29,6 +29,7 @@ extern "C" void ap_trampoline_exit(void)
|
|||||||
this_cpu->c_cpu_id = cpu_id;
|
this_cpu->c_cpu_id = cpu_id;
|
||||||
|
|
||||||
struct cpu_data *self = get_this_cpu();
|
struct cpu_data *self = get_this_cpu();
|
||||||
|
memset(self, 0x0, sizeof *self);
|
||||||
self->c_flags = CPU_ONLINE;
|
self->c_flags = CPU_ONLINE;
|
||||||
self->c_id = cpu_id;
|
self->c_id = cpu_id;
|
||||||
this_cpu->c_data = self;
|
this_cpu->c_data = self;
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ int ml_init(uintptr_t arg)
|
|||||||
init_per_cpu_areas();
|
init_per_cpu_areas();
|
||||||
|
|
||||||
struct cpu_data *this_cpu = get_this_cpu();
|
struct cpu_data *this_cpu = get_this_cpu();
|
||||||
|
memset(this_cpu, 0x0, sizeof *this_cpu);
|
||||||
|
|
||||||
this_cpu->c_flags = CPU_ONLINE;
|
this_cpu->c_flags = CPU_ONLINE;
|
||||||
this_cpu->c_id = this_cpu();
|
this_cpu->c_id = this_cpu();
|
||||||
g_bootstrap_cpu.c_data = this_cpu;
|
g_bootstrap_cpu.c_data = this_cpu;
|
||||||
|
|||||||
Reference in New Issue
Block a user