HomeFreeBSD

arm64: Introduce and use pmap_pte_exists()

Description

arm64: Introduce and use pmap_pte_exists()

Use pmap_pte_exists() instead of pmap_pte() when the caller expects a
mapping to exist at a particular level. The caller benefits in two
ways from using pmap_pte_exists(). First, because the level is
specified to pmap_pte_exists() as a constant, rather than returned, the
compiler can specialize the implementation of pmap_pte_exists() to the
caller's exact needs, i.e., generate fewer instructions. Consequently,
within a GENERIC-NODEBUG kernel, 704 bytes worth of instructions are
eliminated from the inner loops of various pmap functions. Second,
suppose that the mapping doesn't exist. Rather than requiring every
caller to implement its own KASSERT()s to report missing mappings, the
caller can optionally have pmap_pte_exists() provide the KASSERT().

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

Details

Provenance
alcAuthored on Dec 23 2021, 6:50 PM
Reviewer
andrew
Differential Revision
D33597: arm64: Introduce and use pmap_pte_exists()
Parents
rGfb38b29b5609: vm_page: Remove extra test, dup code from page alloc
Branches
Unknown
Tags
Unknown