]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20141211' into...
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Dec 2014 16:47:23 +0000 (16:47 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Dec 2014 16:47:23 +0000 (16:47 +0000)
target-arm queue:
 * pass semihosting exit code out to system
 * more TrustZone support code (still not enabled yet)
 * allow user to direct semihosting to gdb or native explicitly
   rather than always auto-guessing the destination
 * fix memory leak in realview_init
 * fix coverity warning in hw/arm/boot
 * get state migration working for AArch64 CPUs
 * check errors in kvm_arm_reset_vcpu

# gpg: Signature made Thu 11 Dec 2014 12:16:19 GMT using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"

* remotes/pmaydell/tags/pull-target-arm-20141211: (33 commits)
  target-arm: Check error conditions on kvm_arm_reset_vcpu
  target-arm: Support save/load for 64 bit CPUs
  target-arm/kvm: make reg sync code common between kvm32/64
  arm_gic_kvm: Tell kernel about number of IRQs
  hw/arm/boot: fix uninitialized scalar variable warning reported by coverity
  hw/arm/realview.c: Fix memory leak in realview_init()
  target-arm: make MAIR0/1 banked
  target-arm: make c13 cp regs banked (FCSEIDR, ...)
  target-arm: make VBAR banked
  target-arm: make PAR banked
  target-arm: make IFAR/DFAR banked
  target-arm: make DFSR banked
  target-arm: make IFSR banked
  target-arm: make DACR banked
  target-arm: make TTBCR banked
  target-arm: make TTBR0/1 banked
  target-arm: make CSSELR banked
  target-arm: respect SCR.FW, SCR.AW and SCTLR.NMFI
  target-arm: add SCTLR_EL3 and make SCTLR banked
  target-arm: add MVBAR support
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1  2 
qemu-options.hx
vl.c

diff --combined qemu-options.hx
index 6f273ee7f0c4da31940e82a863e542f970d25891,afab9957a43cac5a69a29b167daf72ef7f139608..10b95688150bf4b3ab95a67a164a11f0021f17fb
@@@ -2790,14 -2790,6 +2790,14 @@@ STEX
  @findex -qmp
  Like -monitor but opens in 'control' mode.
  ETEXI
 +DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
 +    "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
 +    QEMU_ARCH_ALL)
 +STEXI
 +@item -qmp-pretty @var{dev}
 +@findex -qmp-pretty
 +Like -qmp but uses pretty JSON formatting.
 +ETEXI
  
  DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
      "-mon [chardev=]name[,mode=readline|control][,default]\n", QEMU_ARCH_ALL)
@@@ -3226,7 -3218,17 +3226,17 @@@ DEF("semihosting", 0, QEMU_OPTION_semih
  STEXI
  @item -semihosting
  @findex -semihosting
- Semihosting mode (ARM, M68K, Xtensa only).
+ Enable semihosting mode (ARM, M68K, Xtensa only).
+ ETEXI
+ DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
+     "-semihosting-config [enable=on|off,]target=native|gdb|auto   semihosting configuration\n",
+ QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32)
+ STEXI
+ @item -semihosting-config [enable=on|off,]target=native|gdb|auto
+ @findex -semihosting-config
+ Enable semihosting and define where the semihosting calls will be addressed,
+ to QEMU (@code{native}) or to GDB (@code{gdb}). The default is @code{auto}, which means
+ @code{gdb} during debug sessions and @code{native} otherwise (ARM, M68K, Xtensa only).
  ETEXI
  DEF("old-param", 0, QEMU_OPTION_old_param,
      "-old-param      old param mode\n", QEMU_ARCH_ARM)
diff --combined vl.c
index f1a5d66cb6b2b8b0bdc8d912b835c128ed699f26,7cdfd49ae0766314179734e1fdfa822f5b54d18f..113e98e56bb918c0c361698c7825c410e5345386
--- 1/vl.c
--- 2/vl.c
+++ b/vl.c
@@@ -554,6 -554,22 +554,22 @@@ static QemuOptsList qemu_icount_opts = 
      },
  };
  
