From c3a04ab331a24533e7a7470d0f8a347a23ea974d Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 15 May 2015 08:30:29 +0000 Subject: 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 --- sys/kern/init_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/kern/init_main.c') 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 -- cgit v1.1