From 07e2ed965f90cd7a6f142a99fbb9b564235836a8 Mon Sep 17 00:00:00 2001 From: cognet Date: Sat, 13 Nov 2004 14:54:31 +0000 Subject: [PATCH] Don't forget to clear the PG_WRITEABLE flag when appropriate. --- sys/arm/arm/pmap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c index f61e790be0d3..094ecf105708 100644 --- a/sys/arm/arm/pmap.c +++ b/sys/arm/arm/pmap.c @@ -1668,6 +1668,8 @@ pmap_clearbit(struct vm_page *pg, u_int maskbits) simple_unlock(&pg->mdpage.pvh_slock); PMAP_HEAD_TO_MAP_UNLOCK(); #endif + if (maskbits & PVF_WRITE) + vm_page_flag_clear(pg, PG_WRITEABLE); return (count); } @@ -1789,6 +1791,8 @@ pmap_nuke_pv(struct vm_page *pg, pmap_t pm, struct pv_entry *pve) pg->md.urw_mappings--; else pg->md.uro_mappings--; + if (TAILQ_FIRST(&pg->md.pv_list) == NULL) + vm_page_flag_clear(pg, PG_WRITEABLE); } static struct pv_entry * @@ -3691,6 +3695,7 @@ pmap_remove(pmap_t pm, vm_offset_t sva, vm_offset_t eva) pmap_acquire_pmap_lock(pm); #endif + vm_page_lock_queues(); pmap_update(pm); if (!pmap_is_current(pm)) { cleanlist_idx = PMAP_REMOVE_CLEAN_LIST_SIZE + 1; @@ -3847,6 +3852,7 @@ pmap_remove(pmap_t pm, vm_offset_t sva, vm_offset_t eva) pmap_free_l2_bucket(pm, l2b, mappings); } + vm_page_unlock_queues(); if (flushall) cpu_tlb_flushID(); #if 0