From nobody Mon Sep 16 23:02:37 2024 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 4X70ms5T0Jz5WLLT; Mon, 16 Sep 2024 23:02:37 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X70ms1lTQz4SBC; Mon, 16 Sep 2024 23:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527757; 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=a1+T2iuvM7FOXDwt5VwHYbz+dRxwsHkzWv8H14Ky6fI=; b=fD+OAP9K9Fg5zshhWaJmL2cJK/SoE9x8INaZpehz/5wqulNejIo4GFLIYVP0fVmDz3qUuJ NxDjyJSgXaIaTNubYpHQOcM//Ql2R/G/3usgaoxlIUynkb84UouEsOyjaEDZrW6Dvmh9XD yQ9tBwEXHp1li19Xvvg8o2gvHMWbWpcXkpJlOg3oqekn3S/hEzflor9YAkWxtQw1fl2Yck 1LzbnvyHxTSlIKnF2IPbyK8CLCB9vO2YWviP4pIMitlxL/13P4eONw+cIFb/gxxci1gFSv 79Xh5v10+oSIESBJIxspPFhKcTy8K6CRzPIy8Lemk1UVLS5tBL1J0I+96qu66A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726527757; a=rsa-sha256; cv=none; b=S5O7Ldwg4n3GPQVVbB/XaARQuX0ksrRmUuzN6EGgJEB+K9qglG0exnv7drDuFESm/fgiAn m7HRYpMpJfqJuQNxPT/IvIEwcRL3/oHteS43uI4hAAwrMHfX1qVZxflyX2OjL0B9O5kWAQ b1zWryrmT5Nr1kX3Yr4r8fzMx1LJH9ZDmDaLq8JVlVqruZ2/qi021+sfPdOAyU6hGJbABv FGOZ0PMkrIHtkw3EkYCWpTAJIWdSvXxQL8PiDSZ88jG3/U1mxpJRzARnr4QQZCdZDHY7tB Zh2RWdaudJJ1PKoZf2lCBTLlk1jpKgvlo1IAQMVBbwhgiLEVvJiN6+IZICFHWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527757; 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=a1+T2iuvM7FOXDwt5VwHYbz+dRxwsHkzWv8H14Ky6fI=; b=S2SmUr+sXtgF+zVf8MUFxjJH5cJ8AQcfqdx0C3nueDUL8kUFQyBQJmTTZUgLCuk4OgloMH NBSeqObcAC81t9eWI/7ZXeNL+eIkgLlUBxWba9AgTz0hBmw4/pmgiTj7nhrkymovUBH3eE DU8XCFDg3vWiBpgwLFYAxIjROzwdgFPt8nkhraDu7OdBItphSIlDlS32BwhiFwJHu6meEB tsF6SZCIg/98xFSNNt2KVTNUTupBtQwQWeUmfNAEva5txOcjkbxIxBEq6fKumhxH4t9YXQ 3jIRaUdiKgIqlZMQikjds0glq8xxkbY6w2A4+M3zd34DkCfGbAQkqgostbDd9A== 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 4X70ms1Mh7zDvM; Mon, 16 Sep 2024 23:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48GN2baw043204; Mon, 16 Sep 2024 23:02:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GN2bZE043201; Mon, 16 Sep 2024 23:02:37 GMT (envelope-from git) Date: Mon, 16 Sep 2024 23:02:37 GMT Message-Id: <202409162302.48GN2bZE043201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 666303f59808 - main - sysarch: improve checks for max user address 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 666303f5980896346c455bc949e49952220d02b7 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=666303f5980896346c455bc949e49952220d02b7 commit 666303f5980896346c455bc949e49952220d02b7 Author: Konstantin Belousov AuthorDate: 2024-09-16 19:55:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 23:02:14 +0000 sysarch: improve checks for max user address making LA48 processes have the same limit as with the pre-LA57 kernels. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/sys_machdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 887c8f05b00d..c8bddb0acb19 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -314,7 +315,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case AMD64_SET_FSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); if (error == 0) { - if (a64base < VM_MAXUSER_ADDRESS) { + if (a64base < curproc->p_sysent->sv_maxuser) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_fsbase = a64base; td->td_frame->tf_fs = _ufssel; @@ -332,7 +333,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case AMD64_SET_GSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); if (error == 0) { - if (a64base < VM_MAXUSER_ADDRESS) { + if (a64base < curproc->p_sysent->sv_maxuser) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_gsbase = a64base; td->td_frame->tf_gs = _ugssel;