-/* $OpenBSD: trap.c,v 1.153 2021/05/16 15:10:19 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.154 2021/06/20 10:58:36 sthen Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
union sigval sv;
int signal, sicode, error;
+ KERNEL_LOCK();
error = uvm_fault(&p->p_vmspace->vm_map, va, 0, access_type);
+ KERNEL_UNLOCK();
+
if (error == 0) {
uvm_grow(p, va);
return 1;
if (curcpu()->ci_inatomic == 0 || map == kernel_map) {
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)