CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Apr 27 08:11:19 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: pmap.c Log Message: Add a reference. To generate a diff of this commit: cvs rdiff -u -r1.43.8.50 -r1.43.8.51 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.43.8.50 src/sys/arch/hppa/hppa/pmap.c:1.43.8.51 --- src/sys/arch/hppa/hppa/pmap.c:1.43.8.50 Sat Apr 25 15:28:16 2009 +++ src/sys/arch/hppa/hppa/pmap.c Mon Apr 27 08:11:19 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43.8.50 2009/04/25 15:28:16 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.43.8.51 2009/04/27 08:11:19 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -60,11 +60,12 @@ * References: * 1. PA7100LC ERS, Hewlett-Packard, March 30 1999, Public version 1.0 * 2. PA7300LC ERS, Hewlett-Packard, March 18 1996, Version 1.0 - * + * 3. PA-RISC 1.1 Architecture and Instruction Set Reference Manual, + *Hewlett-Packard, February 1994, Third Edition */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.50 2009/04/25 15:28:16 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.51 2009/04/27 08:11:19 skrll Exp $); #include sys/param.h #include sys/systm.h
CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Apr 27 08:21:51 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: pmap.c Log Message: Another comment update. To generate a diff of this commit: cvs rdiff -u -r1.43.8.52 -r1.43.8.53 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.43.8.52 src/sys/arch/hppa/hppa/pmap.c:1.43.8.53 --- src/sys/arch/hppa/hppa/pmap.c:1.43.8.52 Mon Apr 27 08:19:59 2009 +++ src/sys/arch/hppa/hppa/pmap.c Mon Apr 27 08:21:51 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43.8.52 2009/04/27 08:19:59 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.43.8.53 2009/04/27 08:21:51 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.52 2009/04/27 08:19:59 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.53 2009/04/27 08:21:51 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -560,7 +560,7 @@ if (!nonequiv) { /* * Inherit uncacheable attribute if set as it means we already - * have non-equiv aliases + * have non-equiv aliases. */ if (ptep (attrs PVF_UNCACHEABLE) != 0) *ptep |= PTE_PROT(TLB_UNCACHEABLE);
CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Apr 27 08:25:30 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: pmap.c Log Message: Oops, typo in previous. To generate a diff of this commit: cvs rdiff -u -r1.43.8.53 -r1.43.8.54 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.43.8.53 src/sys/arch/hppa/hppa/pmap.c:1.43.8.54 --- src/sys/arch/hppa/hppa/pmap.c:1.43.8.53 Mon Apr 27 08:21:51 2009 +++ src/sys/arch/hppa/hppa/pmap.c Mon Apr 27 08:25:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43.8.53 2009/04/27 08:21:51 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.43.8.54 2009/04/27 08:25:30 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.53 2009/04/27 08:21:51 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.54 2009/04/27 08:25:30 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -1811,7 +1811,7 @@ /* * If we're being told to unmap page zero, we can't call printf() at - * all as printf required page zero to be mapped. + * all as printf requires page zero to be mapped. */ if (va == 0) pmapdebug = 0;
CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Apr 25 07:56:03 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: trap.S Log Message: Turn off TLB_STATS_{PRE,AFT} To generate a diff of this commit: cvs rdiff -u -r1.26.2.10 -r1.26.2.11 src/sys/arch/hppa/hppa/trap.S 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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.26.2.10 src/sys/arch/hppa/hppa/trap.S:1.26.2.11 --- src/sys/arch/hppa/hppa/trap.S:1.26.2.10 Sat Apr 25 07:45:37 2009 +++ src/sys/arch/hppa/hppa/trap.S Sat Apr 25 07:56:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.26.2.10 2009/04/25 07:45:37 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.26.2.11 2009/04/25 07:56:03 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -1244,7 +1244,7 @@ dep sp, 31, 16, t /* put in the space id */ ! \ depi 1, 0, 1, t /* and set the valid bit */ -#if 1 +#if 0 .section .bss .export dtlb_c, data .export tlbd_c, data
CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Apr 25 13:54:07 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: pmap.c Log Message: Put KASSERTs after DPRINTFs. To generate a diff of this commit: cvs rdiff -u -r1.43.8.46 -r1.43.8.47 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.43.8.46 src/sys/arch/hppa/hppa/pmap.c:1.43.8.47 --- src/sys/arch/hppa/hppa/pmap.c:1.43.8.46 Tue Apr 21 13:48:21 2009 +++ src/sys/arch/hppa/hppa/pmap.c Sat Apr 25 13:54:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43.8.46 2009/04/21 13:48:21 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.43.8.47 2009/04/25 13:54:07 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.46 2009/04/21 13:48:21 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.47 2009/04/25 13:54:07 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -511,14 +511,14 @@ struct pv_entry *tpve; u_int attrs; - /* we should only be looking if we're not PVF_NC */ - KASSERT((pg-mdpage.pvh_attrs PVF_NC) == 0); - KASSERT(mutex_owned(pg-mdpage.pvh_lock)); - DPRINTF(PDB_FOLLOW|PDB_ALIAS, (%s(%p, %p, 0x%x, %p)\n, __func__, pg, pve, (int)va, ptep)); + /* we should only be looking if we're not PVF_NC */ + KASSERT((pg-mdpage.pvh_attrs PVF_NC) == 0); + KASSERT(mutex_owned(pg-mdpage.pvh_lock)); + if (ptep) { attrs = pmap_pvh_attrs(*ptep); @@ -632,11 +632,11 @@ pmap_pv_enter(struct vm_page *pg, struct pv_entry *pve, pmap_t pm, vaddr_t va, struct vm_page *pdep, pt_entry_t *ptep) { - KASSERT(mutex_owned(pg-mdpage.pvh_lock)); - DPRINTF(PDB_FOLLOW|PDB_PV, (%s(%p, %p, %p, 0x%x, %p)\n, __func__, pg, pve, pm, (int)va, pdep)); + KASSERT(mutex_owned(pg-mdpage.pvh_lock)); + pve-pv_pmap = pm; pve-pv_va = va; pve-pv_ptp = pdep;
CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Apr 25 15:26:28 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: pmap.c Log Message: Add a KASSERT to pmap_activate To generate a diff of this commit: cvs rdiff -u -r1.43.8.48 -r1.43.8.49 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.43.8.48 src/sys/arch/hppa/hppa/pmap.c:1.43.8.49 --- src/sys/arch/hppa/hppa/pmap.c:1.43.8.48 Sat Apr 25 14:45:06 2009 +++ src/sys/arch/hppa/hppa/pmap.c Sat Apr 25 15:26:28 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43.8.48 2009/04/25 14:45:06 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.43.8.49 2009/04/25 15:26:28 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.48 2009/04/25 14:45:06 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.49 2009/04/25 15:26:28 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -1660,10 +1660,10 @@ pa_space_t space = pmap-pm_space; struct pcb *pcb = l-l_addr-u_pcb; + KASSERT(pcb-pcb_uva == (vaddr_t)l-l_addr); + /* space is cached for the copy{in,out}'s pleasure */ pcb-pcb_space = space; - /* XXXNH */ -// pcb-pcb_uva = (vaddr_t)p-p_addr; fdcache(HPPA_SID_KERNEL, (vaddr_t)pcb, PAGE_SIZE); if (p == curproc)
CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Apr 10 09:18:36 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: pmap.c Log Message: Remove PMAPDEBUG define that crept in. To generate a diff of this commit: cvs rdiff -u -r1.43.8.44 -r1.43.8.45 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.43.8.44 src/sys/arch/hppa/hppa/pmap.c:1.43.8.45 --- src/sys/arch/hppa/hppa/pmap.c:1.43.8.44 Fri Apr 3 14:07:26 2009 +++ src/sys/arch/hppa/hppa/pmap.c Fri Apr 10 09:18:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43.8.44 2009/04/03 14:07:26 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.43.8.45 2009/04/10 09:18:36 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.44 2009/04/03 14:07:26 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.45 2009/04/10 09:18:36 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -89,8 +89,6 @@ #include ddb/db_output.h #endif -#define PMAPDEBUG - #ifdef PMAPDEBUG #define static /**/
CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Apr 3 14:07:26 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: pmap.c Log Message: Track referrenced and modified attributes of pages correct, i.e. as described in pmap(9). Inherit uncacheable attribute if the page already has non-equiv aliases. Tidy-up a comment while I'm here. To generate a diff of this commit: cvs rdiff -u -r1.43.8.43 -r1.43.8.44 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.43.8.43 src/sys/arch/hppa/hppa/pmap.c:1.43.8.44 --- src/sys/arch/hppa/hppa/pmap.c:1.43.8.43 Sat Mar 28 11:00:47 2009 +++ src/sys/arch/hppa/hppa/pmap.c Fri Apr 3 14:07:26 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43.8.43 2009/03/28 11:00:47 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.43.8.44 2009/04/03 14:07:26 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.43 2009/03/28 11:00:47 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.44 2009/04/03 14:07:26 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -511,6 +511,7 @@ { bool nonequiv = false; struct pv_entry *tpve; + u_int attrs; /* we should only be looking if we're not PVF_NC */ KASSERT((pg-mdpage.pvh_attrs PVF_NC) == 0); @@ -521,15 +522,13 @@ ptep)); if (ptep) { - /* Reset page flags with flags for new mapping */ - pg-mdpage.pvh_attrs = pmap_pvh_attrs(*ptep); + attrs = pmap_pvh_attrs(*ptep); DPRINTF(PDB_FOLLOW|PDB_ALIAS, (%s: va 0x%08x attrs 0x%08x (new)\n, __func__, (int)va, - pmap_pvh_attrs(*ptep))); + attrs)); } else { - /* Reset page flags. */ - pg-mdpage.pvh_attrs = 0; + attrs = 0; DPRINTF(PDB_FOLLOW|PDB_ALIAS, (%s: va 0x%08x (removed)\n, __func__, (int)va)); @@ -544,7 +543,7 @@ /* XXX LOCK */ pte = pmap_vp_find(tpve-pv_pmap, tpve-pv_va); - pg-mdpage.pvh_attrs |= pmap_pvh_attrs(pte); + attrs |= pmap_pvh_attrs(pte); if (((va ^ tpve-pv_va) HPPA_PGAOFF) != 0) nonequiv = true; @@ -555,21 +554,29 @@ pmap_pvh_attrs(pte), nonequiv ? alias : )); } - /* No more to be done. */ - if (!nonequiv) + if (!nonequiv) { + /* + * Inherit uncacheable attribute if set as it means we already + * have non-equiv aliases + */ + if (ptep (attrs PVF_UNCACHEABLE) != 0) + *ptep |= PTE_PROT(TLB_UNCACHEABLE); + + /* No more to be done. */ return; + } if (ptep) { - if ((pg-mdpage.pvh_attrs (PVF_WRITE|PVF_MOD)) != 0) { + if ((attrs (PVF_WRITE|PVF_MOD)) != 0) { /* - * We have non-equiv aliases and the new (some) - * mapping(s are) is writable (or modified). We must - * mark the all mappings as uncacheable - * (if they're not already marked as such). + * We have non-equiv aliases and the new/some + * mapping(s) is/are is writable (or modified). We must + * mark the all mappings as uncacheable (if they're not + * already marked as such). */ pg-mdpage.pvh_aliases++; - if ((pg-mdpage.pvh_attrs PVF_UNCACHEABLE) == 0) + if ((attrs PVF_UNCACHEABLE) == 0) __changebit(pg, PVF_UNCACHEABLE, 0); *ptep |= PTE_PROT(TLB_UNCACHEABLE); @@ -578,7 +585,7 @@ (%s: page marked uncacheable\n, __func__)); } } else { - if ((pg-mdpage.pvh_attrs PVF_UNCACHEABLE) != 0) { + if ((attrs PVF_UNCACHEABLE) != 0) { /* * We've removed a non-equiv aliases. We can check * marked uncacheable. We can now mark it cacheable. @@ -1385,7 +1392,10 @@ pmap_check_alias(pg, pg-mdpage.pvh_list, sva, NULL); +pg-mdpage.pvh_attrs |= pmap_pvh_attrs(pte); + mutex_exit(pg-mdpage.pvh_lock); + if (pve != NULL) pmap_pv_free(pve); } @@ -1549,8 +1559,13 @@ int res; KASSERT(mutex_owned(pg-mdpage.pvh_lock)); + KASSERT(((set | clear) + ~(PVF_MOD|PVF_REF|PVF_UNCACHEABLE|PVF_WRITE)) == 0); + + /* preserve other bits */ + res = pg-mdpage.pvh_attrs (set | clear); + pg-mdpage.pvh_attrs ^= res; - res = pg-mdpage.pvh_attrs = 0; for (pve = pg-mdpage.pvh_list; pve; pve = pve-pv_next) { pmap_t pmap = pve-pv_pmap; vaddr_t va = pve-pv_va; @@ -1845,13 +1860,15 @@ if (pmap_initialized (pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte { mutex_enter(pg-mdpage.pvh_lock); - pg-mdpage.pvh_attrs = ~PVF_KENTER; - /* just in case we have enter/kenter mismatch */ pve = pmap_pv_remove(pg, pmap, va); - if ((pte PVF_NC) != 0) + + if ((pg-mdpage.pvh_attrs PVF_NC) == 0) { pmap_check_alias(pg, pg-mdpage.pvh_list, va, NULL); + } + + pg-mdpage.pvh_attrs = ~PVF_NC; mutex_exit(pg-mdpage.pvh_lock); if (pve != NULL)
CVS commit: [nick-hppapmap] src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Mar 27 08:23:17 UTC 2009 Modified Files: src/sys/arch/hppa/hppa [nick-hppapmap]: pmap.c Log Message: Simplify locking while UP only. To generate a diff of this commit: cvs rdiff -u -r1.43.8.40 -r1.43.8.41 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.43.8.40 src/sys/arch/hppa/hppa/pmap.c:1.43.8.41 --- src/sys/arch/hppa/hppa/pmap.c:1.43.8.40 Fri Mar 27 08:14:04 2009 +++ src/sys/arch/hppa/hppa/pmap.c Fri Mar 27 08:23:17 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43.8.40 2009/03/27 08:14:04 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.43.8.41 2009/03/27 08:23:17 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.40 2009/03/27 08:14:04 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.43.8.41 2009/03/27 08:23:17 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -1555,7 +1555,6 @@ volatile pt_entry_t *pde; pt_entry_t opte, pte; - PMAP_LOCK(pmap); if ((pde = pmap_pde_get(pmap-pm_pdir, va))) { opte = pte = pmap_pte_get(pde, va); #ifdef PMAPDEBUG @@ -1576,7 +1575,6 @@ pmap_pte_set(pde, va, pte); } } - PMAP_UNLOCK(pmap); } return ((res (clear | set)) != 0); @@ -1595,9 +1593,7 @@ pve = pve-pv_next) { pmap_t pm = pve-pv_pmap; - PMAP_LOCK(pm); pte = pmap_vp_find(pm, pve-pv_va); - PMAP_UNLOCK(pm); pg-mdpage.pvh_attrs |= pmap_pvh_attrs(pte); }