diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-03-27 00:25:31 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-03-27 00:25:31 +0000 |
| commit | f404109e90eee7f67ddaae3f52286d524a190fa0 (patch) | |
| tree | fa4d19db51df1e7b02ea4f9246b4002c9c559552 /contrib/llvm-project/lld/MachO/Writer.h | |
| parent | 8f3227f527567aef53da845ab78da8e16d9051c1 (diff) | |
The pmap layer requires writeable superpage mappings to be dirty.
Otherwise, during demotion, we may miss a hw update of the PDE which
sets the dirty bit.
When creating a managed superpage mapping without promotion, i.e., with
pmap_enter(psind == 1), we must therefore ensure that a writeable
mapping is created with the dirty bit pre-set. To that end,
vm_fault_soft_fast(), when handling a map entry with write permissions,
checks whether all constituent pages are dirty, and if so, converts the
fault to a write fault, so that pmap_enter() does the right thing. If
one or more pages is not dirty, we simply create a 4K mapping.
vm_fault_populate(), which may also create superpage mappings, did not
do this, and thus could create mappings which violate the invariant
described above. Modify it to instead check whether all constituent
pages are already dirty, and if so, convert the fault to a write fault.
Otherwise the mapping is downgraded to read-only.
Reported by: ashafer
Reviewed by: alc, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D55536
Diffstat (limited to 'contrib/llvm-project/lld/MachO/Writer.h')
0 files changed, 0 insertions, 0 deletions
