summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm_aobj.c4
-rw-r--r--sys/uvm/uvm_fault.c3
-rw-r--r--sys/uvm/uvm_km.c3
-rw-r--r--sys/uvm/uvm_page.c10
4 files changed, 13 insertions, 7 deletions
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c
index 4f0f11604ea..910197f28fa 100644
--- a/sys/uvm/uvm_aobj.c
+++ b/sys/uvm/uvm_aobj.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_aobj.c,v 1.76 2014/12/23 04:56:47 tedu Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.77 2015/02/06 10:58:35 deraadt Exp $ */
/* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -880,6 +880,7 @@ uao_detach_locked(struct uvm_object *uobj)
}
pmap_page_protect(pg, PROT_NONE);
uao_dropswap(&aobj->u_obj, pg->offset >> PAGE_SHIFT);
+ atomic_clearbits_int(&pg->pg_flags, PQ_AOBJ);
uvm_pagefree(pg);
}
uvm_unlock_pageq();
@@ -991,6 +992,7 @@ uao_flush(struct uvm_object *uobj, voff_t start, voff_t stop, int flags)
pmap_page_protect(pp, PROT_NONE);
uao_dropswap(uobj, pp->offset >> PAGE_SHIFT);
+ atomic_clearbits_int(&pp->pg_flags, PQ_AOBJ);
uvm_lock_pageq();
uvm_pagefree(pp);
uvm_unlock_pageq();
diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c
index ffc5949a65e..1612f7914bb 100644
--- a/sys/uvm/uvm_fault.c
+++ b/sys/uvm/uvm_fault.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_fault.c,v 1.81 2014/12/17 06:58:11 guenther Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.82 2015/02/06 10:58:35 deraadt Exp $ */
/* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */
/*
@@ -1388,6 +1388,7 @@ Case2:
*/
atomic_clearbits_int(&pg->pg_flags, PG_CLEAN);
uao_dropswap(uobj, pg->offset >> PAGE_SHIFT);
+ atomic_clearbits_int(&pg->pg_flags, PQ_AOBJ);
}
} else {
/* activate it */
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c
index 899dbf591a0..9df0471b2e2 100644
--- a/sys/uvm/uvm_km.c
+++ b/sys/uvm/uvm_km.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_km.c,v 1.124 2015/01/23 17:09:23 kettenis Exp $ */
+/* $OpenBSD: uvm_km.c,v 1.125 2015/02/06 10:58:35 deraadt Exp $ */
/* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */
/*
@@ -264,6 +264,7 @@ uvm_km_pgremove(struct uvm_object *uobj, vaddr_t start, vaddr_t end)
slot = uao_dropswap(uobj, curoff >> PAGE_SHIFT);
if (pp != NULL) {
+ atomic_clearbits_int(&pp->pg_flags, PQ_AOBJ);
uvm_lock_pageq();
uvm_pagefree(pp);
uvm_unlock_pageq();
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c
index 3c93ee8907b..6b53632de6f 100644
--- a/sys/uvm/uvm_page.c
+++ b/sys/uvm/uvm_page.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_page.c,v 1.132 2014/11/16 12:31:00 deraadt Exp $ */
+/* $OpenBSD: uvm_page.c,v 1.133 2015/02/06 10:58:35 deraadt Exp $ */
/* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */
/*
@@ -1053,7 +1053,7 @@ uvm_pagefree(struct vm_page *pg)
}
/* Clean page state bits. */
- flags_to_clear |= PQ_AOBJ; /* XXX: find culprit */
+ KASSERT(!(pg->pg_flags & PQ_AOBJ));
flags_to_clear |= PQ_ENCRYPT|PG_ZERO|PG_FAKE|PG_BUSY|PG_RELEASED|
PG_CLEAN|PG_CLEANCHK;
atomic_clearbits_int(&pg->pg_flags, flags_to_clear);
@@ -1098,10 +1098,12 @@ uvm_page_unbusy(struct vm_page **pgs, int npgs)
if (uobj != NULL) {
uvm_lock_pageq();
pmap_page_protect(pg, PROT_NONE);
- /* XXX won't happen right now */
- if (pg->pg_flags & PQ_AOBJ)
+ if (pg->pg_flags & PQ_AOBJ) {
uao_dropswap(uobj,
pg->offset >> PAGE_SHIFT);
+ atomic_clearbits_int(&pg->pg_flags,
+ PQ_AOBJ);
+ }
uvm_pagefree(pg);
uvm_unlock_pageq();
} else {