summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-12-18 08:53:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-12-18 08:53:30 +0000
commit3ce1a364bd848cb91d7bb5a5b4e030f736a76da8 (patch)
tree66490089f8d7b101f2ff6076c262bd79d9a71fd3
parent2e88cb97f29e38e0d01970277d524d40b650fa50 (diff)
Use separate rwlock initializations for userland ("vmspace") and kernel
maps. This lets witness know that these really are different classes avoiding false positives when detecting lock order reversals. ok guenther@, visa@, mpi@
-rw-r--r--sys/uvm/uvm_map.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 5b35f603be8..3e280f05a3b 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.259 2019/12/12 11:12:36 mpi Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.260 2019/12/18 08:53:29 kettenis Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -2654,7 +2654,10 @@ uvm_map_setup(struct vm_map *map, vaddr_t min, vaddr_t max, int flags)
map->s_start = map->s_end = 0; /* Empty stack area by default. */
map->flags = flags;
map->timestamp = 0;
- rw_init_flags(&map->lock, "vmmaplk", RWL_DUPOK);
+ if (flags & VM_MAP_ISVMSPACE)
+ rw_init_flags(&map->lock, "vmmaplk", RWL_DUPOK);
+ else
+ rw_init(&map->lock, "kmmaplk");
mtx_init(&map->mtx, IPL_VM);
mtx_init(&map->flags_lock, IPL_VM);