summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-11-19 23:41:15 -0500
committerIan Moffett <ian@osmora.org>2025-11-19 23:41:15 -0500
commit0fa389d2fdb6ae7779f1a85c3fc4d37770ce771f (patch)
treec0d21f463c3eafca74f869ae25671602de772533 /sys
parentc478ba925b29990df2426ee06c2e629c0a2d7246 (diff)
kern/amd64: mp: Tear down lower half per AP
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/cpu/mp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/arch/amd64/cpu/mp.c b/sys/arch/amd64/cpu/mp.c
index ea36829..ddd4d8a 100644
--- a/sys/arch/amd64/cpu/mp.c
+++ b/sys/arch/amd64/cpu/mp.c
@@ -42,6 +42,7 @@
#include <md/cpu.h>
#include <md/gdt.h>
#include <mu/cpu.h>
+#include <mu/mmu.h>
#include <os/process.h>
#include <os/sched.h>
#include <vm/vm.h>
@@ -117,6 +118,16 @@ static volatile uint32_t aps_up = 0;
__section(".trampoline") static char ap_code[4096];
static void
+clean_addrsp(void)
+{
+ struct mmu_vas old, new;
+
+ mu_pmap_readvas(&old);
+ mu_pmap_forkvas(&new);
+ mu_pmap_writevas(&new);
+}
+
+static void
cpu_idle(struct mcb *mcb)
{
lapic_oneshot_usec(mcb, SCHED_QUANTUM);
@@ -271,6 +282,7 @@ cpu_lm_entry(void)
);
cpu_mtrr_fetch();
+ clean_addrsp();
/*
* Now we load all the MTRRs given to us by the BSP