svn commit: r249442 - user/dchagin/lemul/sys/amd64/linux32
Dmitry Chagin
dchagin at FreeBSD.org
Sat Apr 13 19:59:55 UTC 2013
Author: dchagin
Date: Sat Apr 13 19:59:54 2013
New Revision: 249442
URL: http://svnweb.freebsd.org/changeset/base/249442
Log:
Put linux_platform into the vdso to avoid copying it onto the stack at
every exec.
Modified:
user/dchagin/lemul/sys/amd64/linux32/linux32_locore.s
user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c
user/dchagin/lemul/sys/amd64/linux32/linux32_vdso.lds.s
Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_locore.s
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/linux32_locore.s Sat Apr 13 19:58:24 2013 (r249441)
+++ user/dchagin/lemul/sys/amd64/linux32/linux32_locore.s Sat Apr 13 19:59:54 2013 (r249442)
@@ -5,6 +5,12 @@
#include <amd64/linux32/linux32_syscall.h> /* system call numbers */
+.data
+
+ .globl linux_platform
+linux_platform:
+ .asciz "i686"
+
.text
.code32
Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c Sat Apr 13 19:58:24 2013 (r249441)
+++ user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c Sat Apr 13 19:59:54 2013 (r249442)
@@ -110,8 +110,6 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux m
#define LINUX_SYS_linux_rt_sendsig 0
#define LINUX_SYS_linux_sendsig 0
-const char *linux_platform = "i686";
-static int linux_szplatform;
static int linux_szsigcode;
static vm_object_t linux_shared_page_obj;
static char *linux_shared_page_mapping;
@@ -228,6 +226,7 @@ struct linux32_ps_strings {
LINUX_VDSO_SYM_INTPTR(linux32_sigcode);
LINUX_VDSO_SYM_INTPTR(linux32_rt_sigcode);
LINUX_VDSO_SYM_INTPTR(linux32_vsyscall);
+LINUX_VDSO_SYM_CHAR(linux_platform);
/*
* If FreeBSD & Linux have a difference of opinion about what a trap
@@ -256,11 +255,10 @@ elf_linux_fixup(register_t **stack_base,
{
Elf32_Auxargs *args;
Elf32_Addr *base;
- Elf32_Addr *pos, *uplatform;
+ Elf32_Addr *pos;
struct linux32_ps_strings *arginfo;
arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS;
- uplatform = (Elf32_Addr *)((caddr_t)arginfo - linux_szplatform);
KASSERT(curthread->td_proc == imgp->proc,
("unsafe elf_linux_fixup(), should be curproc"));
@@ -295,7 +293,7 @@ elf_linux_fixup(register_t **stack_base,
AUXARGS_ENTRY_32(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid);
AUXARGS_ENTRY_32(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
AUXARGS_ENTRY_32(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
- AUXARGS_ENTRY_32(pos, LINUX_AT_PLATFORM, PTROUT(uplatform));
+ AUXARGS_ENTRY_32(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
if (args->execfd != -1)
AUXARGS_ENTRY_32(pos, AT_EXECFD, args->execfd);
AUXARGS_ENTRY_32(pos, AT_NULL, 0);
@@ -903,15 +901,8 @@ linux_copyout_strings(struct image_param
* Also deal with signal trampoline code for this exec type.
*/
arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS;
- destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform -
- roundup((ARG_MAX - imgp->args->stringspace),
- sizeof(char *));
-
- /*
- * Install LINUX_PLATFORM
- */
- copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform),
- linux_szplatform);
+ destp = (caddr_t)arginfo - SPARE_USRSPACE -
+ roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
/*
* If we have a valid auxargs ptr, prepare some room
@@ -1199,8 +1190,6 @@ linux_elf_modevent(module_t mod, int typ
linux_proc_exec, NULL, 1000);
linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor,
linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY);
- linux_szplatform = roundup(strlen(linux_platform) + 1,
- sizeof(char *));
linux_osd_jail_register();
stclohz = (stathz ? stathz : hz);
if (bootverbose)
Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_vdso.lds.s
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/linux32_vdso.lds.s Sat Apr 13 19:58:24 2013 (r249441)
+++ user/dchagin/lemul/sys/amd64/linux32/linux32_vdso.lds.s Sat Apr 13 19:59:54 2013 (r249442)
@@ -60,6 +60,7 @@ VERSION
linux32_vsyscall;
linux32_sigcode;
linux32_rt_sigcode;
+ linux_platform;
local: *;
};
}
More information about the svn-src-user
mailing list