diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -85,7 +85,6 @@ MODULE_VERSION(linux64, 1); -const char *linux_kplatform; static int linux_szsigcode; static vm_object_t linux_shared_page_obj; static char *linux_shared_page_mapping; @@ -791,9 +790,6 @@ bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; - - linux_kplatform = linux_shared_page_mapping + - (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, linux_vdso_install, NULL); diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -90,7 +90,6 @@ MODULE_VERSION(linux, 1); -const char *linux_kplatform; static int linux_szsigcode; static vm_object_t linux_shared_page_obj; static char *linux_shared_page_mapping; @@ -955,9 +954,6 @@ bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; - - linux_kplatform = linux_shared_page_mapping + - (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, linux_vdso_install, NULL); diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -65,7 +65,6 @@ MODULE_VERSION(linux64elf, 1); -const char *linux_kplatform; static int linux_szsigcode; static vm_object_t linux_shared_page_obj; static char *linux_shared_page_mapping; @@ -467,9 +466,6 @@ memcpy(linux_shared_page_mapping, elf_linux_sysvec.sv_sigcode, linux_szsigcode); elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; - - linux_kplatform = linux_shared_page_mapping + - (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, linux_vdso_install, NULL); diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -74,8 +74,6 @@ #define LINUX_PATH_MAX 4096 -extern const char *linux_kplatform; - /* * Non-standard aux entry types used in Linux ELF binaries. */ diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -721,8 +721,10 @@ * to remain "i686", though. */ strlcpy(utsname.machine, "x86_64", LINUX_MAX_UTSNAME); -#else - strlcpy(utsname.machine, linux_kplatform, LINUX_MAX_UTSNAME); +#elif defined(__aarch64__) + strlcpy(utsname.machine, "aarch64", LINUX_MAX_UTSNAME); +#elif defined(__i386__) + strlcpy(utsname.machine, "i686", LINUX_MAX_UTSNAME); #endif return (copyout(&utsname, args->buf, sizeof(utsname))); diff --git a/sys/i386/linux/linux_locore.asm b/sys/i386/linux/linux_locore.asm --- a/sys/i386/linux/linux_locore.asm +++ b/sys/i386/linux/linux_locore.asm @@ -7,6 +7,14 @@ #include "assym.inc" + .data + + .globl linux_platform +linux_platform: + .asciz "i686" + + .text + /* * To avoid excess stack frame the signal trampoline code emulates * the 'call' instruction. diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -100,9 +100,6 @@ static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); -static int linux_szplatform; -const char *linux_kplatform; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -142,6 +139,7 @@ _bsd_to_linux_trapcode[(code)]: \ LINUX_T_UNKNOWN) +LINUX_VDSO_SYM_CHAR(linux_platform); LINUX_VDSO_SYM_INTPTR(linux_sigcode); LINUX_VDSO_SYM_INTPTR(linux_rt_sigcode); LINUX_VDSO_SYM_INTPTR(linux_vsyscall); @@ -192,14 +190,12 @@ struct proc *p; Elf32_Auxargs *args; Elf32_Auxinfo *argarray, *pos; - Elf32_Addr *uplatform; struct ps_strings *arginfo; int error, issetugid; p = imgp->proc; issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; - uplatform = (Elf32_Addr *)((caddr_t)arginfo - linux_szplatform); args = (Elf32_Auxargs *)imgp->auxargs; argarray = pos = malloc(LINUX_AT_COUNT * sizeof(*pos), M_TEMP, M_WAITOK | M_ZERO); @@ -231,7 +227,7 @@ AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); 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_PLATFORM, PTROUT(uplatform)); + AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform)); AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary); if (imgp->execpathp != 0) AUXARGS_ENTRY_PTR(pos, LINUX_AT_EXECFN, imgp->execpathp); @@ -286,13 +282,6 @@ arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; destp = (uintptr_t)arginfo; - /* Install LINUX_PLATFORM. */ - destp -= linux_szplatform; - destp = rounddown2(destp, sizeof(void *)); - error = copyout(linux_kplatform, (void *)destp, linux_szplatform); - if (error != 0) - return (error); - if (execpath_len != 0) { destp -= execpath_len; destp = rounddown2(destp, sizeof(void *)); @@ -819,25 +808,6 @@ pcb->pcb_initial_npxcw = __LINUX_NPXCW__; } -static void -linux_get_machine(const char **dst) -{ - - switch (cpu_class) { - case CPUCLASS_686: - *dst = "i686"; - break; - case CPUCLASS_586: - *dst = "i586"; - break; - case CPUCLASS_486: - *dst = "i486"; - break; - default: - *dst = "i386"; - } -} - struct sysentvec linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, @@ -1046,9 +1016,6 @@ linux_ioctl_register_handler(*lihp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); - linux_get_machine(&linux_kplatform); - linux_szplatform = roundup(strlen(linux_kplatform) + 1, - sizeof(char *)); linux_dev_shm_create(); linux_osd_jail_register(); stclohz = (stathz ? stathz : hz);