Skip to content
Snippets Groups Projects
  1. Apr 06, 2022
  2. Mar 22, 2022
  3. Dec 10, 2021
  4. Nov 29, 2021
    • Alex Bennée's avatar
      gdbstub: handle a potentially racing TaskState · a8e537fa
      Alex Bennée authored
      
      When dealing with multi-threaded userspace programs there is a race
      condition with the addition of cpu->opaque (aka TaskState). This is
      due to cpu_copy calling cpu_create which updates the global vCPU list.
      However the task state isn't set until later. This shouldn't be a
      problem because the new thread can't have executed anything yet but
      the gdbstub code does liberally iterate through the CPU list in
      various places.
      
      This sticking plaster ensure the not yet fully realized vCPU is given
      an pid of -1 which should be enough to ensure it doesn't show up
      anywhere else.
      
      In the longer term I think the code that manages the association
      between vCPUs and attached GDB processes could do with a clean-up and
      re-factor.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Tested-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Cc: Richard Henderson <richard.henderson@linaro.org>
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/730
      Message-Id: <20211129140932.4115115-6-alex.bennee@linaro.org>
      a8e537fa
  5. Nov 04, 2021
  6. Sep 13, 2021
  7. Aug 26, 2021
  8. May 25, 2021
  9. May 02, 2021
  10. Mar 10, 2021
  11. Mar 09, 2021
  12. Mar 06, 2021
    • Paolo Bonzini's avatar
      chardev: add nodelay option · a9b1315f
      Paolo Bonzini authored
      
      The "delay" option was introduced as a way to enable Nagle's algorithm
      with ",nodelay".  Since the short form for boolean options has now been
      deprecated, introduce a more properly named "nodelay" option.  The "delay"
      option remains as an undocumented option.
      
      "delay" and "nodelay" are mutually exclusive.  Because the check is
      done at consumption time, the code also rejects them if one of the
      two is specified via -set.
      
      Based-on: <20210226080526.651705-1-pbonzini@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a9b1315f
  13. Feb 25, 2021
  14. Feb 08, 2021
  15. Jan 18, 2021
  16. Dec 15, 2020
    • Peter Maydell's avatar
      gdbstub: Correct misparsing of vCont C/S requests · 3ddd9036
      Peter Maydell authored
      In the vCont packet, two of the command actions (C and S) take an
      argument specifying the signal to be sent to the process/thread, which is
      sent as an ASCII string of two hex digits which immediately follow the
      'C' or 'S' character.
      
      Our code for parsing this packet accidentally skipped the first of the
      two bytes of the signal value, because it started parsing the hex string
      at 'p + 1' when the preceding code had already moved past the 'C' or
      'S' with "cur_action = *p++".
      
      This meant that we would only do the right thing for signals below
      10, and would misinterpret the rest.  For instance, when the debugger
      wants to send the process a SIGPROF (27 on x86-64) we mangle this into
      a SIGSEGV (11).
      
      Remove the accidental double increment.
      
      Fixes: https://bugs.launchpad.net/qemu/+bug/1773743
      
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20201121210342.10089-1-peter.maydell@linaro.org
      3ddd9036
  17. Oct 06, 2020
    • Pavel Dovgalyuk's avatar
      replay: create temporary snapshot at debugger connection · 56357d80
      Pavel Dovgalyuk authored
      
      When record/replay does not uses overlays for storing the snapshots,
      user is not capable of issuing reverse debugging commands.
      This patch adds creation of the VM snapshot on the temporary
      overlay image, when the debugger connects to QEMU.
      Therefore the execution can be rewind to the moment
      of the debugger connection while debugging the virtual machine.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
      
      --
      
      v6:
       - dropped unused error processing (suggested by Philippe Mathieu-Daudé)
      Message-Id: <160174524096.12451.11651270339216758643.stgit@pasha-ThinkPad-X280>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      56357d80
    • Pavel Dovgaluk's avatar
      gdbstub: add reverse continue support in replay mode · cda38259
      Pavel Dovgaluk authored
      
      This patch adds support of the reverse continue operation for gdbstub.
      Reverse continue finds the last breakpoint that would happen in normal
      execution from the beginning to the current moment.
      Implementation of the reverse continue replays the execution twice:
      to find the breakpoints that were hit and to seek to the last breakpoint.
      Reverse continue loads the previous snapshot and tries to find the breakpoint
      since that moment. If there are no such breakpoints, it proceeds to
      the earlier snapshot, and so on. When no breakpoints or watchpoints were
      hit at all, execution stops at the beginning of the replay log.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
      Message-Id: <160174522930.12451.6994758004725016836.stgit@pasha-ThinkPad-X280>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      cda38259
    • Pavel Dovgaluk's avatar
      gdbstub: add reverse step support in replay mode · fda8458b
      Pavel Dovgaluk authored
      
      GDB remote protocol supports two reverse debugging commands:
      reverse step and reverse continue.
      This patch adds support of the first one to the gdbstub.
      Reverse step is intended to step one instruction in the backwards
      direction. This is not possible in regular execution.
      But replayed execution is deterministic, therefore we can load one of
      the prior snapshots and proceed to the desired step. It is equivalent
      to stepping one instruction back.
      There should be at least one snapshot preceding the debugged part of
      the replay log.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      
      --
      
      v4 changes:
       - inverted condition in cpu_handle_guest_debug (suggested by Alex Bennée)
      Message-Id: <160174522341.12451.1498758422543765253.stgit@pasha-ThinkPad-X280>
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fda8458b
  18. Aug 21, 2020
    • Paolo Bonzini's avatar
      trace: switch position of headers to what Meson requires · 243af022
      Paolo Bonzini authored
      
      Meson doesn't enjoy the same flexibility we have with Make in choosing
      the include path.  In particular the tracing headers are using
      $(build_root)/$(<D).
      
      In order to keep the include directives unchanged,
      the simplest solution is to generate headers with patterns like
      "trace/trace-audio.h" and place forwarding headers in the source tree
      such that for example "audio/trace.h" includes "trace/trace-audio.h".
      
      This patch is too ugly to be applied to the Makefiles now.  It's only
      a way to separate the changes to the tracing header files from the
      Meson rewrite of the tracing logic.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      243af022
  19. Jul 21, 2020
  20. May 06, 2020
  21. Apr 07, 2020
  22. Mar 17, 2020
  23. Mar 06, 2020
    • Kevin Wolf's avatar
      hmp: Fail gracefully if chardev is already in use · 8e9119a8
      Kevin Wolf authored
      
      Trying to attach a HMP monitor to a chardev that is already in use
      results in a crash because monitor_init_hmp() passes &error_abort to
      qemu_chr_fe_init():
      
      $ ./x86_64-softmmu/qemu-system-x86_64 --chardev stdio,id=foo --mon foo --mon foo
      QEMU 4.2.50 monitor - type 'help' for more information
      (qemu) Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:220:
      qemu-system-x86_64: --mon foo: Device 'foo' is in use
      Abgebrochen (Speicherabzug geschrieben)
      
      Fix this by allowing monitor_init_hmp() to return an error and passing
      any error in qemu_chr_fe_init() to its caller instead of aborting.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20200224143008.13362-19-kwolf@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      8e9119a8
Loading