HomeFreeBSD

arm64/pmap: fix pmap_is_valid_memattr()

Description

arm64/pmap: fix pmap_is_valid_memattr()

The function pmap_is_valid_memattr(pmap, mode) checks whether the
given variable mode is between the two constant values
VM_MEMATTR_DEVICE and VM_MEMATTR_WRITE_THROUGH.
After the code for this function was written, the value of
VM_MEMATTR_DEVICE changed from 0 to 4. Since VM_MEMATTR_WRITE_THROUGH
is still 3, the condition is always false.
This patch changes the condition to check whether mode is equal to any
of the VM_MEMATTR* constants.

Reviewed by: andrew, tuexen
Differential Revision: https://reviews.freebsd.org/D55534
Event: Wiesbaden Hackathon 2026

(cherry picked from commit 0272359ada144aa540c28fefaf996afa30dc0aa5)

Details

Provenance
timo.voelker_fh-muenster.deAuthored on Mar 2 2026, 5:59 PM
tuexenCommitted on Apr 26 2026, 7:58 AM
Reviewer
andrew
Differential Revision
D55534: arm64/pmap: Modify condition of valid_memattr that cannot be true
Parents
rG88603890a770: tcp: improve handling of segments in TIME WAIT
Branches
Unknown
Tags
Unknown