aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/linux/linux_sysvec.c
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2021-04-13 11:38:37 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2021-04-13 12:14:30 +0000
commitca6e1fa3ce87f56847633530cb94a6fb63405680 (patch)
treee0a47843cc491f5c1fbc98d4469ccbe63e519d80 /sys/amd64/linux/linux_sysvec.c
parent73c14cc76b5f815c6b1bd93089ebafdd9269d343 (diff)
downloadsrc-ca6e1fa3ce87f56847633530cb94a6fb63405680.tar.gz
src-ca6e1fa3ce87f56847633530cb94a6fb63405680.zip
linux: adjust ordering of Linux auxv and add dummy AT_HWCAP2
This should be a no-op; the purpose of this is to reduce a spurious difference between Linuxulator and Linux, to make debugging core dumps slightly easier. Note that AT_HWCAP2 we pass to Linux binaries is always 0, instead of being equal to 'cpu_feature2'. This matches what I've observed under Ubuntu Focal VM. Reviewed By: chuck, dchagin Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29609
Diffstat (limited to 'sys/amd64/linux/linux_sysvec.c')
-rw-r--r--sys/amd64/linux/linux_sysvec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
index 252579a4809e..a04cddeb3c71 100644
--- a/sys/amd64/linux/linux_sysvec.c
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -265,11 +265,11 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base)
AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR,
imgp->proc->p_sysent->sv_shared_page_base);
AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature);
+ AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz);
AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz);
AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);
AUXARGS_ENTRY(pos, AT_PHENT, args->phent);
AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum);
- AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz);
AUXARGS_ENTRY(pos, AT_BASE, args->base);
AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
@@ -278,12 +278,13 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base)
AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid);
- AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary);
+ AUXARGS_ENTRY(pos, LINUX_AT_HWCAP2, 0);
if (imgp->execpathp != 0)
AUXARGS_ENTRY_PTR(pos, LINUX_AT_EXECFN, imgp->execpathp);
if (args->execfd != -1)
AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
+ AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
AUXARGS_ENTRY(pos, AT_NULL, 0);
free(imgp->auxargs, M_TEMP);