diff options
author | Kurt Miller <kurt@cvs.openbsd.org> | 2024-03-27 15:41:41 +0000 |
---|---|---|
committer | Kurt Miller <kurt@cvs.openbsd.org> | 2024-03-27 15:41:41 +0000 |
commit | 901b499ad2f191db708e64b3a2dc2e9039c75fb1 (patch) | |
tree | 2631a773462cd86538a697781befc7c21ba894c0 /sys | |
parent | aecef9cbcfc546cf10f2cb4b2d742ff6254a2429 (diff) |
Initialize uvm_km_pages.mtx before use.
okay mpi@ miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/uvm/uvm_km.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; |