All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@trasno.org>
To: "Jan-Simon Möller" <dl9pf@gmx.de>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [Patch] Make usermode stacksize (-s) configurable at compile-time
Date: Sun, 25 Oct 2009 22:09:10 +0100	[thread overview]
Message-ID: <m33a5741vt.fsf@neno.mitica> (raw)
In-Reply-To: <200910251849.44301.dl9pf@gmx.de> ("Jan-Simon Möller"'s message of "Sun, 25 Oct 2009 18:49:44 +0100")

"Jan-Simon Möller" <dl9pf@gmx.de> wrote:
> @@ -2481,6 +2485,16 @@ if test "$target_user_only" = "yes" -a "$static" = "no" -a \
>    ldflags="-pie $ldflags"
>  fi
>
> +# change default stacksize in usermode
> +#
> +if test "$target_user_only" = "yes" -a "$user_mode_stacksize" != "" ; then
> + cflags="-DUSER_MODE_STACKSIZE=$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" = "yes" -a \( \
>          "$TARGET_ARCH" = "microblaze" -o \
>          "$TARGET_ARCH" = "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 = CONFIG_UNAME_RELEASE;
>  /* XXX: on x86 MAP_GROWSDOWN only works if ESP <= 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 = 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 <quintela@redhat.com>
Date: Sun, 25 Oct 2009 22:06:52 +0100
Subject: [PATCH] User mode stacksize implementation


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 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="yes"
 pkgversion=""
 check_utests="no"
 user_pie="no"
+user_mode_stacksize="512*1024"

 # OS specific
 if check_define __linux__ ; then
@@ -517,6 +518,8 @@ for opt do
   ;;
   --disable-user-pie) user_pie="no"
   ;;
+  --user-mode-stacksize=*) user_mode_stacksize="$optarg"
+  ;;
   --enable-uname-release=*) uname_release="$optarg"
   ;;
   --sparc_cpu=*)
@@ -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" = "yes" ; then
 fi
 if test "$target_linux_user" = "yes" ; then
   echo "CONFIG_LINUX_USER=y" >> $config_target_mak
+  echo "CONFIG_USER_MODE_STACKSIZE=$user_mode_stacksize" >> $config_target_mak
 fi
 if test "$target_darwin_user" = "yes" ; then
   echo "CONFIG_DARWIN_USER=y" >> $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 = CONFIG_UNAME_RELEASE;
 /* XXX: on x86 MAP_GROWSDOWN only works if ESP <= 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 = 512 * 1024;
+unsigned long x86_stack_size = CONFIG_USER_MODE_STACKSIZE;

 void gemu_log(const char *fmt, ...)
 {
-- 
1.6.2.5

  reply	other threads:[~2009-10-25 21:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-25 15:22 [Qemu-devel] [Patch] Make usermode stacksize (-s) configurable at compile-time Jan-Simon Möller
2009-10-25 15:54 ` Laurent Desnogues
2009-10-25 17:41   ` Jan-Simon Möller
2009-10-25 17:49     ` Jan-Simon Möller
2009-10-25 21:09       ` Juan Quintela [this message]
2009-10-26 11:37         ` [Qemu-devel] " Jan-Simon Möller
2009-10-26  0:53       ` [Qemu-devel] " Jamie Lokier
2009-10-26 12:25       ` Riku Voipio
2009-10-27 19:56         ` Jan-Simon Möller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m33a5741vt.fsf@neno.mitica \
    --to=quintela@trasno.org \
    --cc=dl9pf@gmx.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.