summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-12-15 22:51:35 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-12-15 22:51:35 +0000
commita44bd0d03ce1e180f07ed7e39d975af8c1fa2536 (patch)
treef8ba54272423f201075068404679bb1ac30a07ad /sys/arch/i386
parent3bb0ac1baf3796ba15220873110b8797514b81d9 (diff)
Use km_alloc(9)/km_free(9) instead of uvm_km_valloc(9)/uvm_km_free(9).
These are the preferred interfaces and using them avoids tripping over a kernel lock assertion during early boot. Tested by bluhm@, sthen@ and Hrvoje Popovski. ok mpi@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/ucode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/ucode.c b/sys/arch/i386/i386/ucode.c
index 61798368737..7a0060ca7c5 100644
--- a/sys/arch/i386/i386/ucode.c
+++ b/sys/arch/i386/i386/ucode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ucode.c,v 1.2 2019/06/28 21:54:05 bluhm Exp $ */
+/* $OpenBSD: ucode.c,v 1.3 2020/12/15 22:51:34 kettenis Exp $ */
/*
* Copyright (c) 2018 Stefan Fritsch <fritsch@genua.de>
* Copyright (c) 2018 Patrick Wildt <patrick@blueri.se>
@@ -102,7 +102,7 @@ cpu_ucode_setup(void)
size = round_page(bios_ucode->uc_size);
npages = size / PAGE_SIZE;
- va = uvm_km_valloc(kernel_map, size);
+ va = (vaddr_t)km_alloc(size, &kv_any, &kp_none, &kd_nowait);
if (va == 0)
return;
for (i = 0; i < npages; i++) {
@@ -119,7 +119,7 @@ cpu_ucode_setup(void)
pmap_remove(pmap_kernel(), va, va + size);
pmap_update(pmap_kernel());
- uvm_km_free(kernel_map, va, size);
+ km_free((void *)va, size, &kv_any, &kp_none);
}
/*