HomeFreeBSD

linuxkpi: Fix set_memory_*

Description

linuxkpi: Fix set_memory_*

set_memory_* is currently implemented using PHYS_TO_DMAP but not all
architectures have a DMAP. Looking at how this function is used the
given address isn't physical but virtual so the PHYS_TO_DMAP call can
simply be removed.

Also cast numpages before shifting it to avoid overflow.

Reviewed by: kib, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45057

Details

Provenance
tijlAuthored on May 3 2024, 1:27 PM
Reviewer
kib
Differential Revision
D45057: linuxkpi: Fix set_memory_*
Parents
rG95032b58a1ad: Tighten boundary check in split(1) to prevent a potential buffer overflow.
Branches
Unknown
Tags
Unknown