From b4b264f3e98d138dd4ceea5e4ae2f7c8dc4d9df6 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 23 May 2009 18:33:22 +0000 Subject: [PATCH] When a page is mapped for write access on a read fault, the PTE should be configured to trap on a write access unless *all* of the page's dirty bits are set. --- sys/mips/mips/pmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 2188c369561..c3d6060a35e 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -3116,7 +3116,8 @@ init_pte_prot(vm_offset_t va, vm_page_t m, vm_prot_t prot) */ rw = PTE_RWPAGE; vm_page_dirty(m); - } else if ((m->md.pv_flags & PV_TABLE_MOD) || m->dirty) + } else if ((m->md.pv_flags & PV_TABLE_MOD) || + m->dirty == VM_PAGE_BITS_ALL) rw = PTE_RWPAGE; else rw = PTE_CWPAGE;