From: kurt Date: Wed, 27 Mar 2024 15:41:40 +0000 (+0000) Subject: Initialize uvm_km_pages.mtx before use. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1b1e48261cbbae6a9ff76342d13bed3fc963929f;p=openbsd Initialize uvm_km_pages.mtx before use. okay mpi@ miod@ --- diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index d5dcc878466..a715173529a 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.151 2022/08/01 14:15:46 mpi Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.152 2024/03/27 15:41:40 kurt Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -183,6 +183,11 @@ uvm_km_init(vaddr_t base, vaddr_t start, vaddr_t end) panic("uvm_km_init: could not reserve space for kernel"); kernel_map = &kernel_map_store; + +#ifndef __HAVE_PMAP_DIRECT + /* allow km_alloc calls before uvm_km_thread starts */ + mtx_init(&uvm_km_pages.mtx, IPL_VM); +#endif } /* @@ -558,7 +563,6 @@ uvm_km_page_init(void) int len, bulk; vaddr_t addr; - mtx_init(&uvm_km_pages.mtx, IPL_VM); if (!uvm_km_pages.lowat) { /* based on physmem, calculate a good value here */ uvm_km_pages.lowat = physmem / 256;