summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2002-07-23 15:31:36 +0000
committerart <art@openbsd.org>2002-07-23 15:31:36 +0000
commitb03555ddf7f0266e881fbf3e9397deec2fa43876 (patch)
tree908b5fe87ad8a9aa271c5d5223e988f71316b90c /sys/kern/subr_pool.c
parentPlease tell me what crack I've been smoking when I did that. (diff)
downloadwireguard-openbsd-b03555ddf7f0266e881fbf3e9397deec2fa43876.tar.xz
wireguard-openbsd-b03555ddf7f0266e881fbf3e9397deec2fa43876.zip
Fix yet another braino.
Just because the pool allocates from intrsafe memory doesn't mean that the pool has to be protected by splvm. We can have an intrsafe pools at splbio or splsoftnet. pool_page_alloc and pool_page_free must du their own splvm protection.
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r--sys/kern/subr_pool.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 03f14303eb8..ca61d080e33 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.31 2002/07/23 15:26:48 art Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.32 2002/07/23 15:31:36 art Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -2034,14 +2034,23 @@ void *
pool_page_alloc(struct pool *pp, int flags)
{
boolean_t waitok = (flags & PR_WAITOK) ? TRUE : FALSE;
+ void *ret;
+ int s;
- return ((void *)uvm_km_alloc_poolpage(waitok));
+ s = splvm();
+ ret = (void *)uvm_km_alloc_poolpage(waitok);
+ splx(s);
+ return (ret);
}
void
pool_page_free(struct pool *pp, void *v)
{
+ int s;
+
+ s = splvm();
uvm_km_free_poolpage((vaddr_t)v);
+ splx(s);
}
void *