diff options
author | Ian Moffett <ian@osmora.org> | 2024-06-08 18:15:13 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-06-08 18:15:13 -0400 |
commit | 44ef655a0afc3d2c8aa305f94b412f9d89bec846 (patch) | |
tree | a04fb4070745ad66f267695d91cfa92e5a573a57 /sys/arch | |
parent | d5381223cea600ff007069bc1313de142cd06972 (diff) |
kernel/amd64: Pass CPU info to cpu_startup()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 2fe71a9..82fa97b 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -45,7 +45,7 @@ int ibrs_enable(void); -static struct cpu_info g_bsp_ci = {0}; +struct cpu_info g_bsp_ci = {0}; static struct gdtr bsp_gdtr = { .limit = sizeof(struct gdt_entry) * 256 - 1, .offset = (uintptr_t)&g_gdt_data[0] @@ -99,15 +99,16 @@ this_cpu(void) } void -cpu_startup(void) +cpu_startup(struct cpu_info *ci) { gdt_load(&bsp_gdtr); idt_load(); setup_vectors(); - amd64_write_gs_base((uintptr_t)&g_bsp_ci); - init_tss(&g_bsp_ci); + amd64_write_gs_base((uintptr_t)ci); + init_tss(ci); try_mitigate_spectre(); + __ASMV("sti"); /* Unmask interrupts */ lapic_init(); } |