relocate pte_lock initialisation to the earliest points after %fs is first usable in the XEN bootpath

This commit is contained in:
cherry 2012-01-12 19:49:37 +00:00
parent 58bd5d7cb5
commit 2504a10c74
3 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.173 2011/12/12 19:03:08 mrg Exp $ */
/* $NetBSD: machdep.c,v 1.174 2012/01/12 19:49:37 cherry Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@ -111,7 +111,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.173 2011/12/12 19:03:08 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.174 2012/01/12 19:49:37 cherry Exp $");
/* #define XENDEBUG_LOW */
@ -1640,6 +1640,7 @@ init_x86_64(paddr_t first_avail)
use_pae = 1; /* PAE always enabled in long mode */
#ifdef XEN
mutex_init(&pte_lock, MUTEX_DEFAULT, IPL_VM);
pcb->pcb_cr3 = xen_start_info.pt_base - KERNBASE;
__PRINTK(("pcb_cr3 0x%lx\n", xen_start_info.pt_base - KERNBASE));
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.716 2012/01/12 19:37:45 cherry Exp $ */
/* $NetBSD: machdep.c,v 1.717 2012/01/12 19:49:37 cherry Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.716 2012/01/12 19:37:45 cherry Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.717 2012/01/12 19:49:37 cherry Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@ -1408,6 +1408,8 @@ init386(paddr_t first_avail)
* before the above variables are set.
*/
initgdt(NULL);
mutex_init(&pte_lock, MUTEX_DEFAULT, IPL_VM);
#endif /* XEN */
#if NISA > 0 || NPCI > 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: x86_xpmap.c,v 1.37 2012/01/09 13:04:13 cherry Exp $ */
/* $NetBSD: x86_xpmap.c,v 1.38 2012/01/12 19:49:37 cherry Exp $ */
/*
* Copyright (c) 2006 Mathieu Ropert <mro@adviseo.fr>
@ -69,7 +69,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.37 2012/01/09 13:04:13 cherry Exp $");
__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.38 2012/01/12 19:49:37 cherry Exp $");
#include "opt_xen.h"
#include "opt_ddb.h"
@ -77,7 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.37 2012/01/09 13:04:13 cherry Exp $"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/simplelock.h>
#include <sys/mutex.h>
#include <uvm/uvm.h>
@ -653,8 +653,6 @@ bootstrap_again:
/* Finally, flush TLB. */
xpq_queue_tlb_flush();
mutex_init(&pte_lock, MUTEX_DEFAULT, IPL_VM);
return (init_tables + ((count + l2_4_count) * PAGE_SIZE));
}