diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 9e0b8bda319b..4ad00673db6f 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -2801,8 +2801,13 @@ pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, } if (prot & VM_PROT_WRITE) { - /* Write enable */ - npte &= ~(L2_APX); + /* + * Enable write permission if the access type + * indicates write intention. Emulate modified + * bit otherwise. + */ + if ((access & VM_PROT_WRITE) != 0) + npte &= ~(L2_APX); if ((m->oflags & VPO_UNMANAGED) == 0) { vm_page_aflag_set(m, PGA_WRITEABLE);