From dd0c1095a142263b31eafad5cc3b7d852c465484 Mon Sep 17 00:00:00 2001 From: Justinien Bouron Date: Sun, 10 Mar 2019 05:16:22 -0700 Subject: [PATCH] Fix issue where Application Processors would sometimes use the physical address of LAPIC registers without translating it to virtual ones first. That would happen if VM had changed the page tables before the APs configured their LAPIC. --- minix/kernel/arch/i386/memory.c | 2 -- minix/kernel/main.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/minix/kernel/arch/i386/memory.c b/minix/kernel/arch/i386/memory.c index 8450aa344..f70f7d98f 100644 --- a/minix/kernel/arch/i386/memory.c +++ b/minix/kernel/arch/i386/memory.c @@ -964,8 +964,6 @@ int arch_enable_paging(struct proc * caller) } #if CONFIG_SMP barrier(); - - wait_for_APs_to_finish_booting(); #endif #endif diff --git a/minix/kernel/main.c b/minix/kernel/main.c index 1f5f3e51f..50b053810 100644 --- a/minix/kernel/main.c +++ b/minix/kernel/main.c @@ -104,6 +104,9 @@ void bsp_finish_booting(void) /* Kernel may no longer use bits of memory as VM will be running soon */ kernel_may_alloc = 0; +#ifdef CONFIG_SMP + wait_for_APs_to_finish_booting(); +#endif switch_to_user(); NOT_REACHABLE;