Move PMAP_KMPAGE to be used in pmap_kenter_pa flags argument.
'Looks good to me' gimpy@
This commit is contained in:
parent
4f27706e70
commit
dfa8eb2f81
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: pmap.c,v 1.212 2010/02/15 07:55:33 skrll Exp $ */
|
/* $NetBSD: pmap.c,v 1.213 2010/05/14 05:02:05 cegger Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2003 Wasabi Systems, Inc.
|
* Copyright 2003 Wasabi Systems, Inc.
|
||||||
@ -211,7 +211,7 @@
|
|||||||
#include <machine/param.h>
|
#include <machine/param.h>
|
||||||
#include <arm/arm32/katelib.h>
|
#include <arm/arm32/katelib.h>
|
||||||
|
|
||||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.212 2010/02/15 07:55:33 skrll Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.213 2010/05/14 05:02:05 cegger Exp $");
|
||||||
|
|
||||||
#ifdef PMAP_DEBUG
|
#ifdef PMAP_DEBUG
|
||||||
|
|
||||||
@ -3318,7 +3318,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags)
|
|||||||
struct l2_bucket *l2b;
|
struct l2_bucket *l2b;
|
||||||
pt_entry_t *ptep, opte;
|
pt_entry_t *ptep, opte;
|
||||||
#ifdef PMAP_CACHE_VIVT
|
#ifdef PMAP_CACHE_VIVT
|
||||||
struct vm_page *pg = (prot & PMAP_KMPAGE) ? PHYS_TO_VM_PAGE(pa) : NULL;
|
struct vm_page *pg = (flags & PMAP_KMPAGE) ? PHYS_TO_VM_PAGE(pa) : NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef PMAP_CACHE_VIPT
|
#ifdef PMAP_CACHE_VIPT
|
||||||
struct vm_page *pg = PHYS_TO_VM_PAGE(pa);
|
struct vm_page *pg = PHYS_TO_VM_PAGE(pa);
|
||||||
@ -3346,7 +3346,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags)
|
|||||||
if (opg) {
|
if (opg) {
|
||||||
KASSERT(opg != pg);
|
KASSERT(opg != pg);
|
||||||
KASSERT((opg->mdpage.pvh_attrs & PVF_KMPAGE) == 0);
|
KASSERT((opg->mdpage.pvh_attrs & PVF_KMPAGE) == 0);
|
||||||
KASSERT((prot & PMAP_KMPAGE) == 0);
|
KASSERT((flags & PMAP_KMPAGE) == 0);
|
||||||
simple_lock(&opg->mdpage.pvh_slock);
|
simple_lock(&opg->mdpage.pvh_slock);
|
||||||
pv = pmap_kremove_pg(opg, va);
|
pv = pmap_kremove_pg(opg, va);
|
||||||
simple_unlock(&opg->mdpage.pvh_slock);
|
simple_unlock(&opg->mdpage.pvh_slock);
|
||||||
@ -3366,7 +3366,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags)
|
|||||||
PTE_SYNC(ptep);
|
PTE_SYNC(ptep);
|
||||||
|
|
||||||
if (pg) {
|
if (pg) {
|
||||||
if (prot & PMAP_KMPAGE) {
|
if (flags & PMAP_KMPAGE) {
|
||||||
simple_lock(&pg->mdpage.pvh_slock);
|
simple_lock(&pg->mdpage.pvh_slock);
|
||||||
KASSERT(pg->mdpage.urw_mappings == 0);
|
KASSERT(pg->mdpage.urw_mappings == 0);
|
||||||
KASSERT(pg->mdpage.uro_mappings == 0);
|
KASSERT(pg->mdpage.uro_mappings == 0);
|
||||||
@ -4769,7 +4769,7 @@ pmap_grow_map(vaddr_t va, pt_entry_t cache_mode, paddr_t *pap)
|
|||||||
*/
|
*/
|
||||||
KASSERT(SLIST_EMPTY(&pg->mdpage.pvh_list));
|
KASSERT(SLIST_EMPTY(&pg->mdpage.pvh_list));
|
||||||
pmap_kenter_pa(va, pa,
|
pmap_kenter_pa(va, pa,
|
||||||
VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
|
VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5457,7 +5457,7 @@ pmap_postinit(void)
|
|||||||
paddr_t pa = VM_PAGE_TO_PHYS(m);
|
paddr_t pa = VM_PAGE_TO_PHYS(m);
|
||||||
|
|
||||||
pmap_kenter_pa(va, pa,
|
pmap_kenter_pa(va, pa,
|
||||||
VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
|
VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure the L1 descriptor table is mapped
|
* Make sure the L1 descriptor table is mapped
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: kern_malloc_debug.c,v 1.22 2009/11/07 07:27:49 cegger Exp $ */
|
/* $NetBSD: kern_malloc_debug.c,v 1.23 2010/05/14 05:02:06 cegger Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2000 Artur Grabowski <art@openbsd.org>
|
* Copyright (c) 1999, 2000 Artur Grabowski <art@openbsd.org>
|
||||||
@ -56,7 +56,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: kern_malloc_debug.c,v 1.22 2009/11/07 07:27:49 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: kern_malloc_debug.c,v 1.23 2010/05/14 05:02:06 cegger Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
@ -156,7 +156,7 @@ debug_malloc(unsigned long size, struct malloc_type *type, int flags,
|
|||||||
splx(s);
|
splx(s);
|
||||||
|
|
||||||
pmap_kenter_pa(md->md_va, md->md_pa,
|
pmap_kenter_pa(md->md_va, md->md_pa,
|
||||||
VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
|
VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
|
|
||||||
md->md_size = size;
|
md->md_size = size;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: uvm_km.c,v 1.105 2010/02/08 19:02:33 joerg Exp $ */
|
/* $NetBSD: uvm_km.c,v 1.106 2010/05/14 05:02:06 cegger Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||||
@ -127,7 +127,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: uvm_km.c,v 1.105 2010/02/08 19:02:33 joerg Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: uvm_km.c,v 1.106 2010/05/14 05:02:06 cegger Exp $");
|
||||||
|
|
||||||
#include "opt_uvmhist.h"
|
#include "opt_uvmhist.h"
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ uvm_km_alloc(struct vm_map *map, vsize_t size, vsize_t align, uvm_flag_t flags)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
pmap_kenter_pa(loopva, VM_PAGE_TO_PHYS(pg),
|
pmap_kenter_pa(loopva, VM_PAGE_TO_PHYS(pg),
|
||||||
prot | PMAP_KMPAGE, 0);
|
prot, PMAP_KMPAGE);
|
||||||
loopva += PAGE_SIZE;
|
loopva += PAGE_SIZE;
|
||||||
offset += PAGE_SIZE;
|
offset += PAGE_SIZE;
|
||||||
loopsize -= PAGE_SIZE;
|
loopsize -= PAGE_SIZE;
|
||||||
@ -711,7 +711,7 @@ again:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
|
pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
|
||||||
VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
|
VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
|
|
||||||
return va;
|
return va;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: uvm_kmguard.c,v 1.2 2009/11/07 07:27:49 cegger Exp $ */
|
/* $NetBSD: uvm_kmguard.c,v 1.3 2010/05/14 05:02:06 cegger Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||||
@ -38,7 +38,7 @@
|
|||||||
* - Use-after-free
|
* - Use-after-free
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: uvm_kmguard.c,v 1.2 2009/11/07 07:27:49 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: uvm_kmguard.c,v 1.3 2010/05/14 05:02:06 cegger Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/malloc.h>
|
#include <sys/malloc.h>
|
||||||
@ -150,7 +150,7 @@ uvm_kmguard_alloc(struct uvm_kmguard *kg, size_t len, bool waitok)
|
|||||||
pg->flags &= ~PG_BUSY; /* new page */
|
pg->flags &= ~PG_BUSY; /* new page */
|
||||||
UVM_PAGE_OWN(pg, NULL);
|
UVM_PAGE_OWN(pg, NULL);
|
||||||
pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
|
pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
|
||||||
VM_PROT_READ | VM_PROT_WRITE | PMAP_KMPAGE, 0);
|
VM_PROT_READ | VM_PROT_WRITE, PMAP_KMPAGE);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user