summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2004-08-05 12:44:12 +0000
committergrehan <grehan@FreeBSD.org>2004-08-05 12:44:12 +0000
commitcc793cafa6c6314c264c58a78e10ac5942fd67de (patch)
treea4320859bde71d5fbac973d8457f117c4c70c971
parentf2baa8f5baf55081db26717d101952cd8e576ba2 (diff)
downloadFreeBSD-src-cc793cafa6c6314c264c58a78e10ac5942fd67de.zip
FreeBSD-src-cc793cafa6c6314c264c58a78e10ac5942fd67de.tar.gz
In pmap_page_protect, clear the vm page's PG_WRITEABLE flag if
downgrading to read-only. Found by triggering the KASSERT in vm_pageout_flush().
-rw-r--r--sys/powerpc/aim/mmu_oea.c8
-rw-r--r--sys/powerpc/powerpc/mmu_oea.c8
-rw-r--r--sys/powerpc/powerpc/pmap.c8
3 files changed, 21 insertions, 3 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c
index 2225cf1..62bdcec 100644
--- a/sys/powerpc/aim/mmu_oea.c
+++ b/sys/powerpc/aim/mmu_oea.c
@@ -1350,6 +1350,12 @@ pmap_page_protect(vm_page_t m, vm_prot_t prot)
pmap_pte_change(pt, &pvo->pvo_pte, pvo->pvo_vaddr);
PMAP_PVO_CHECK(pvo); /* sanity check */
}
+
+ /*
+ * Downgrading from writeable: clear the VM page flag
+ */
+ if ((prot & VM_PROT_WRITE) != VM_PROT_WRITE)
+ vm_page_flag_clear(m, PG_WRITEABLE);
}
/*
@@ -1583,7 +1589,7 @@ pmap_remove_all(vm_page_t m)
pvo_head = vm_page_to_pvoh(m);
for (pvo = LIST_FIRST(pvo_head); pvo != NULL; pvo = next_pvo) {
next_pvo = LIST_NEXT(pvo, pvo_vlink);
-
+
PMAP_PVO_CHECK(pvo); /* sanity check */
pmap_pvo_remove(pvo, -1);
}
diff --git a/sys/powerpc/powerpc/mmu_oea.c b/sys/powerpc/powerpc/mmu_oea.c
index 2225cf1..62bdcec 100644
--- a/sys/powerpc/powerpc/mmu_oea.c
+++ b/sys/powerpc/powerpc/mmu_oea.c
@@ -1350,6 +1350,12 @@ pmap_page_protect(vm_page_t m, vm_prot_t prot)
pmap_pte_change(pt, &pvo->pvo_pte, pvo->pvo_vaddr);
PMAP_PVO_CHECK(pvo); /* sanity check */
}
+
+ /*
+ * Downgrading from writeable: clear the VM page flag
+ */
+ if ((prot & VM_PROT_WRITE) != VM_PROT_WRITE)
+ vm_page_flag_clear(m, PG_WRITEABLE);
}
/*
@@ -1583,7 +1589,7 @@ pmap_remove_all(vm_page_t m)
pvo_head = vm_page_to_pvoh(m);
for (pvo = LIST_FIRST(pvo_head); pvo != NULL; pvo = next_pvo) {
next_pvo = LIST_NEXT(pvo, pvo_vlink);
-
+
PMAP_PVO_CHECK(pvo); /* sanity check */
pmap_pvo_remove(pvo, -1);
}
diff --git a/sys/powerpc/powerpc/pmap.c b/sys/powerpc/powerpc/pmap.c
index 2225cf1..62bdcec 100644
--- a/sys/powerpc/powerpc/pmap.c
+++ b/sys/powerpc/powerpc/pmap.c
@@ -1350,6 +1350,12 @@ pmap_page_protect(vm_page_t m, vm_prot_t prot)
pmap_pte_change(pt, &pvo->pvo_pte, pvo->pvo_vaddr);
PMAP_PVO_CHECK(pvo); /* sanity check */
}
+
+ /*
+ * Downgrading from writeable: clear the VM page flag
+ */
+ if ((prot & VM_PROT_WRITE) != VM_PROT_WRITE)
+ vm_page_flag_clear(m, PG_WRITEABLE);
}
/*
@@ -1583,7 +1589,7 @@ pmap_remove_all(vm_page_t m)
pvo_head = vm_page_to_pvoh(m);
for (pvo = LIST_FIRST(pvo_head); pvo != NULL; pvo = next_pvo) {
next_pvo = LIST_NEXT(pvo, pvo_vlink);
-
+
PMAP_PVO_CHECK(pvo); /* sanity check */
pmap_pvo_remove(pvo, -1);
}
OpenPOWER on IntegriCloud