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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208846
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,6 +1596,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m,
if (!su)
flags |= PTE_UW;
if ((flags & PTE_MANAGED) != 0)
vm_page_flag_set(m, PG_WRITEABLE);
} else {
/* Handle modified pages, sense modify status. */
@ -1662,6 +1663,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m,
if (!su)
flags |= PTE_UW;
if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
vm_page_flag_set(m, PG_WRITEABLE);
}

View File

@ -1409,6 +1409,7 @@ 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;
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,6 +1450,7 @@ 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;
if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
vm_page_flag_set(m, PG_WRITEABLE);
}
if (prot & VM_PROT_EXECUTE) {