diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1691,7 +1691,13 @@ va = (vm_offset_t)mem; m = PHYS_TO_VM_PAGE(pmap_kextract(va)); - pmap_remove(kernel_pmap, va, va + bytes); + + /* + * startup_alloc() returns direct-mapped slabs on some platforms. Avoid + * unmapping ranges of the direct map. + */ + if (va >= bootstart && va + bytes <= bootmem) + pmap_remove(kernel_pmap, va, va + bytes); for (; bytes != 0; bytes -= PAGE_SIZE, m++) { #if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) || \ defined(__riscv) || defined(__powerpc64__)