qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu
  2011-07-28 13:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
@ 2011-07-28 13:37 ` Laurent Vivier
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2011-07-28 13:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 target-m68k/helper.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index a936fe7..f5d33cd 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -57,6 +57,11 @@ void m68k_cpu_list(FILE *f, fprintf_function cpu_fprintf)
     unsigned int i;
 
     for (i = 0; m68k_cpu_defs[i].name; i++) {
+        if (strcmp(m68k_cpu_defs[i].name, TARGET_DEFAULT_CPU) == 0) {
+            (*cpu_fprintf)(f, " >");
+        } else {
+            (*cpu_fprintf)(f, "  ");
+        }
         (*cpu_fprintf)(f, "%s\n", m68k_cpu_defs[i].name);
     }
 }
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment
@ 2011-09-18  9:37 Laurent Vivier
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c Laurent Vivier
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Laurent Vivier @ 2011-09-18  9:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

This set of patches helps to use qemu-linux-user in a chrooted environment.

It mostly allows to define the default cpu model as we can't use '-cpu' argument.
The last one defines enviromnent variables to be able to use log file and 
gdb server  ('-d' and '-g' arguments).

[PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c
[PATCH 2/4] linux-user: specify the cpu model during configure
[PATCH 3/4] linux-user,m68k: display default cpu
[PATCH 4/4] linux-user: define new environment variables

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c
  2011-09-18  9:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
@ 2011-09-18  9:37 ` Laurent Vivier
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 2/4] linux-user: specify the cpu model during configure Laurent Vivier
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2011-09-18  9:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier

From: Laurent Vivier <Laurent@Vivier.EU>

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 configure         |   14 ++++++++++++++
 linux-user/main.c |   34 +---------------------------------
 2 files changed, 15 insertions(+), 33 deletions(-)

diff --git a/configure b/configure
index ad924c4..5e10055 100755
--- a/configure
+++ b/configure
@@ -3150,6 +3150,7 @@ target_dir="$target"
 config_target_mak=$target_dir/config-target.mak
 target_arch2=`echo $target | cut -d '-' -f 1`
 target_bigendian="no"
+target_default_cpu="any"
 
 case "$target_arch2" in
   armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
@@ -3226,11 +3227,13 @@ TARGET_ABI_DIR=""
 case "$target_arch2" in
   i386)
     target_phys_bits=64
+    target_default_cpu="qemu32"
   ;;
   x86_64)
     TARGET_BASE_ARCH=i386
     target_phys_bits=64
     target_long_alignment=8
+    target_default_cpu="qemu64"
   ;;
   alpha)
     target_phys_bits=64
@@ -3273,12 +3276,14 @@ case "$target_arch2" in
     echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
     target_nptl="yes"
     target_phys_bits=64
+    target_default_cpu="24Kf"
   ;;
   mipsn32|mipsn32el)
     TARGET_ARCH=mipsn32
     TARGET_BASE_ARCH=mips
     echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
     target_phys_bits=64
+    target_default_cpu="20Kc"
   ;;
   mips64|mips64el)
     TARGET_ARCH=mips64
@@ -3286,12 +3291,14 @@ case "$target_arch2" in
     echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
     target_phys_bits=64
     target_long_alignment=8
+    target_default_cpu="20Kc"
   ;;
   ppc)
     gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=32
     target_nptl="yes"
     target_libs_softmmu="$fdt_libs"
+    target_default_cpu="750"
   ;;
   ppcemb)
     TARGET_BASE_ARCH=ppc
@@ -3300,6 +3307,7 @@ case "$target_arch2" in
     target_phys_bits=64
     target_nptl="yes"
     target_libs_softmmu="$fdt_libs"
+    target_default_cpu="750"
   ;;
   ppc64)
     TARGET_BASE_ARCH=ppc
