From nobody Wed Jun 25 09:25:36 2025 X-Original-To: dev-commits-src-main@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 4bRxJ14Qq3z5ynF8; Wed, 25 Jun 2025 09:25: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRxJ11NPcz3Mpb; Wed, 25 Jun 2025 09:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843537; 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=3CcYAJBVhrZcZ976y572btDpXkrM2HnTpGp3sv24mN8=; b=T9NTSW48ca+PF+UzGQiEUCAyCuj7WalJv0AZalJKUyCY5JuRirx0SQ8aSWKoXugJiaZBCL pABfPh474nf9pocdJS8Nv6FjYsz0pI4a1BbG/fHwPOdGB38cOwB8wYlynTcMztGL+hFV6q wghN0fjwwS6S5MQGa44cjkm8QZKLfJ3eWI210hivrQOi0ghTzAW3V/UCwF6qKk0s7Navdi dFkfAJLO0Fzdb4iOIjgvbwCObZOa3yUf0rV9EhcG59BwcBoz9wkGPbf8VW2OJVX9M6ZJ9f QVBcvemOJuW4r3hH0pD4L91vcEaYaxHtbLQ/2istLAqt0Y0zJpYW9C+DNymhow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750843537; 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=3CcYAJBVhrZcZ976y572btDpXkrM2HnTpGp3sv24mN8=; b=PDEbvdZbbH9UDGIxNdf+ZrSS4m5Ys35n0s9iX99/CqeO7a8rYewEEyKBS+kDHzpcutb66Q J0fPW2bEoyc3aldpeKmCpaB0FnEF8kOiaizYj5Xl/L4tv666Pz4wwZe31PdWfQC/Kdq4NT YuSzwKLPS0sev50Dun5GlMtP/vsum3fTPrR7O2OSr/v+X8ZqIegphDmi2lyyq+WrO0tzel FDWZz71XpBooYTvpEQ2u1AP+mMgeSMZoiP+kTKvECJwgWB6trSvlwadglKY2omvkQSmfEy muVA7X+sk3Od53HVEpK3TRFmDgRQeqeBpX+QgnfyKV+uh5A+Z6Yf4Rn81OfzvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750843537; a=rsa-sha256; cv=none; b=gVU0oabiDDPHRHnfNfWE/OHuPS7ZOQxuQtpmnHkvJ8bCbS7c2BiMH3lcE8crp/f+wDERx+ WuL0MWJbsqzLoK1XyRyK1VL1T6VbOHHUKqkDC1vsA6X6cMehFSEOu/+rfsJhjh++uQL/RV SRmbOYdyngvI4nX24/snXgLSBW0GPEFiVRhgSoi5GlsiHjXPGR8CykdYf6+vnskNoinSqx FHMjXOJwjWFCM1ssoU2QezKXxjA7aCooKYscA5+4RtZRB/NXjbnm2BEB9o+R2a/PkVuRRD FTHvRS9AH2KpXrKC/J84yEDClufNPs810CTJjIrHcCLlyqa1tAAq1yfQVJTIaQ== 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 4bRxJ06nPGz1QZQ; Wed, 25 Jun 2025 09:25:36 +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 55P9Pa4o077148; Wed, 25 Jun 2025 09:25:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P9PaHm077145; Wed, 25 Jun 2025 09:25:36 GMT (envelope-from git) Date: Wed, 25 Jun 2025 09:25:36 GMT Message-Id: <202506250925.55P9PaHm077145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 85007872d122 - main - sys: Add AT_HWCAP3 and AT_HWCAP4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85007872d1227006adf2ce119fe30de856cbe12d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=85007872d1227006adf2ce119fe30de856cbe12d commit 85007872d1227006adf2ce119fe30de856cbe12d Author: Andrew Turner AuthorDate: 2025-06-24 14:56:46 +0000 Commit: Andrew Turner CommitDate: 2025-06-24 16:26:40 +0000 sys: Add AT_HWCAP3 and AT_HWCAP4 It is likely we will need these on arm64. Add them in preparation for flags in these to be added at some point in the future. Reviewed by: brooks, imp, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51005 --- sys/amd64/linux/linux_sysvec.c | 2 ++ sys/amd64/linux32/linux32_sysvec.c | 2 ++ sys/arm/arm/elf_machdep.c | 2 ++ sys/arm64/arm64/elf32_machdep.c | 2 ++ sys/arm64/arm64/elf_machdep.c | 2 ++ sys/arm64/linux/linux_sysvec.c | 2 ++ sys/compat/linux/linux_misc.h | 4 +++- sys/i386/linux/linux_sysvec.c | 4 ++++ sys/kern/imgact_elf.c | 4 ++++ sys/powerpc/powerpc/elf32_machdep.c | 2 ++ sys/powerpc/powerpc/elf64_machdep.c | 4 ++++ sys/powerpc/powerpc/elf_common.c | 1 + sys/sys/elf_common.h | 4 +++- sys/sys/sysent.h | 2 ++ 14 files changed, 35 insertions(+), 2 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 3760a5455a73..c8579c5da4ad 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -711,6 +711,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = linux_vsyscall, .sv_hwcap = NULL, .sv_hwcap2 = NULL, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index d7f87e2fdf34..8fac626f9053 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -811,6 +811,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = NULL, .sv_hwcap = NULL, .sv_hwcap2 = NULL, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c index e1003b71543a..ea6437f320ce 100644 --- a/sys/arm/arm/elf_machdep.c +++ b/sys/arm/arm/elf_machdep.c @@ -97,6 +97,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index fd2a2690b7a1..7cd5327b9f1b 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -134,6 +134,8 @@ static struct sysentvec elf32_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf32_hwcap, .sv_hwcap2 = &elf32_hwcap2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c index d5b420a8b519..6ca8a711839f 100644 --- a/sys/arm64/arm64/elf_machdep.c +++ b/sys/arm64/arm64/elf_machdep.c @@ -101,6 +101,8 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_protect = arm64_exec_protect, .sv_onexit = exit_onexit, diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 185c4f3044b1..13c42e061094 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -458,6 +458,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = NULL, .sv_hwcap = &linux_elf_hwcap, .sv_hwcap2 = &linux_elf_hwcap2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index 445110c598cc..2d2b12ef0127 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -85,7 +85,9 @@ * differ from AT_PLATFORM. */ #define LINUX_AT_RANDOM 25 /* address of random bytes */ -#define LINUX_AT_HWCAP2 26 /* CPU capabilities, second part */ +#define LINUX_AT_HWCAP2 26 /* CPU capabilities */ +#define LINUX_AT_HWCAP3 29 /* CPU capabilities */ +#define LINUX_AT_HWCAP4 30 /* CPU capabilities */ #define LINUX_AT_EXECFN 31 /* filename of program */ #define LINUX_AT_SYSINFO 32 /* vsyscall */ #define LINUX_AT_SYSINFO_EHDR 33 /* vdso header */ diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index c68a0e17a8e4..85877bf40997 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -606,6 +606,8 @@ struct sysentvec linux_sysvec = { .sv_trap = NULL, .sv_hwcap = NULL, .sv_hwcap2 = NULL, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, @@ -650,6 +652,8 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = NULL, .sv_hwcap = NULL, .sv_hwcap2 = NULL, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 1a2c0e2ef93d..b7ffbe68b483 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1487,6 +1487,10 @@ __elfN(freebsd_copyout_auxargs)(struct image_params *imgp, uintptr_t base) AUXARGS_ENTRY(pos, AT_HWCAP, *imgp->sysent->sv_hwcap); if (imgp->sysent->sv_hwcap2 != NULL) AUXARGS_ENTRY(pos, AT_HWCAP2, *imgp->sysent->sv_hwcap2); + if (imgp->sysent->sv_hwcap3 != NULL) + AUXARGS_ENTRY(pos, AT_HWCAP3, *imgp->sysent->sv_hwcap3); + if (imgp->sysent->sv_hwcap4 != NULL) + AUXARGS_ENTRY(pos, AT_HWCAP4, *imgp->sysent->sv_hwcap4); bsdflags = 0; bsdflags |= __elfN(sigfastblock) ? ELF_BSDF_SIGFASTBLK : 0; oc = atomic_load_int(&vm_overcommit); diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c index af01043878db..e1118713bff0 100644 --- a/sys/powerpc/powerpc/elf32_machdep.c +++ b/sys/powerpc/powerpc/elf32_machdep.c @@ -134,6 +134,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c index 1035e35d286e..a999f742caeb 100644 --- a/sys/powerpc/powerpc/elf64_machdep.c +++ b/sys/powerpc/powerpc/elf64_machdep.c @@ -97,6 +97,8 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), @@ -139,6 +141,8 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_hwcap3 = NULL, + .sv_hwcap4 = NULL, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, .sv_regset_begin = SET_BEGIN(__elfN(regset)), diff --git a/sys/powerpc/powerpc/elf_common.c b/sys/powerpc/powerpc/elf_common.c index e7960feb2c10..01a7e9febd68 100644 --- a/sys/powerpc/powerpc/elf_common.c +++ b/sys/powerpc/powerpc/elf_common.c @@ -93,6 +93,7 @@ __elfN(powerpc_copyout_auxargs)(struct image_params *imgp, uintptr_t base) AUXARGS_ENTRY(pos, AT_OLD_HWCAP, *imgp->sysent->sv_hwcap); if (imgp->sysent->sv_hwcap2 != NULL) AUXARGS_ENTRY(pos, AT_OLD_HWCAP2, *imgp->sysent->sv_hwcap2); + if (imgp->sysent->sv_hwcap3 != NULL) AUXARGS_ENTRY(pos, AT_OLD_NULL, 0); free(imgp->auxargs, M_TEMP); diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index a5e605624e1e..87460aae2dd4 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1015,8 +1015,10 @@ typedef struct { #define AT_USRSTACKBASE 35 /* Top of user stack */ #define AT_USRSTACKLIM 36 /* Grow limit of user stack */ #define AT_CHERI_STATS 37 /* Reserved */ +#define AT_HWCAP3 38 /* CPU feature flags 3. */ +#define AT_HWCAP4 39 /* CPU feature flags 4. */ -#define AT_COUNT 38 /* Count of defined aux entry types. */ +#define AT_COUNT 40 /* Count of defined aux entry types. */ /* * Relocation types. diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index dffe77de91d0..6314b03142e7 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -145,6 +145,8 @@ struct sysentvec { int (*sv_trap)(struct thread *); u_long *sv_hwcap; /* Value passed in AT_HWCAP. */ u_long *sv_hwcap2; /* Value passed in AT_HWCAP2. */ + u_long *sv_hwcap3; /* Value passed in AT_HWCAP3. */ + u_long *sv_hwcap4; /* Value passed in AT_HWCAP4. */ const char *(*sv_machine_arch)(struct proc *); vm_offset_t sv_fxrng_gen_offset; void (*sv_onexec_old)(struct thread *td);