summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2007-04-14 14:52:37 +0000
committermiod <miod@openbsd.org>2007-04-14 14:52:37 +0000
commitad7f02a26f514432dad1468ea2a377e4e80c1ff7 (patch)
tree8db8c28951f8a2f8f4a115b5bd459e840b8533fc
parentClean up. (diff)
downloadwireguard-openbsd-ad7f02a26f514432dad1468ea2a377e4e80c1ff7.tar.xz
wireguard-openbsd-ad7f02a26f514432dad1468ea2a377e4e80c1ff7.zip
Correctly handle pv_flags for pages used to store ptes, so that they
are in a correct state when we uvm_pagefree() them.
-rw-r--r--sys/arch/mips64/include/pmap.h4
-rw-r--r--sys/arch/mips64/mips64/pmap.c11
2 files changed, 5 insertions, 10 deletions
diff --git a/sys/arch/mips64/include/pmap.h b/sys/arch/mips64/include/pmap.h
index 9a2fc3f4e78..1d133c58b85 100644
--- a/sys/arch/mips64/include/pmap.h
+++ b/sys/arch/mips64/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.10 2006/06/20 06:26:57 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.11 2007/04/14 14:52:37 miod Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@@ -92,7 +92,7 @@ typedef struct pmap {
#define PV_CACHED 0x0002 /* Page has been cached */
#define PV_ATTR_MOD 0x0004
#define PV_ATTR_REF 0x0008
-#define PV_PRESERVE (PV_UNCACHED|PV_CACHED|PV_ATTR_MOD|PV_ATTR_REF)
+#define PV_PRESERVE (PV_ATTR_MOD | PV_ATTR_REF)
extern struct pmap kernel_pmap_store;
diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c
index cb805c80d46..d0353dd837c 100644
--- a/sys/arch/mips64/mips64/pmap.c
+++ b/sys/arch/mips64/mips64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.20 2006/06/06 17:34:21 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.21 2007/04/14 14:52:39 miod Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -1167,12 +1167,6 @@ pmap_page_alloc(vaddr_t *ret)
pv = pg_to_pvh(pg);
va = PHYS_TO_KSEG0(VM_PAGE_TO_PHYS(pg));
- if ((pv->pv_flags & PV_CACHED) &&
- ((pv->pv_va ^ va) & CpuCacheAliasMask) != 0) {
- Mips_SyncDCachePage(pv->pv_va);
- }
- pv->pv_va = va;
- pv->pv_flags = PV_CACHED;
*ret = va;
return 0;
@@ -1340,11 +1334,12 @@ pmap_remove_pv(pmap_t pmap, vaddr_t va, paddr_t pa)
if (pmap == pv->pv_pmap && va == pv->pv_va) {
npv = pv->pv_next;
if (npv) {
- npv->pv_flags |= pv->pv_flags & PV_PRESERVE;
+ npv->pv_flags = pv->pv_flags;
*pv = *npv;
pmap_pv_free(npv);
} else {
pv->pv_pmap = NULL;
+ pv->pv_flags &= PV_PRESERVE;
Mips_SyncDCachePage(pv->pv_va);
}
stat_count(remove_stats.pvfirst);