Don't set PG_WRITEABLE in pmap_enter() unless the page is managed.

Correct a typo in a nearby comment on sparc64.
This commit is contained in:
Alan Cox 2010-06-05 18:20:09 +00:00
parent 9efb0787bb
commit 85a71b2578
3 changed files with 11 additions and 6 deletions

View File

@ -3412,7 +3412,8 @@ pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
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;

View File

@ -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) {

View File

@ -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;