Date: Mon, 16 Sep 2024 23:02:37 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 666303f59808 - main - sysarch: improve checks for max user address Message-ID: <202409162302.48GN2bZE043201@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=666303f5980896346c455bc949e49952220d02b7 commit 666303f5980896346c455bc949e49952220d02b7 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-09-16 19:55:06 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> 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 <sys/priv.h> #include <sys/proc.h> #include <sys/smp.h> +#include <sys/sysent.h> #include <sys/sysproto.h> #include <sys/uio.h> @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409162302.48GN2bZE043201>