From 0fa389d2fdb6ae7779f1a85c3fc4d37770ce771f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 19 Nov 2025 23:41:15 -0500 Subject: kern/amd64: mp: Tear down lower half per AP Signed-off-by: Ian Moffett --- sys/arch/amd64/cpu/mp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 #include #include +#include #include #include #include @@ -116,6 +117,16 @@ static uint32_t ap_count = 0; 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) { @@ -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 -- cgit v1.2.3