summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/pmap.c4
-rw-r--r--sys/kern/init_main.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 2829d07..118bb34 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -2129,7 +2129,6 @@ pmap_pinit0(pmap_t pmap)
pmap->pm_cr3 = KPML4phys;
pmap->pm_root.rt_root = 0;
CPU_ZERO(&pmap->pm_active);
- PCPU_SET(curpmap, pmap);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
pmap->pm_flags = pmap_flags;
@@ -2137,6 +2136,9 @@ pmap_pinit0(pmap_t pmap)
pmap->pm_pcids[i].pm_pcid = PMAP_PCID_NONE;
pmap->pm_pcids[i].pm_gen = 0;
}
+ PCPU_SET(curpmap, kernel_pmap);
+ pmap_activate(curthread);
+ CPU_FILL(&kernel_pmap->pm_active);
}
/*
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index b77b788..3f51cb5 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -561,9 +561,9 @@ proc0_init(void *dummy __unused)
p->p_stats = pstats_alloc();
/* Allocate a prototype map so we have something to fork. */
- pmap_pinit0(vmspace_pmap(&vmspace0));
p->p_vmspace = &vmspace0;
vmspace0.vm_refcnt = 1;
+ pmap_pinit0(vmspace_pmap(&vmspace0));
/*
* proc0 is not expected to enter usermode, so there is no special
OpenPOWER on IntegriCloud