Skip to content
Snippets Groups Projects
  1. Jun 11, 2022
  2. Jun 10, 2022
    • Richard Henderson's avatar
      Merge tag 'pull-target-arm-20220610' of... · 2663c41c
      Richard Henderson authored
      Merge tag 'pull-target-arm-20220610' of https://git.linaro.org/people/pmaydell/qemu-arm into staging
      
       * refactor exception routing code
       * fix SCR_EL3 RAO/RAZ bits
       * gdbstub: Don't use GDB syscalls if no GDB is attached
       * semihosting/config: Merge --semihosting-config option groups
       * tests/qtest: Reduce npcm7xx_sdhci test image size
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmKjbBoZHHBldGVyLm1h
      # eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3iMGEACAA+c88ifpbMlqmDaxPArw
      # pcUNbwAel9IzCMSb/SiX0JYyf6omGx84RfKQ7hoCGnn23L47tTcRwGDXkr0vOKLG
      # +JUXvkIYO9Ylp0M/PnJFL90aO7B6uMGQVfK57yjn+URlchm+wzphI/6V1jGLMVk/
      # UaUHCOW2jFWXxsiUnj3HTyh46T+ZPMMebv4ZEaMH41jZs8D8DrEM65UFmCaBljPB
      # eEZPMRUClveosB6O9cj9qAHT5198Za7emzvsWie6AQFI/7TVxQ5oPf8QaeB74w28
      # EypXlIlMvOqF0W3mE00IPAgi8f/PgB0X6iqiwXxo+nFwm3J6rPoxo7aI5psXHQn4
      # uo2U9Ngvz/A2KVm+j7Qpgst70MScDJey7h1c4w//P8gjqLGL8OxJiyGz+rv+xLkd
      # L9Q4gIRJ0FK6brOVZX5aRXMqsnDzVZ8Ki5b6tCoAnfNNAq5y8i3gOss/DDYTKmO0
      # C4Ectuq65Qodp82EeMPW25UT1EouCQVDgD2VkaPumI3uVn6+XKDGpM36UOctPOXm
      # 6RsGvJAWsV7k0llAKjrl8p+B+bCoT6hH41oFkpl96nJuTdx7tS3+OccvEINKZwT1
      # rJ5q7IcwbMJwVTbZIJckDXvbTwcj/A9e0SqSOb7AbBiHuATUZxyRbwsQFpazigsa
      # t7Lj+Y/obz5shrq3BsIlYQ==
      # =yMh4
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Fri 10 Jun 2022 09:06:50 AM PDT
      # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
      # gpg:                issuer "peter.maydell@linaro.org"
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]
      
      * tag 'pull-target-arm-20220610' of https://git.linaro.org/people/pmaydell/qemu-arm
      
      : (28 commits)
        semihosting/config: Merge --semihosting-config option groups
        gdbstub: Don't use GDB syscalls if no GDB is attached
        target/arm: SCR_EL3.RW is RAO/WI without AArch32 EL[12]
        target/arm: Adjust format test in scr_write
        tests/qtest: Reduce npcm7xx_sdhci test image size
        target/arm: Fix Secure PL1 tests in fp_exception_el
        target/arm: Move arm_debug_target_el to debug_helper.c
        target/arm: Create raise_exception_debug
        target/arm: Remove default_exception_el
        target/arm: Introduce helper_exception_with_syndrome
        target/arm: Introduce gen_exception_el_v
        target/arm: Introduce gen_exception
        target/arm: Rename gen_exception to gen_exception_el
        target/arm: Move gen_exception to translate.c
        target/arm: Remove TBFLAG_ANY.DEBUG_TARGET_EL
        target/arm: Create helper_exception_swstep
        target/arm: Introduce gen_exception_insn
        target/arm: Rename gen_exception_insn to gen_exception_insn_el
        target/arm: Introduce gen_exception_insn_el_v
        target/arm: Rename helper_exception_with_syndrome
        ...
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      2663c41c
    • Peter Maydell's avatar
      semihosting/config: Merge --semihosting-config option groups · 90c072e0
      Peter Maydell authored
      
      Currently we mishandle the --semihosting-config option if the
      user specifies it on the command line more than once. For
      example with:
       --semihosting-config target=gdb --semihosting-config arg=foo,arg=bar
      
      the function qemu_semihosting_config_options() is called twice, once
      for each argument.  But that function expects to be called only once,
      and it always unconditionally sets the semihosting.enabled,
      semihost_chardev and semihosting.target variables.  This means that
      if any of those options were set anywhere except the last
      --semihosting-config option on the command line, those settings are
      ignored.  In the example above, 'target=gdb' in the first option is
      overridden by an implied default 'target=auto' in the second.
      
      The QemuOptsList machinery has a flag for handling this kind of
      "option group is setting global state": by setting
       .merge_lists = true;
      we make the machinery merge all the --semihosting-config arguments
      the user passes into a single set of options and call our
      qemu_semihosting_config_options() just once.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarLuc Michel <luc@lmichel.fr>
      Message-id: 20220526190053.521505-3-peter.maydell@linaro.org
      90c072e0
    • Peter Maydell's avatar
      gdbstub: Don't use GDB syscalls if no GDB is attached · ebf1b4cb
      Peter Maydell authored
      
      In two places in gdbstub.c we look at gdbserver_state.init to decide
      whether we're going to do a semihosting syscall via the gdb remote
      protocol:
       * when setting up, if the user didn't explicitly select either
         native semihosting or gdb semihosting, we autoselect, with the
         intended behaviour "use gdb if gdb is connected"
       * when the semihosting layer attempts to do a syscall via gdb, we
         silently ignore it if the gdbstub wasn't actually set up
      
      However, if the user's commandline sets up the gdbstub but tells QEMU
      to start rather than waiting for a GDB to connect (eg using '-s' but
      not '-S'), then we will have gdbserver_state.init true but no actual
      connection; an attempt to use gdb syscalls will then crash because we
      try to use gdbserver_state.c_cpu when it hasn't been set up:
      
      #0  0x00007ffff6803ba8 in qemu_cpu_kick (cpu=0x0) at ../../softmmu/cpus.c:457
      #1  0x00007ffff6c03913 in gdb_do_syscallv (cb=0x7ffff6c19944 <common_semi_cb>,
          fmt=0x7ffff7573b7e "", va=0x7ffff56294c0) at ../../gdbstub.c:2946
      #2  0x00007ffff6c19c3a in common_semi_gdb_syscall (cs=0x7ffff83fe060,
          cb=0x7ffff6c19944 <common_semi_cb>, fmt=0x7ffff7573b75 "isatty,%x")
          at ../../semihosting/arm-compat-semi.c:494
      #3  0x00007ffff6c1a064 in gdb_isattyfn (cs=0x7ffff83fe060, gf=0x7ffff86a3690)
          at ../../semihosting/arm-compat-semi.c:636
      #4  0x00007ffff6c1b20f in do_common_semihosting (cs=0x7ffff83fe060)
          at ../../semihosting/arm-compat-semi.c:967
      #5  0x00007ffff693a037 in handle_semihosting (cs=0x7ffff83fe060)
          at ../../target/arm/helper.c:10316
      
      You can probably also get into this state via some odd
      corner cases involving connecting a GDB and then telling it
      to detach from all the vCPUs.
      
      Abstract out the test into a new gdb_attached() function
      which returns true only if there's actually a GDB connected
      to the debug stub and attached to at least one vCPU.
      
      Reported-by: default avatarLiviu Ionescu <ilg@livius.net>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarLuc Michel <luc@lmichel.fr>
      Message-id: 20220526190053.521505-2-peter.maydell@linaro.org
      ebf1b4cb
    • Richard Henderson's avatar
      target/arm: SCR_EL3.RW is RAO/WI without AArch32 EL[12] · 6bcbb07a
      Richard Henderson authored
      Since DDI0487F.a, the RW bit is RAO/WI.  When specifically
      targeting such a cpu, e.g. cortex-a76, it is legitimate to
      ignore the bit within the secure monitor.
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1062
      
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220609214657.1217913-3-richard.henderson@linaro.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      6bcbb07a
    • Richard Henderson's avatar
      target/arm: Adjust format test in scr_write · bfe43e3d
      Richard Henderson authored
      
      Because reset always initializes the AA64 version, SCR_EL3,
      test the mode of EL3 instead of the type of the cpreg.
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220609214657.1217913-2-richard.henderson@linaro.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      bfe43e3d
    • Hao Wu's avatar
      tests/qtest: Reduce npcm7xx_sdhci test image size · 284ad5e7
      Hao Wu authored
      
      Creating 1GB image for a simple qtest is unnecessary
      and could lead to failures. We reduce the image size
      to 1MB to reduce the test overhead.
      
      Signed-off-by: default avatarHao Wu <wuhaotsh@google.com>
      Message-id: 20220609214125.4192212-1-wuhaotsh@google.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      284ad5e7
    • Richard Henderson's avatar
      target/arm: Fix Secure PL1 tests in fp_exception_el · 02e1de14
      Richard Henderson authored
      
      We were using arm_is_secure and is_a64, which are
      tests against the current EL, as opposed to
      arm_el_is_aa64 and arm_is_secure_below_el3, which
      can be applied to a different EL than current.
      Consolidate the two tests.
      
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220609202901.1177572-24-richard.henderson@linaro.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      02e1de14
    • Richard Henderson's avatar
      target/arm: Move arm_debug_target_el to debug_helper.c · 38e8a13c
      Richard Henderson authored
      
      This function is no longer used outside debug_helper.c.
      
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220609202901.1177572-23-richard.henderson@linaro.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      38e8a13c
    • Richard Henderson's avatar
      target/arm: Create raise_exception_debug · 04eacf6e
      Richard Henderson authored
      
      Handle the debug vs current el exception test in one place.
      Leave EXCP_BKPT alone, since that treats debug < current differently.
      
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220609202901.1177572-22-richard.henderson@linaro.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      04eacf6e
Loading