From 2833bdd113fa96166f67369b2c3d6742670e972d Mon Sep 17 00:00:00 2001 From: Almudena Garcia Date: Tue, 6 Oct 2020 23:19:58 +0200 Subject: [PATCH] fix: fix kernel panic in SMP mode Add mp_desc_init() call in BSP processor, to initialize some structures needed for SMP --- i386/i386at/model_dep.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c index 346f2b9c..eb2015a4 100644 --- a/i386/i386at/model_dep.c +++ b/i386/i386at/model_dep.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -501,6 +502,13 @@ i386at_init(void) ldt_init(); ktss_init(); +/* + * Initialize SMP structures in the master processor + */ +#if NCPUS > 1 + mp_desc_init(master_cpu); +#endif // NCPUS + #if INIT_VM_MIN_KERNEL_ADDRESS != LINEAR_MIN_KERNEL_ADDRESS /* Get rid of the temporary direct mapping and flush it out of the TLB. */ for (i = 0 ; i < nb_direct; i++) { -- 2.28.0