summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2012-11-02 15:10:29 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2012-11-02 15:10:29 +0000
commitea1f62fc8aa35fc860149f014ee035e73107cf73 (patch)
tree6b5a6eb2327c491ac8a187fa0bb72f5813751116 /sys/arch/amd64
parentc487f7585b421c894cf8fd0a6d126f1f83ca4411 (diff)
uvm_km_alloc() allocs bytes rounded up to the nearest page not pages.
Problem spotted by and diff to fix this (and convert to km_alloc) from oga ok deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/cpu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c
index 0b843d32dad..3422ceeaff7 100644
--- a/sys/arch/amd64/amd64/cpu.c
+++ b/sys/arch/amd64/amd64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.53 2012/10/31 03:30:22 jsg Exp $ */
+/* $OpenBSD: cpu.c,v 1.54 2012/11/02 15:10:28 jsg Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -156,7 +156,7 @@ replacesmap(void)
* Create writeable aliases of memory we need
* to write to as kernel is mapped read-only
*/
- nva = uvm_km_valloc(kernel_map, 2);
+ nva = (vaddr_t)km_alloc(2 * PAGE_SIZE, &kv_any, &kp_none, &kd_waitok);
for (i = 0; i < nitems(ireplace); i++) {
paddr_t kva = trunc_page((paddr_t)ireplace[i].daddr);
@@ -174,7 +174,7 @@ replacesmap(void)
bcopy(ireplace[i].saddr, (void *)(nva + po), 3);
}
- uvm_km_free(kernel_map, nva, 2);
+ km_free((void *)nva, 2 * PAGE_SIZE, &kv_any, &kp_none);
splx(s);
}