+ static QemuOptsList qemu_semihosting_config_opts = {
+     .name = "semihosting-config",
+     .implied_opt_name = "enable",
+     .head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_config_opts.head),
+     .desc = {
+         {
+             .name = "enable",
+             .type = QEMU_OPT_BOOL,
+         }, {
+             .name = "target",
+             .type = QEMU_OPT_STRING,
+         },
+         { /* end of list */ }
+     },
+ };
  /**
   * Get machine options
   *
@@@ -2284,7 -2300,7 +2300,7 @@@ static int mon_init_func(QemuOpts *opts
      return 0;
  }
  
 -static void monitor_parse(const char *optarg, const char *mode)
 +static void monitor_parse(const char *optarg, const char *mode, bool pretty)
  {
      static int monitor_device_index = 0;
      QemuOpts *opts;
      }
      qemu_opt_set(opts, "mode", mode);
      qemu_opt_set(opts, "chardev", label);
 +    qemu_opt_set_bool(opts, "pretty", pretty);
      if (def)
          qemu_opt_set(opts, "default", "on");
      monitor_device_index++;
@@@ -2812,6 -2827,7 +2828,7 @@@ int main(int argc, char **argv, char **
      qemu_add_opts(&qemu_name_opts);
      qemu_add_opts(&qemu_numa_opts);
      qemu_add_opts(&qemu_icount_opts);
+     qemu_add_opts(&qemu_semihosting_config_opts);
  
      runstate_init();
  
              case QEMU_OPTION_monitor:
                  default_monitor = 0;
                  if (strncmp(optarg, "none", 4)) {
 -                    monitor_parse(optarg, "readline");
 +                    monitor_parse(optarg, "readline", false);
                  }
                  break;
              case QEMU_OPTION_qmp:
 -                monitor_parse(optarg, "control");
 +                monitor_parse(optarg, "control", false);
 +                default_monitor = 0;
 +                break;
 +            case QEMU_OPTION_qmp_pretty:
 +                monitor_parse(optarg, "control", true);
                  default_monitor = 0;
                  break;
              case QEMU_OPTION_mon:
                break;
              case QEMU_OPTION_semihosting:
                  semihosting_enabled = 1;
+                 semihosting_target = SEMIHOSTING_TARGET_AUTO;
+                 break;
+             case QEMU_OPTION_semihosting_config:
+                 semihosting_enabled = 1;
+                 opts = qemu_opts_parse(qemu_find_opts("semihosting-config"),
+                                            optarg, 0);
+                 if (opts != NULL) {
+                     semihosting_enabled = qemu_opt_get_bool(opts, "enable",
+                                                             true);
+                     const char *target = qemu_opt_get(opts, "target");
+                     if (target != NULL) {
+                         if (strcmp("native", target) == 0) {
+                             semihosting_target = SEMIHOSTING_TARGET_NATIVE;
+                         } else if (strcmp("gdb", target) == 0) {
+                             semihosting_target = SEMIHOSTING_TARGET_GDB;
+                         } else  if (strcmp("auto", target) == 0) {
+                             semihosting_target = SEMIHOSTING_TARGET_AUTO;
+                         } else {
+                             fprintf(stderr, "Unsupported semihosting-config"
+                                     " %s\n",
+                                 optarg);
+                             exit(1);
+                         }
+                     } else {
+                         semihosting_target = SEMIHOSTING_TARGET_AUTO;
+                     }
+                 } else {
+                     fprintf(stderr, "Unsupported semihosting-config %s\n",
+                             optarg);
+                     exit(1);
+                 }
                  break;
              case QEMU_OPTION_tdf:
                  fprintf(stderr, "Warning: user space PIT time drift fix "
                  add_device_config(DEV_SCLP, "stdio");
              }
              if (default_monitor)
 -                monitor_parse("stdio", "readline");
 +                monitor_parse("stdio", "readline", false);
          }
      } else {
          if (default_serial)
          if (default_parallel)
              add_device_config(DEV_PARALLEL, "vc:80Cx24C");
          if (default_monitor)
 -            monitor_parse("vc:80Cx24C", "readline");
 +            monitor_parse("vc:80Cx24C", "readline", false);
          if (default_virtcon)
              add_device_config(DEV_VIRTCON, "vc:80Cx24C");
          if (default_sclp) {