HomeFreeBSD

arm64 pmap: do not panic when unable to insert PTP into trie

Description

arm64 pmap: do not panic when unable to insert PTP into trie

When pmap_enter_l2() needs to destroy an existing kernel superpage
mapping, do not remove the saved page table page (PTP) from the pm_root
trie and remap it into the page table. Instead, simply zero it. Then,
later the PTP does not need to be unmapped and reinserted into the trie.

If the kernel region is not mapped by a superpage, then try to insert
the PTP into the pm_root trie before clearing the PTEs. If the PTP
insertion fails, then we can return failure with the old mappings still
in place.

Convert an assertion from a panic to a KASSERT.

Reviewed by: kib, markj (an earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D51220

Details

Provenance
alcAuthored on Jul 8 2025, 11:31 PM
Reviewer
kib
Differential Revision
D51220: arm64 pmap: do not panic on inability to insert ptp into trie
Parents
rG10d336114d48: tracing(7): Add hwt(4)
Branches
Unknown
Tags
Unknown