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

This commit is contained in:
Alan Cox 2010-06-05 06:56:06 +00:00
parent 0a100e5b0b
commit 2368a37125
2 changed files with 4 additions and 2 deletions

View File

@ -1140,7 +1140,8 @@ moea_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
if (prot & VM_PROT_WRITE) {
pte_lo |= PTE_BW;
if (pmap_bootstrapped)
if (pmap_bootstrapped &&
(m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
vm_page_flag_set(m, PG_WRITEABLE);
} else
pte_lo |= PTE_BR;

View File

@ -1249,7 +1249,8 @@ moea64_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
if (prot & VM_PROT_WRITE) {
pte_lo |= LPTE_BW;
if (pmap_bootstrapped)
if (pmap_bootstrapped &&
(m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
vm_page_flag_set(m, PG_WRITEABLE);
} else
pte_lo |= LPTE_BR;