From nobody Wed Feb 16 17:59:17 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7781819C9C1F; Wed, 16 Feb 2022 17:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JzQh60y0Tz4kS2; Wed, 16 Feb 2022 17:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645034358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mCkthE5CYgRGjhVx1RFswXJvFn+Mti3fahnNjNGlogk=; b=H/69Cfc2FWVQZckkUUrcB8lwnuwvORd0v0dZ9jwNGYist1SLDS++DQN8vRapNHA56CiW0J arZsldTJg8SP1ChyOHNEdZqblQtN49vDBaDw0PpKD3TPowCJ3heNEhSglb+KziN/6L1F8s AHc/xT1om0IggZqS71/toVV/TZtKLmzeI3kZPgqCTjlOruhqC14HcyLBv/W+z/nbfTvh8i evxzFzSXaFFY9iwIGpE0KEYlEEjbEsxYkdOLIkNMvK1RK329R+WVAOZQLAG14ejd+2Ftg7 Q8kBWtSDl43fEW76VmTQj/QDCY6hMD1Q7rmOG9Fqo/rFCIrKoChLU0jQDlsHqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF7BF1AB28; Wed, 16 Feb 2022 17:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21GHxHFS050060; Wed, 16 Feb 2022 17:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21GHxHI8050059; Wed, 16 Feb 2022 17:59:17 GMT (envelope-from git) Date: Wed, 16 Feb 2022 17:59:17 GMT Message-Id: <202202161759.21GHxHI8050059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1a9f14cfa5c5 - stable/13 - Use vmspace->vm_stacktop in place of sv_usrstack in more places. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a9f14cfa5c56402d816914a1510d8db2c4d5623 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645034358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mCkthE5CYgRGjhVx1RFswXJvFn+Mti3fahnNjNGlogk=; b=ZPrdJ8vqVww76QXHut/Mt0LbFHnPECzTHJ522l2w1kwQ7zVO9O3Vrq1IKEzREkwYWAqJWK KJvOITvIl6hZWiXzGry7B+rSXszau9wchaPe0vcQ5T8Q8tPwHHLjxXxg2Ve6hjvwmVgBes 9AZaq+DftLI+vVP2Otsh95Go5ON+PZMKi+488LE6EyvwGxuLgGZScSL2xEuDf1uDB4KmCE TWJjb12U35uVkTupITnSu+3x5YY1e/S8fAPLua0MI9UBWO+gxTYLmjfbyp/gKkRbOJUkA9 uLStAXBqyRVFrWlfe3fKLDYZm9x5ndjNf8kMukGuLHy+rbUg44y9R7M0Cf745w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645034358; a=rsa-sha256; cv=none; b=wStT2bqr1v1Z965fFnc4qmmEcWKFAEgKdn2Q0rwf7zgNsjvi+vGlEVbyN/kkJjcLN7Yv1g Mkc+tV2fCPO04srS0Z0CvFiCzearkfOHoIV7fWF1ag3Herb8NjuSQfKAcJ2WV5uWmbFY4y fFlvbH0XtH9z+1guxR4d+4vTl+66+Pg9u6+yuTT+VmjOIDxxU3UcWivzU9YPWfFNXi7eN6 9I3dVo/QjKo9GnqN6Dg/c1oHIVvT4gLFT2GFcoEV+IxkC9lNb3Kogz40k3hTBi4DjaDRWV 3fmE+WiIWp7mJZDQHZuYvp3zXkbEHbAJ9+5MfivgvpVvejuLmQDCaxBHukNgqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1a9f14cfa5c56402d816914a1510d8db2c4d5623 commit 1a9f14cfa5c56402d816914a1510d8db2c4d5623 Author: John Baldwin AuthorDate: 2022-02-14 18:57:30 +0000 Commit: Mark Johnston CommitDate: 2022-02-16 16:55:37 +0000 Use vmspace->vm_stacktop in place of sv_usrstack in more places. Reviewed by: markj Obtained from: CheriBSD (cherry picked from commit becaf6433be4a7c86e8053d42f399176c24d76b6) --- sys/compat/linux/linux_mmap.c | 2 +- sys/kern/kern_resource.c | 4 ++-- sys/vm/vm_map.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c index 1b4b0b78280c..f4655adcbb52 100644 --- a/sys/compat/linux/linux_mmap.c +++ b/sys/compat/linux/linux_mmap.c @@ -178,7 +178,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot, * mmap's return value. */ PROC_LOCK(p); - vms->vm_maxsaddr = (char *)p->p_sysent->sv_usrstack - + vms->vm_maxsaddr = (char *)round_page(vms->vm_stacktop) - lim_cur_proc(p, RLIMIT_STACK); PROC_UNLOCK(p); } diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 0ea863917727..3dd243199088 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -760,12 +760,12 @@ kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which, if (limp->rlim_cur > oldssiz.rlim_cur) { prot = p->p_sysent->sv_stackprot; size = limp->rlim_cur - oldssiz.rlim_cur; - addr = p->p_sysent->sv_usrstack - + addr = round_page(p->p_vmspace->vm_stacktop) - limp->rlim_cur; } else { prot = VM_PROT_NONE; size = oldssiz.rlim_cur - limp->rlim_cur; - addr = p->p_sysent->sv_usrstack - + addr = round_page(p->p_vmspace->vm_stacktop) - oldssiz.rlim_cur; } addr = trunc_page(addr); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 4c3448c358da..fb59c2351a5d 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -4666,7 +4666,7 @@ retry: * limit. */ is_procstack = addr >= (vm_offset_t)vm->vm_maxsaddr && - addr < (vm_offset_t)p->p_sysent->sv_usrstack; + addr < (vm_offset_t)vm->vm_stacktop; if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) return (KERN_NO_SPACE);