@@ -3308,6 +3316,7 @@ case "$target_arch2" in
     target_phys_bits=64
     target_long_alignment=8
     target_libs_softmmu="$fdt_libs"
+    target_default_cpu="970fx"
   ;;
   ppc64abi32)
     TARGET_ARCH=ppc64
@@ -3317,6 +3326,7 @@ case "$target_arch2" in
     gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=64
     target_libs_softmmu="$fdt_libs"
+    target_default_cpu="750"
   ;;
   sh4|sh4eb)
     TARGET_ARCH=sh4
@@ -3326,11 +3336,13 @@ case "$target_arch2" in
   ;;
   sparc)
     target_phys_bits=64
+    target_default_cpu="Fujitsu MB86904"
   ;;
   sparc64)
     TARGET_BASE_ARCH=sparc
     target_phys_bits=64
     target_long_alignment=8
+    target_default_cpu="TI UltraSparc II"
   ;;
   sparc32plus)
     TARGET_ARCH=sparc64
@@ -3338,6 +3350,7 @@ case "$target_arch2" in
     TARGET_ABI_DIR=sparc
     echo "TARGET_ABI32=y" >> $config_target_mak
     target_phys_bits=64
+    target_default_cpu="Fujitsu MB86904"
   ;;
   s390x)
     target_nptl="yes"
@@ -3360,6 +3373,7 @@ echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
 echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
 echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
 echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak
+echo "TARGET_DEFAULT_CPU=\"$target_default_cpu\"" >> $config_target_mak
 echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
 target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`"
 echo "TARGET_$target_arch_name=y" >> $config_target_mak
diff --git a/linux-user/main.c b/linux-user/main.c
index 89a51d7..40d76b4 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3090,39 +3090,7 @@ int main(int argc, char **argv, char **envp)
     init_paths(interp_prefix);
 
     if (cpu_model == NULL) {
-#if defined(TARGET_I386)
-#ifdef TARGET_X86_64
-        cpu_model = "qemu64";
-#else
-        cpu_model = "qemu32";
-#endif
-#elif defined(TARGET_ARM)
-        cpu_model = "any";
-#elif defined(TARGET_UNICORE32)
-        cpu_model = "any";
-#elif defined(TARGET_M68K)
-        cpu_model = "any";
-#elif defined(TARGET_SPARC)
-#ifdef TARGET_SPARC64
-        cpu_model = "TI UltraSparc II";
-#else
-        cpu_model = "Fujitsu MB86904";
-#endif
-#elif defined(TARGET_MIPS)
-#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64)
-        cpu_model = "20Kc";
-#else
-        cpu_model = "24Kf";
-#endif
-#elif defined(TARGET_PPC)
-#ifdef TARGET_PPC64
-        cpu_model = "970fx";
-#else
-        cpu_model = "750";
-#endif
-#else
-        cpu_model = "any";
-#endif
+        cpu_model = TARGET_DEFAULT_CPU;
     }
     tcg_exec_init(0);
     cpu_exec_init_all();
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 2/4] linux-user: specify the cpu model during configure
  2011-09-18  9:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c Laurent Vivier
@ 2011-09-18  9:37 ` Laurent Vivier
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu Laurent Vivier
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 4/4] linux-user: define new environment variables Laurent Vivier
  3 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2011-09-18  9:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier

From: Laurent Vivier <Laurent@Vivier.EU>

This patch allows to set the default cpu model for a given architecture,
for instance:

 configure --target-list=m68k-linux-user --m68k-default-cpu=m68040

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 configure |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 5e10055..5f2c073 100755
--- a/configure
+++ b/configure
@@ -536,6 +536,10 @@ for opt do
   ;;
   --target-list=*) target_list="$optarg"
   ;;
+  --*-default-cpu=*)
+    tmp=`expr "x$opt" : 'x--\(.*\)-default-cpu=.*'`
+    eval ${tmp}_default_cpu="$optarg"
+  ;;
   --enable-trace-backend=*) trace_backend="$optarg"
   ;;
   --with-trace-file=*) trace_file="$optarg"
