diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2012-11-02 15:10:29 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2012-11-02 15:10:29 +0000 |
commit | ea1f62fc8aa35fc860149f014ee035e73107cf73 (patch) | |
tree | 6b5a6eb2327c491ac8a187fa0bb72f5813751116 /sys/arch/i386 | |
parent | c487f7585b421c894cf8fd0a6d126f1f83ca4411 (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/i386')
-rw-r--r-- | sys/arch/i386/i386/cpu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/cpu.c b/sys/arch/i386/i386/cpu.c index 7334d685c76..241e85d9000 100644 --- a/sys/arch/i386/i386/cpu.c +++ b/sys/arch/i386/i386/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.47 2012/10/31 03:30:22 jsg Exp $ */ +/* $OpenBSD: cpu.c,v 1.48 2012/11/02 15:10:28 jsg Exp $ */ /* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */ /*- @@ -206,7 +206,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); @@ -224,7 +224,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); } |