From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2ALB-00010o-2V for qemu-devel@nongnu.org; Sun, 25 Oct 2009 17:09:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2AL6-0000zu-Hy for qemu-devel@nongnu.org; Sun, 25 Oct 2009 17:09:28 -0400 Received: from [199.232.76.173] (port=33024 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2AL6-0000zr-Bt for qemu-devel@nongnu.org; Sun, 25 Oct 2009 17:09:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46186) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N2AL5-0001Ly-S1 for qemu-devel@nongnu.org; Sun, 25 Oct 2009 17:09:24 -0400 From: Juan Quintela In-Reply-To: <200910251849.44301.dl9pf@gmx.de> ("Jan-Simon =?utf-8?Q?M?= =?utf-8?Q?=C3=B6ller=22's?= message of "Sun, 25 Oct 2009 18:49:44 +0100") References: <200910251622.07800.dl9pf@gmx.de> <761ea48b0910250854g2aa96a49w65eb5ede77c38f51@mail.gmail.com> <200910251841.25045.dl9pf@gmx.de> <200910251849.44301.dl9pf@gmx.de> Date: Sun, 25 Oct 2009 22:09:10 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [Patch] Make usermode stacksize (-s) configurable at compile-time List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Jan-Simon_M=C3=B6ller?= Cc: qemu-devel@nongnu.org "Jan-Simon M=C3=B6ller" wrote: > @@ -2481,6 +2485,16 @@ if test "$target_user_only" =3D "yes" -a "$static"= =3D "no" -a \ > ldflags=3D"-pie $ldflags" > fi > > +# change default stacksize in usermode > +# > +if test "$target_user_only" =3D "yes" -a "$user_mode_stacksize" !=3D "" = ; then > + cflags=3D"-DUSER_MODE_STACKSIZE=3D$user_mode_stacksize $cflags" > + echo "user_mode_stack $user_mode_stacksize" Put this line together with: echo "PIE user targets $user_pie" > +else > + echo "user_mode_stack default" > +fi > + > + > if test "$target_softmmu" =3D "yes" -a \( \ > "$TARGET_ARCH" =3D "microblaze" -o \ > "$TARGET_ARCH" =3D "cris" \) ; then > diff --git a/linux-user/main.c b/linux-user/main.c > index 81a1ada..9ac2421 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -51,7 +51,10 @@ const char *qemu_uname_release =3D CONFIG_UNAME_RELEAS= E; > /* XXX: on x86 MAP_GROWSDOWN only works if ESP <=3D address + 32, so > we allocate a bigger stack. Need a better solution, for example > by remapping the process stack directly at the right place */ > -unsigned long x86_stack_size =3D 512 * 1024; > +#ifndef USER_MODE_STACKSIZE > +#define USER_MODE_STACKSIZE (512 * 1024) > +#endif If we are changing the code in configure anyways, why don't add the default there? Something like this (I tested that it compiled, but didn't tested usermode). I am assuming that you only want it for linux-user. >>From 0dc910f5d1b2e1dd7120abf32d25db190cd394e5 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Sun, 25 Oct 2009 22:06:52 +0100 Subject: [PATCH] User mode stacksize implementation Signed-off-by: Juan Quintela --- configure | 5 +++++ linux-user/main.c | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 43d87c5..82b9825 100755 --- a/configure +++ b/configure @@ -225,6 +225,7 @@ blobs=3D"yes" pkgversion=3D"" check_utests=3D"no" user_pie=3D"no" +user_mode_stacksize=3D"512*1024" # OS specific if check_define __linux__ ; then @@ -517,6 +518,8 @@ for opt do ;; --disable-user-pie) user_pie=3D"no" ;; + --user-mode-stacksize=3D*) user_mode_stacksize=3D"$optarg" + ;; --enable-uname-release=3D*) uname_release=3D"$optarg" ;; --sparc_cpu=3D*) @@ -1841,6 +1844,7 @@ echo "uname -r $uname_release" echo "NPTL support $nptl" echo "GUEST_BASE $guest_base" echo "PIE user targets $user_pie" +echo "User mode stacksize $user_mode_stacksize" echo "vde support $vde" echo "IO thread $io_thread" echo "Linux AIO support $linux_aio" @@ -2361,6 +2365,7 @@ if test "$target_user_only" =3D "yes" ; then fi if test "$target_linux_user" =3D "yes" ; then echo "CONFIG_LINUX_USER=3Dy" >> $config_target_mak + echo "CONFIG_USER_MODE_STACKSIZE=3D$user_mode_stacksize" >> $config_targ= et_mak fi if test "$target_darwin_user" =3D "yes" ; then echo "CONFIG_DARWIN_USER=3Dy" >> $config_target_mak diff --git a/linux-user/main.c b/linux-user/main.c index 81a1ada..5d0f849 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -51,7 +51,7 @@ const char *qemu_uname_release =3D CONFIG_UNAME_RELEASE; /* XXX: on x86 MAP_GROWSDOWN only works if ESP <=3D address + 32, so we allocate a bigger stack. Need a better solution, for example by remapping the process stack directly at the right place */ -unsigned long x86_stack_size =3D 512 * 1024; +unsigned long x86_stack_size =3D CONFIG_USER_MODE_STACKSIZE; void gemu_log(const char *fmt, ...) { --=20 1.6.2.5