Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch relocate pte_lock initialisation to the earliest po...



details:   https://anonhg.NetBSD.org/src/rev/41e3e1d220ca
branches:  trunk
changeset: 772696:41e3e1d220ca
user:      cherry <cherry%NetBSD.org@localhost>
date:      Thu Jan 12 19:49:37 2012 +0000

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

diffstat:

 sys/arch/amd64/amd64/machdep.c |  5 +++--
 sys/arch/i386/i386/machdep.c   |  6 ++++--
 sys/arch/xen/x86/x86_xpmap.c   |  8 +++-----
 3 files changed, 10 insertions(+), 9 deletions(-)

diffs (89 lines):

diff -r d9d8c13325c8 -r 41e3e1d220ca sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Thu Jan 12 19:37:45 2012 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Thu Jan 12 19:49:37 2012 +0000
@@ -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 @@
        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
diff -r d9d8c13325c8 -r 41e3e1d220ca sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Thu Jan 12 19:37:45 2012 +0000
+++ b/sys/arch/i386/i386/machdep.c      Thu Jan 12 19:49:37 2012 +0000
@@ -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 @@
         * before the above variables are set.
         */
        initgdt(NULL);
+
+       mutex_init(&pte_lock, MUTEX_DEFAULT, IPL_VM);
 #endif /* XEN */
 
 #if NISA > 0 || NPCI > 0
diff -r d9d8c13325c8 -r 41e3e1d220ca sys/arch/xen/x86/x86_xpmap.c
--- a/sys/arch/xen/x86/x86_xpmap.c      Thu Jan 12 19:37:45 2012 +0000
+++ b/sys/arch/xen/x86/x86_xpmap.c      Thu Jan 12 19:49:37 2012 +0000
@@ -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@localhost>
@@ -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 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/simplelock.h>
+#include <sys/mutex.h>
 
 #include <uvm/uvm.h>
 
@@ -653,8 +653,6 @@
        /* Finally, flush TLB. */
        xpq_queue_tlb_flush();
 
-       mutex_init(&pte_lock, MUTEX_DEFAULT, IPL_VM);
-       
        return (init_tables + ((count + l2_4_count) * PAGE_SIZE));
 }
 



Home | Main Index | Thread Index | Old Index