Module Name: src Committed By: cherry Date: Fri Jan 6 15:15:28 UTC 2012
Modified Files: src/sys/arch/x86/x86: pmap.c src/sys/arch/xen/x86: cpu.c Log Message: Address those pesky DIAGNOSTIC messages. \n Take a performance hit at fork() for not DTRT. \n Note: Only applicable for kernels built with "options DIAGNOSTIC" \n To generate a diff of this commit: cvs rdiff -u -r1.149 -r1.150 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.75 -r1.76 src/sys/arch/xen/x86/cpu.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/x86/x86/pmap.c diff -u src/sys/arch/x86/x86/pmap.c:1.149 src/sys/arch/x86/x86/pmap.c:1.150 --- src/sys/arch/x86/x86/pmap.c:1.149 Fri Dec 30 17:57:49 2011 +++ src/sys/arch/x86/x86/pmap.c Fri Jan 6 15:15:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.149 2011/12/30 17:57:49 cherry Exp $ */ +/* $NetBSD: pmap.c,v 1.150 2012/01/06 15:15:27 cherry Exp $ */ /*- * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. @@ -171,7 +171,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.149 2011/12/30 17:57:49 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.150 2012/01/06 15:15:27 cherry Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -2120,6 +2120,9 @@ pmap_pdp_ctor(void *arg, void *v, int fl for (i = 0; i < PDP_SIZE; i++, object += PAGE_SIZE) { (void) pmap_extract(pmap_kernel(), object, &pdirpa); /* FIXME: This should use pmap_protect() .. */ +#ifdef DIAGNOSTIC + pmap_kremove(object, PAGE_SIZE); +#endif /* DIAGNOSTIC */ pmap_kenter_pa(object, pdirpa, VM_PROT_READ, 0); pmap_update(pmap_kernel()); /* Index: src/sys/arch/xen/x86/cpu.c diff -u src/sys/arch/xen/x86/cpu.c:1.75 src/sys/arch/xen/x86/cpu.c:1.76 --- src/sys/arch/xen/x86/cpu.c:1.75 Wed Jan 4 10:30:23 2012 +++ src/sys/arch/xen/x86/cpu.c Fri Jan 6 15:15:28 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.75 2012/01/04 10:30:23 cherry Exp $ */ +/* $NetBSD: cpu.c,v 1.76 2012/01/06 15:15:28 cherry Exp $ */ /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ /*- @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.75 2012/01/04 10:30:23 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.76 2012/01/06 15:15:28 cherry Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -1307,6 +1307,10 @@ pmap_cpu_init_late(struct cpu_info *ci) #endif /* __x86_64__ else PAE */ /* Xen wants R/O */ + /* FIXME: This should use pmap_protect() .. */ +#ifdef DIAGNOSTIC + pmap_kremove((vaddr_t)ci->ci_kpm_pdir, PAGE_SIZE); +#endif /* DIAGNOSTIC */ pmap_kenter_pa((vaddr_t)ci->ci_kpm_pdir, ci->ci_kpm_pdirpa, VM_PROT_READ, 0); @@ -1319,6 +1323,10 @@ pmap_cpu_init_late(struct cpu_info *ci) ci->ci_pae_l3_pdir[3] = xpmap_ptom_masked(ci->ci_kpm_pdirpa) | PG_k | PG_V; /* Mark L3 R/O (Xen wants this) */ +#ifdef DIAGNOSTIC + /* FIXME: This should use pmap_protect() .. */ + pmap_kremove((vaddr_t)ci->ci_pae_l3_pdir, PAGE_SIZE); +#endif /* DIAGNOSTIC */ pmap_kenter_pa((vaddr_t)ci->ci_pae_l3_pdir, ci->ci_pae_l3_pdirpa, VM_PROT_READ, 0);