@@ -932,6 +936,7 @@ echo "                           use %M for cpu name [$interp_prefix]"
 echo "  --target-list=LIST       set target list (default: build everything)"
 echo "Available targets: $default_target_list" | \
     fold -s -w 53 | sed -e 's/^/                           /'
+echo "  --ARCH-default-cpu=CPU   set the default cpu for a given architecture"
 echo ""
 echo "Advanced options (experts only):"
 echo "  --source-path=PATH       path of source code [$source_path]"
@@ -3369,6 +3374,10 @@ case "$target_arch2" in
     exit 1
   ;;
 esac
+tmp_target_default_cpu=`eval echo \\$${target_arch2}_default_cpu`
+if [ "x$tmp_target_default_cpu" != "x" ] ; then
+  target_default_cpu="$tmp_target_default_cpu"
+fi
 echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
 echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
 echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu
  2011-09-18  9:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c Laurent Vivier
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 2/4] linux-user: specify the cpu model during configure Laurent Vivier
@ 2011-09-18  9:37 ` Laurent Vivier
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 4/4] linux-user: define new environment variables Laurent Vivier
  3 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2011-09-18  9:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier

From: Laurent Vivier <Laurent@Vivier.EU>

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 target-m68k/helper.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 674c8e6..ede5180 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -57,6 +57,11 @@ void m68k_cpu_list(FILE *f, fprintf_function cpu_fprintf)
     unsigned int i;
 
     for (i = 0; m68k_cpu_defs[i].name; i++) {
+        if (strcmp(m68k_cpu_defs[i].name, TARGET_DEFAULT_CPU) == 0) {
+            (*cpu_fprintf)(f, " >");
+        } else {
+            (*cpu_fprintf)(f, "  ");
+        }
         (*cpu_fprintf)(f, "%s\n", m68k_cpu_defs[i].name);
     }
 }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 4/4] linux-user: define new environment variables
  2011-09-18  9:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
                   ` (2 preceding siblings ...)
  2011-09-18  9:37 ` [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu Laurent Vivier
@ 2011-09-18  9:37 ` Laurent Vivier
  3 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2011-09-18  9:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier

From: Laurent Vivier <Laurent@Vivier.EU>

QEMU_GDB=port allows to define gdb server port to wait on.
QEMU_DEBUG=options allows to activate log file (like -d options)

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 linux-user/main.c |   14 +++++++++++---
 qemu-doc.texi     |    4 ++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index 40d76b4..9d161c4 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2822,8 +2822,10 @@ static void usage(void)
            "-strace      log system calls\n"
            "\n"
            "Environment variables:\n"
-           "QEMU_STRACE       Print system calls and arguments similar to the\n"
-           "                  'strace' program.  Enable by setting to any value.\n"
+           "QEMU_STRACE        Print system calls and arguments similar to the\n"
+           "                   'strace' program.  Enable by setting to any value.\n"
+           "QEMU_DEBUG=options Activate log. Use same options as '-d' options\n"
+           "QEMU_GDB=port      Wait gdb connection to port\n"
            "You can use -E and -U options to set/unset environment variables\n"
            "for target process.  It is possible to provide several variables\n"
            "by repeating the option.  For example:\n"
@@ -2879,7 +2881,7 @@ int main(int argc, char **argv, char **envp)
     const char *filename;
     const char *cpu_model;
     const char *log_file = DEBUG_LOGFILE;
-    const char *log_mask = NULL;
+    const char *log_mask = getenv("QEMU_DEBUG");
     struct target_pt_regs regs1, *regs = &regs1;
     struct image_info info1, *info = &info1;
     struct linux_binprm bprm;
@@ -2926,6 +2928,12 @@ int main(int argc, char **argv, char **envp)
 #if defined(cpudef_setup)
     cpudef_setup(); /* parse cpu definitions in target config file (TBD) */
 #endif
