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.

(cherry picked from commit 2cfd6342ac84c6915106fbe141795ca23a96cbba)

Details

Provenance
alcAuthored on Jul 8 2025, 11:31 PM
Parents
rG3922d7f62778: ip_htable: fix -Wtautological-pointer-compare warnings
Branches
Unknown
Tags
Unknown