summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-06-27 18:47:47 +0200
committerAlmuHS <almuhs@github.com>2019-06-27 18:47:47 +0200
commite0603719902c282f98dd60ecffdf1dc9c7b1a738 (patch)
tree1f6c385dd52828be027085216a98f6b080b759ff
parent651e65e124c2b124a41c094f78cfe9f9a6b100b5 (diff)
experiment: get rid of temporary direct mapping after start AP
-rw-r--r--i386/i386/mp_desc.c8
-rw-r--r--i386/i386at/model_dep.c2
2 files changed, 10 insertions, 0 deletions
diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index c1dac103..e55b7500 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -529,6 +529,9 @@ start_other_cpus(void)
int cpu;
vm_offset_t stack_start;
int apic_id = lapic->apic_id.r >>24;
+ extern pt_entry_t *kernel_page_dir;
+ extern int nb_direct_value;
+ int i = 0;
printf("found %d cpus\n", ncpu);
printf("The current cpu is: %d\n", cpu_number());
@@ -563,6 +566,11 @@ start_other_cpus(void)
stack_start += STACK_SIZE;
}
}
+
+ /* Get rid of the temporary direct mapping and flush it out of the TLB. */
+ for (i = 0 ; i < nb_direct_value; i++){
+ kernel_page_dir[lin2pdenum_cont(INIT_VM_MIN_KERNEL_ADDRESS) + i] = 0;
+ }
}
#endif /* NCPUS > 1 */
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 49a81054..015f5abe 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -143,6 +143,7 @@ extern void linux_init(void);
unsigned kernel_page_dir_addr = 0;
unsigned pdpbase_addr = 0;
+int nb_direct_value = 0;
/*
* Find devices. The system is alive.
@@ -461,6 +462,7 @@ i386at_init(void)
if ((vm_offset_t)(-delta) < delta)
delta = (vm_offset_t)(-delta);
nb_direct = delta >> PDESHIFT;
+ nb_direct_value = nb_direct;
for (i = 0; i < nb_direct; i++)
kernel_page_dir[lin2pdenum_cont(INIT_VM_MIN_KERNEL_ADDRESS) + i] =
kernel_page_dir[lin2pdenum_cont(LINEAR_MIN_KERNEL_ADDRESS) + i];