Oops, then I attached the wrong file. I attach the fixed version

El mié., 7 oct. 2020 a las 0:30, Samuel Thibault (<[email protected]>)
escribió:

> Almudena Garcia, le mer. 07 oct. 2020 00:09:12 +0200, a ecrit:
> > Thanks. You can merge the last version too, which improves a bit this
> patch ;)
>
> I applied the last version.
>
> Samuel
>
>
From 2833bdd113fa96166f67369b2c3d6742670e972d Mon Sep 17 00:00:00 2001
From: Almudena Garcia <[email protected]>
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 <i386/ktss.h>
 #include <i386/ldt.h>
 #include <i386/machspl.h>
+#include <i386/mp_desc.h>
 #include <i386/pic.h>
 #include <i386/pit.h>
 #include <i386/pmap.h>
@@ -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

Reply via email to