diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-10-21 17:54:34 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-10-21 17:54:34 +0000 |
commit | 968fd9cb2169ef30e36a024267f070a5ccf05e38 (patch) | |
tree | a817627e0f29b469b8b0723bbd222a24b612526a /sys | |
parent | f95e1b7ca967a2fe568b0987ee4d1eefaa06eeaa (diff) |
uvm_grow() now does the vm_maxsaddr check (before locking), so callers don't
need to do it
ok kettenis
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/alpha/trap.c | 5 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/trap.c | 6 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/sh/sh/trap.c | 5 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/trap.c | 9 |
5 files changed, 13 insertions, 16 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index b990c69239f..5b286aef175 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.92 2020/10/08 19:41:03 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.93 2020/10/21 17:54:33 deraadt Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -437,8 +437,7 @@ do_fault: * the stack region outside the current limit and * we need to reflect that as an access error. */ - if (map != kernel_map && - (caddr_t)va >= vm->vm_maxsaddr) { + if (map != kernel_map) { if (rv == 0) { uvm_grow(p, va); } else if (rv == EACCES) diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index 3a43b18cedf..f7101ecbe2d 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.117 2020/10/08 19:41:05 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.118 2020/10/21 17:54:33 deraadt Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -431,7 +431,7 @@ user_fault: p->p_addr->u_pcb.pcb_onfault = pcb_onfault; - if (result == 0 && (caddr_t)va >= vm->vm_maxsaddr) + if (result == 0) uvm_grow(p, va); if (result == 0) { @@ -968,7 +968,7 @@ m88110_user_fault: } p->p_addr->u_pcb.pcb_onfault = pcb_onfault; - if (result == 0 && (caddr_t)va >= vm->vm_maxsaddr) + if (result == 0) uvm_grow(p, va); KERNEL_UNLOCK(); diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index 1e4476b6888..0f28ee334e9 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.150 2020/10/20 15:21:44 visa Exp $ */ +/* $OpenBSD: trap.c,v 1.151 2020/10/21 17:54:33 deraadt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -433,7 +433,7 @@ fault_common_no_miss: * the current limit and we need to reflect that as an access * error. */ - if (rv == 0 && (caddr_t)va >= vm->vm_maxsaddr) + if (rv == 0) uvm_grow(p, va); KERNEL_UNLOCK(); diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c index b17b3effa85..e3422bcb281 100644 --- a/sys/arch/sh/sh/trap.c +++ b/sys/arch/sh/sh/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.45 2020/10/08 19:41:05 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.46 2020/10/21 17:54:33 deraadt Exp $ */ /* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */ /* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */ @@ -418,8 +418,7 @@ tlb_exception(struct proc *p, struct trapframe *tf, uint32_t va) err = uvm_fault(map, va, 0, access_type); /* User stack extension */ - if (map != kernel_map && - va >= (vaddr_t)p->p_vmspace->vm_maxsaddr) { + if (map != kernel_map) { if (err == 0) uvm_grow(p, va); else if (err == EACCES) diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 1784b3ef81a..7cc15c50792 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.105 2020/09/24 23:49:59 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.106 2020/10/21 17:54:33 deraadt Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -811,7 +811,7 @@ data_access_fault(struct trapframe64 *tf, unsigned type, vaddr_t pc, * the current limit and we need to reflect that as an access * error. */ - if (rv == 0 && (caddr_t)va >= vm->vm_maxsaddr) + if (rv == 0) uvm_grow(p, va); if (rv != 0) { @@ -999,7 +999,7 @@ text_access_fault(struct trapframe64 *tf, unsigned type, vaddr_t pc, * the current limit and we need to reflect that as an access * error. */ - if (rv == 0 && (caddr_t)va >= vm->vm_maxsaddr) + if (rv == 0) uvm_grow(p, va); if (rv != 0) { @@ -1108,9 +1108,8 @@ text_access_error(struct trapframe64 *tf, unsigned type, vaddr_t pc, * the current limit and we need to reflect that as an access * error. */ - if (rv == 0 && (caddr_t)va >= vm->vm_maxsaddr) { + if (rv == 0) uvm_grow(p, va); - } if (rv != 0) { /* |