Module Name: src Committed By: cherry Date: Thu Jan 12 19:49:37 UTC 2012
Modified Files: src/sys/arch/amd64/amd64: machdep.c src/sys/arch/i386/i386: machdep.c src/sys/arch/xen/x86: x86_xpmap.c Log Message: relocate pte_lock initialisation to the earliest points after %fs is first usable in the XEN bootpath To generate a diff of this commit: cvs rdiff -u -r1.173 -r1.174 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.716 -r1.717 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.37 -r1.38 src/sys/arch/xen/x86/x86_xpmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.173 src/sys/arch/amd64/amd64/machdep.c:1.174 --- src/sys/arch/amd64/amd64/machdep.c:1.173 Mon Dec 12 19:03:08 2011 +++ src/sys/arch/amd64/amd64/machdep.c Thu Jan 12 19:49:37 2012 @@ -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 Index: src/sys/arch/i386/i386/machdep.c diff -u src/sys/arch/i386/i386/machdep.c:1.716 src/sys/arch/i386/i386/machdep.c:1.717 --- src/sys/arch/i386/i386/machdep.c:1.716 Thu Jan 12 19:37:45 2012 +++ src/sys/arch/i386/i386/machdep.c Thu Jan 12 19:49:37 2012 @@ -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 Index: src/sys/arch/xen/x86/x86_xpmap.c diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.37 src/sys/arch/xen/x86/x86_xpmap.c:1.38 --- src/sys/arch/xen/x86/x86_xpmap.c:1.37 Mon Jan 9 13:04:13 2012 +++ src/sys/arch/xen/x86/x86_xpmap.c Thu Jan 12 19:49:37 2012 @@ -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 <m...@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, #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)); }