summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2024-10-21 18:27:35 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2024-10-21 18:27:35 +0000
commitaae803f7d9290f0c52ca254b2165359cc4ea951c (patch)
treedfe4caf43dc932ae02473629f8920ecae1b7a36b /sys/uvm
parent2d27eb7a3635dbb66535856633ebd13bec608552 (diff)
We have not been swapping out kernel stacks since forever. So just
allocate the uarea with zeroed pages using km_alloc(9). Adjust the amd64 code that creates a guard page at the top of the kernel stack to use pmap_kremove(9) instead of pmap_remove(9) to reflect that the uarea no longer uses "managed" pages. ok mpi@
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_glue.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c
index 2d1a6b08fe4..603bdab582e 100644
--- a/sys/uvm/uvm_glue.c
+++ b/sys/uvm/uvm_glue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_glue.c,v 1.85 2024/10/08 02:29:10 jsg Exp $ */
+/* $OpenBSD: uvm_glue.c,v 1.86 2024/10/21 18:27:34 kettenis Exp $ */
/* $NetBSD: uvm_glue.c,v 1.44 2001/02/06 19:54:44 eeh Exp $ */
/*
@@ -257,20 +257,18 @@ uvm_vsunlock_device(struct proc *p, void *addr, size_t len, void *map)
uvm_km_free(kernel_map, kva, sz);
}
+const struct kmem_va_mode kv_uarea = {
+ .kv_map = &kernel_map,
+ .kv_align = USPACE_ALIGN
+};
+
/*
* uvm_uarea_alloc: allocate the u-area for a new thread
*/
vaddr_t
uvm_uarea_alloc(void)
{
- vaddr_t uaddr;
-
- uaddr = uvm_km_kmemalloc_pla(kernel_map, uvm.kernel_object, USPACE,
- USPACE_ALIGN, UVM_KMF_ZERO,
- no_constraint.ucr_low, no_constraint.ucr_high,
- 0, 0, USPACE/PAGE_SIZE);
-
- return (uaddr);
+ return (vaddr_t)km_alloc(USPACE, &kv_uarea, &kp_zero, &kd_waitok);
}
/*
@@ -282,7 +280,7 @@ uvm_uarea_alloc(void)
void
uvm_uarea_free(struct proc *p)
{
- uvm_km_free(kernel_map, (vaddr_t)p->p_addr, USPACE);
+ km_free(p->p_addr, USPACE, &kv_uarea, &kp_zero);
p->p_addr = NULL;
}