summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-05-15 08:30:29 +0000
committerkib <kib@FreeBSD.org>2015-05-15 08:30:29 +0000
commitc3a04ab331a24533e7a7470d0f8a347a23ea974d (patch)
tree3a0f03e2ecfbd97c3e46af633b49d098932a0a81 /sys/kern/init_main.c
parent7531e6e70ecfbbf822fff6ef7e6165cac9d7e5fd (diff)
downloadFreeBSD-src-c3a04ab331a24533e7a7470d0f8a347a23ea974d.zip
FreeBSD-src-c3a04ab331a24533e7a7470d0f8a347a23ea974d.tar.gz
On amd64, make proc0 pmap initialization slightly more correct. In
particular, switch to the proc0 pmap to have expected %cr3 and PCID for the thread0 during initialization, and the up to date pm_active mask. pmap_pinit0() should be done after proc0->p_vmspace is assigned so that the amd64 pmap_activate() find the correct curproc pmap. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c2
1 files changed, 1 insertions, 1 deletions
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