diff options
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/trap.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 34f7da566d2..68fc28f7676 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.86 2020/10/19 18:18:15 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.87 2020/10/22 13:41:51 deraadt Exp $ */ /* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */ /*- @@ -178,13 +178,12 @@ upageflttrap(struct trapframe *frame, uint64_t cr2) KERNEL_LOCK(); error = uvm_fault(&p->p_vmspace->vm_map, va, 0, access_type); + KERNEL_UNLOCK(); if (error == 0) { uvm_grow(p, va); - KERNEL_UNLOCK(); return 1; } - KERNEL_UNLOCK(); signal = SIGSEGV; sicode = SEGV_MAPERR; @@ -260,15 +259,15 @@ kpageflttrap(struct trapframe *frame, uint64_t cr2) map = kernel_map; if (curcpu()->ci_inatomic == 0 || map == kernel_map) { - KERNEL_LOCK(); onfault = pcb->pcb_onfault; pcb->pcb_onfault = NULL; + KERNEL_LOCK(); error = uvm_fault(map, va, 0, access_type); + KERNEL_UNLOCK(); pcb->pcb_onfault = onfault; if (error == 0 && map != kernel_map) uvm_grow(p, va); - KERNEL_UNLOCK(); } else error = EFAULT; |