summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-05-14 20:27:02 +0200
committerRichard Braun <rbraun@sceen.net>2014-05-14 20:27:02 +0200
commit8d7c92193b3f887c3ebe3d844786a2c435edbec3 (patch)
treef9ae1ab88c83404e250bbfb7a8e10fa61390de92
parente097916b966ae4eee8f650f56bf070e9859e1cec (diff)
Improve the description of multi-processor setup
-rw-r--r--arch/x86/machine/cpu.h7
-rw-r--r--kern/kernel.c13
2 files changed, 18 insertions, 2 deletions
diff --git a/arch/x86/machine/cpu.h b/arch/x86/machine/cpu.h
index ab31e5d8..cf2c112b 100644
--- a/arch/x86/machine/cpu.h
+++ b/arch/x86/machine/cpu.h
@@ -615,6 +615,13 @@ void cpu_mp_probe(void);
/*
* Start application processors.
+ *
+ * The x86 architecture uses per-CPU page tables, which are created as a
+ * side effect of this function. In order to synchronize their page tables,
+ * processors must be able to communicate very soon after calling this
+ * function. They communicate through interrupts and threading facilities.
+ * On return, physical mappings must not be altered until inter-processor
+ * communication is available.
*/
void cpu_mp_setup(void);
diff --git a/kern/kernel.c b/kern/kernel.c
index ea11bf2b..62d75b52 100644
--- a/kern/kernel.c
+++ b/kern/kernel.c
@@ -39,8 +39,17 @@ kernel_main(void)
llsync_setup();
/*
- * Enabling application processors must be the last step before starting
- * the scheduler.
+ * Enabling application processors is done late in the boot process for
+ * two reasons :
+ * - It's much simpler to bootstrap with interrupts disabled on all
+ * processors, enabling them only when necessary on the BSP.
+ * - Depending on the architecture, the pmap module could create per
+ * processor page tables. Once done, keeping the kernel page tables
+ * synchronized requires interrupts (and potentially scheduling)
+ * enabled on all processors.
+ *
+ * Anything done after this call and before running the scheduler must
+ * not alter physical mappings.
*/
cpu_mp_setup();