Page MenuHomeFreeBSD

Do not loose dirty bits for removing PROT_WRITE on arm64.
ClosedPublic

Authored by kib on Apr 10 2017, 7:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jun 13 2026, 1:57 PM
Unknown Object (File)
Jun 12 2026, 5:38 PM
Unknown Object (File)
Jun 10 2026, 11:58 AM
Unknown Object (File)
May 18 2026, 2:27 AM
Unknown Object (File)
May 18 2026, 2:20 AM
Unknown Object (File)
May 5 2026, 6:20 AM
Unknown Object (File)
Apr 28 2026, 5:20 AM
Unknown Object (File)
Apr 28 2026, 5:11 AM
Subscribers

Details

Reviewers
andrew
alc
Summary

Arm64 pmap interprets accessed writable ptes as modified, since ARMv8.0 does not track Dirty Bit Modifier in hardware. If writable bit is removed, page must be marked as dirty for MI VM.

This change is most important for COW, where fork caused losing content of the dirty pages which were not yet scanned by pagedaemon.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 8645
Build 8972: CI src buildJenkins

Event Timeline

This revision is now accepted and ready to land.Apr 10 2017, 9:35 AM

pmap_remove() needs the same fix.

P.S. Please change "loose" to "lose" when you commit this revision. :-)

In D10339#214208, @alc wrote:

pmap_remove() needs the same fix.

Could you, please, elaborate ? pmap_remove() calls pmap_remove_l3() to clear pte, and the call to vm_page_dirty() is there. Superpages are always demoted before removal.

I am wrong about pmap_remove(). You are correct. It does correctly update each page's dirty field.