From 2368a371257273206bc7cd9af8c8b55e94de5748 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 5 Jun 2010 06:56:06 +0000 Subject: [PATCH] Don't set PG_WRITEABLE in pmap_enter() unless the page is managed. --- sys/powerpc/aim/mmu_oea.c | 3 ++- sys/powerpc/aim/mmu_oea64.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index c3e8755ce24f..373b17e67222 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -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; diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 923a94f771a1..8ff27d030496 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -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;