HomeFreeBSD

arm64: Fix pmap_copy()'s handling of 2MB mappings

Description

arm64: Fix pmap_copy()'s handling of 2MB mappings

When copying mappings from parent to child, we clear the accessed and
dirty bits. This is done for both 4KB and 2MB PTEs. However,
pmap_demote_l2() asserts that writable superpages must be dirty. This
is to avoid races with the MMU setting the dirty bit during promotion
and demotion. pmap_copy() can create clean, writable superpage
mappings, so it violates this assertion.

Modify pmap_copy() to preserve the accessed and dirty bits when copying
2MB mappings, like we do on amd64.

Fixes: ca2cae0b4dd
Reported by: Jenkins via mhorne
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30643

Details

Provenance
markjAuthored on Jun 6 2021, 8:40 PM
Reviewer
alc
Differential Revision
D30643: arm64: Fix pmap_copy()'s handling of 2MB mappings
Parents
rGa48f51b3d396: arm64: Use the right PTE when downgrading perms in pmap_promote_l2()
Branches
Unknown
Tags
Unknown