MFi386 r1.369

- Clear the PG_WRITEABLE flag in pmap_changebit() if write access is
   being removed.  Return immediately if write access is being removed and
   PG_WRITEABLE is already clear.

Note: For efficiency, pmap_changebit() should be replaced by a function
similar to sparc64's pmap_clear_write().
This commit is contained in:
Alan Cox 2002-11-18 01:36:09 +00:00
parent 4919e8cbe9
commit 49115f9070

View File

@ -2734,7 +2734,9 @@ pmap_changebit(vm_page_t m, int bit, boolean_t setem)
int changed;
int s;
if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
if (!pmap_initialized || (m->flags & PG_FICTITIOUS) ||
(!setem && bit == (PG_UWE|PG_KWE) &&
(m->flags & PG_WRITEABLE) == 0))
return;
s = splvm();
@ -2776,6 +2778,8 @@ pmap_changebit(vm_page_t m, int bit, boolean_t setem)
if (changed)
pmap_invalidate_page(pv->pv_pmap, pv->pv_va);
}
if (!setem && bit == (PG_UWE|PG_KWE))
vm_page_flag_clear(m, PG_WRITEABLE);
splx(s);
}