From 8c4d369672ef824237895b42c9a1ab93fb32cc2e Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 13 Dec 2023 12:38:19 -0500 Subject: kernel/amd64: machdep: Cleanup processor_init() This commit cleans up processor_init() by tidying up and reordering calls to ensure things will be set up in the correct order. Signed-off-by: Ian Moffett --- sys/arch/amd64/machdep.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/amd64/machdep.c b/sys/arch/amd64/machdep.c index 9a81c25..66778a6 100644 --- a/sys/arch/amd64/machdep.c +++ b/sys/arch/amd64/machdep.c @@ -86,23 +86,24 @@ processor_init(void) struct cpu_info *cur_cpu = NULL; + cur_cpu = this_cpu(); + interrupts_init(); gdt_load(&g_gdtr); + CPU_INFO_LOCK(cur_cpu); + init_tss(cur_cpu); + CPU_INFO_UNLOCK(cur_cpu); + if (!__TEST(init_flags, INIT_FLAG_IOAPIC)) { init_flags |= INIT_FLAG_IOAPIC; ioapic_init(); } lapic_init(); /* Per core */ - cur_cpu = this_cpu(); - - CPU_INFO_LOCK(cur_cpu); - cur_cpu->tss = NULL; - init_tss(cur_cpu); - CPU_INFO_UNLOCK(cur_cpu); /* Use spectre mitigation if enabled */ if (try_spectre_mitigate != NULL) try_spectre_mitigate(); + } -- cgit v1.2.3