+    if (getenv("QEMU_GDB")) {
+      gdbstub_port = atoi(getenv("QEMU_GDB"));
+    }
+    /* don't propagate QEMU_DEBUG and _GDB to children */
+    unsetenv("QEMU_DEBUG");
+    unsetenv("QEMU_GDB");
 
     optind = 1;
     for(;;) {
diff --git a/qemu-doc.texi b/qemu-doc.texi
index 31199f6..2193463 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -2293,6 +2293,10 @@ space emulator hasn't implemented ptrace).  At the moment this is
 incomplete.  All system calls that don't have a specific argument
 format are printed with information for six arguments.  Many
 flag-style arguments don't have decoders and will show up as numbers.
+@item QEMU_DEBUG=options
+Activate log. Use same options as '-d' options.
+@item QEMU_GDB=port
+Wait gdb connection to port.
 @end table
 
 @node Other binaries
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu
  2012-01-22 12:27 [Qemu-devel] [PATCH 0/4] linux-user: A serie of patches to set default CPU Laurent Vivier
@ 2012-01-22 12:27 ` Laurent Vivier
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2012-01-22 12:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

From: Laurent Vivier <Laurent@Vivier.EU>

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 target-m68k/helper.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 674c8e6..ede5180 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -57,6 +57,11 @@ void m68k_cpu_list(FILE *f, fprintf_function cpu_fprintf)
     unsigned int i;
 
     for (i = 0; m68k_cpu_defs[i].name; i++) {
+        if (strcmp(m68k_cpu_defs[i].name, TARGET_DEFAULT_CPU) == 0) {
+            (*cpu_fprintf)(f, " >");
+        } else {
+            (*cpu_fprintf)(f, "  ");
+        }
         (*cpu_fprintf)(f, "%s\n", m68k_cpu_defs[i].name);
     }
 }
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu
  2013-09-06 20:47 [Qemu-devel] [PATCH 0/4] Define default CPU at configure time Laurent Vivier
@ 2013-09-06 20:47 ` Laurent Vivier
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2013-09-06 20:47 UTC (permalink / raw)
  To: Riku Voipio; +Cc: qemu-devel, Laurent Vivier

From: Laurent Vivier <Laurent@Vivier.EU>

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 target-m68k/helper.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 00a7a08..123329a 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -52,6 +52,11 @@ static void m68k_cpu_list_entry(gpointer data, gpointer user_data)
 
     typename = object_class_get_name(c);
     name = g_strndup(typename, strlen(typename) - strlen("-" TYPE_M68K_CPU));
+    if (strcmp(name, TARGET_DEFAULT_CPU) == 0) {
+        (*s->cpu_fprintf)(s->file, " >");
+    } else {
+        (*s->cpu_fprintf)(s->file, "  ");
+    }
     (*s->cpu_fprintf)(s->file, "%s\n",
                       name);
     g_free(name);
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-06 20:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-18  9:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
2011-09-18  9:37 ` [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c Laurent Vivier
2011-09-18  9:37 ` [Qemu-devel] [PATCH 2/4] linux-user: specify the cpu model during configure Laurent Vivier
2011-09-18  9:37 ` [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu Laurent Vivier
2011-09-18  9:37 ` [Qemu-devel] [PATCH 4/4] linux-user: define new environment variables Laurent Vivier
  -- strict thread matches above, loose matches on Subject: below --
2013-09-06 20:47 [Qemu-devel] [PATCH 0/4] Define default CPU at configure time Laurent Vivier
2013-09-06 20:47 ` [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu Laurent Vivier
2012-01-22 12:27 [Qemu-devel] [PATCH 0/4] linux-user: A serie of patches to set default CPU Laurent Vivier
2012-01-22 12:27 ` [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu Laurent Vivier
2011-07-28 13:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
2011-07-28 13:37 ` [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).