summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2020-10-22 13:41:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2020-10-22 13:41:52 +0000
commitdd241885fc70b6ae68ac2f60258a459b26f4b2c7 (patch)
treeae7f72c698022debb0a8d6ee45de1825d32b7e1a /sys/arch/mips64
parent29c23e60159ded710839369b0cc66fedab574b04 (diff)
uvm_grow() doesn't need KERNEL_LOCK anymore, and onfault never did.
minor refactorings to narrow KERNEL_LOCK just around uvm_fault() ok kettenis
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/trap.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index 0f28ee334e9..cb4a8e5b9e4 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.151 2020/10/21 17:54:33 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.152 2020/10/22 13:41:51 deraadt Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -422,8 +422,8 @@ fault_common_no_miss:
onfault = pcb->pcb_onfault;
pcb->pcb_onfault = 0;
KERNEL_LOCK();
-
rv = uvm_fault(map, va, 0, access_type);
+ KERNEL_UNLOCK();
pcb->pcb_onfault = onfault;
/*
@@ -433,12 +433,11 @@ fault_common_no_miss:
* the current limit and we need to reflect that as an access
* error.
*/
- if (rv == 0)
+ if (rv == 0) {
uvm_grow(p, va);
-
- KERNEL_UNLOCK();
- if (rv == 0)
return;
+ }
+
if (!USERMODE(trapframe->sr)) {
if (onfault != 0) {
pcb->pcb_onfault = 0;
@@ -809,7 +808,7 @@ fault_common_no_miss:
sicode = BUS_OBJERR;
break;
}
-
+
/* Emulate "RDHWR rt, UserLocal". */
if (inst.RType.op == OP_SPECIAL3 &&
inst.RType.rs == 0 &&