Module Name: src
Committed By: matt
Date: Fri Nov 2 16:43:16 UTC 2012
Modified Files:
src/sys/uvm: uvm_map.c
Log Message:
When uvm_io reserves kernel address space, make sure it's starts with the
same color as the user address space being copied.
To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/uvm/uvm_map.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.323 src/sys/uvm/uvm_map.c:1.324
--- src/sys/uvm/uvm_map.c:1.323 Mon Oct 29 16:00:05 2012
+++ src/sys/uvm/uvm_map.c Fri Nov 2 16:43:16 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_map.c,v 1.323 2012/10/29 16:00:05 para Exp $ */
+/* $NetBSD: uvm_map.c,v 1.324 2012/11/02 16:43:16 matt Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.323 2012/10/29 16:00:05 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.324 2012/11/02 16:43:16 matt Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -2369,7 +2369,7 @@ uvm_map_reserve(struct vm_map *map, vsiz
vaddr_t offset /* hint for pmap_prefer */,
vsize_t align /* alignment */,
vaddr_t *raddr /* IN:hint, OUT: reserved VA */,
- uvm_flag_t flags /* UVM_FLAG_FIXED or 0 */)
+ uvm_flag_t flags /* UVM_FLAG_FIXED or UVM_FLAG_COLORMATCH or 0 */)
{
UVMHIST_FUNC("uvm_map_reserve"); UVMHIST_CALLED(maphist);
@@ -2576,8 +2576,11 @@ uvm_map_extract(struct vm_map *srcmap, v
if ((flags & UVM_EXTRACT_RESERVED) == 0) {
dstaddr = vm_map_min(dstmap);
- if (!uvm_map_reserve(dstmap, len, start, 0, &dstaddr, 0))
+ if (!uvm_map_reserve(dstmap, len, start,
+ atop(start) & uvmexp.colormask, &dstaddr,
+ UVM_FLAG_COLORMATCH))
return (ENOMEM);
+ KASSERT((atop(start ^ dstaddr) & uvmexp.colormask) == 0);
*dstaddrp = dstaddr; /* pass address back to caller */
UVMHIST_LOG(maphist, " dstaddr=0x%x", dstaddr,0,0,0);
} else {