summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/arm/arm/pmap.c3
-rw-r--r--sys/powerpc/booke/pmap.c6
-rw-r--r--sys/sparc64/sparc64/pmap.c8
3 files changed, 11 insertions, 6 deletions
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index cd8a562..a375987 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -3412,7 +3412,8 @@ do_l2b_alloc:
if (prot & VM_PROT_WRITE) {
npte |= L2_S_PROT_W;
- if (m != NULL)
+ if (m != NULL &&
+ (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
vm_page_flag_set(m, PG_WRITEABLE);
}
npte |= pte_l2_s_cache_mode;
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index ca48adc..4bc5e93 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -1596,7 +1596,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m,
if (!su)
flags |= PTE_UW;
- vm_page_flag_set(m, PG_WRITEABLE);
+ if ((flags & PTE_MANAGED) != 0)
+ vm_page_flag_set(m, PG_WRITEABLE);
} else {
/* Handle modified pages, sense modify status. */
@@ -1662,7 +1663,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m,
if (!su)
flags |= PTE_UW;
- vm_page_flag_set(m, PG_WRITEABLE);
+ if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
+ vm_page_flag_set(m, PG_WRITEABLE);
}
if (prot & VM_PROT_EXECUTE) {
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 719fb3b..7769bdc 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -1409,7 +1409,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot,
tp->tte_data |= TD_SW;
if (wired)
tp->tte_data |= TD_W;
- vm_page_flag_set(m, PG_WRITEABLE);
+ if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
+ vm_page_flag_set(m, PG_WRITEABLE);
} else if ((data & TD_W) != 0)
vm_page_dirty(m);
@@ -1429,7 +1430,7 @@ pmap_enter_locked(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot,
} else {
/*
* If there is an existing mapping, but its for a different
- * phsyical address, delete the old mapping.
+ * physical address, delete the old mapping.
*/
if (tp != NULL) {
CTR0(KTR_PMAP, "pmap_enter_locked: replace");
@@ -1449,7 +1450,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot,
data |= TD_P;
if ((prot & VM_PROT_WRITE) != 0) {
data |= TD_SW;
- vm_page_flag_set(m, PG_WRITEABLE);
+ if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
+ vm_page_flag_set(m, PG_WRITEABLE);
}
if (prot & VM_PROT_EXECUTE) {
data |= TD_EXEC;
OpenPOWER on IntegriCloud