HomeFreeBSD

Fix two problems with pmap_clear_modify().
rS239352Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

Fix two problems with pmap_clear_modify().

First, pmap_clear_modify() is write protecting all mappings to the specified
page, not just clearing the modified bit. Specifically, it sets PTE_RO on
the PTE, which is wrong. Moreover, it is calling vm_page_dirty(), which is
not the expected behavior for pmap_clear_modify(). Generally speaking, the
machine-independent VM layer masks these mistakes. For example, setting
PTE_RO will result in additional soft faults, but not a catastrophe.

Second, pmap_clear_modify() may not clear the modified bits because it only
iterates over the PV list when the page has the PV_TABLE_MOD flag set and
elsewhere the pmap clears the PV_TABLE_MOD flag anytime a modified mapping
is write protected or destroyed. However, the page may still have other
mappings with the modified bit set.

Eliminate a stale comment.

Details

Provenance
alcAuthored on
Parents
rS239351: The GPIO drivers were initialising their mutexes with type of
Branches
Unknown
Tags
Unknown

Event Timeline