Skip to content
Snippets Groups Projects
  1. Dec 15, 2020
  2. Nov 16, 2020
    • David Hildenbrand's avatar
      util/vfio-helpers.c: Use ram_block_discard_disable() in qemu_vfio_open_pci() · b430b513
      David Hildenbrand authored
      
      Currently, when using "nvme://" for a block device, like
          -drive file=nvme://0000:01:00.0/1,if=none,id=drive0 \
          -device virtio-blk,drive=drive0 \
      
      VFIO may pin all guest memory, and discarding of RAM no longer works as
      expected. I was able to reproduce this easily with my
          01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd
                  NVMe SSD Controller SM981/PM981/PM983
      
      Similar to common VFIO, we have to disable it, making sure that:
      a) virtio-balloon won't discard any memory ("silently disabled")
      b) virtio-mem and nvme:// run mutually exclusive
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Wei Yang <richardw.yang@linux.intel.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
      Cc: Peter Xu <peterx@redhat.com>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20201116105947.9194-1-david@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b430b513
    • Alex Bennée's avatar
      stubs/xen-hw-stub: drop xenstore_store_pv_console_info stub · d67ef04c
      Alex Bennée authored
      
      We should never build something that calls this without having it.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20201110192316.26397-6-alex.bennee@linaro.org>
      d67ef04c
  3. Oct 23, 2020
    • Stefan Hajnoczi's avatar
      block: move block exports to libblockdev · cbc20bfb
      Stefan Hajnoczi authored
      
      Block exports are used by softmmu, qemu-storage-daemon, and qemu-nbd.
      They are not used by other programs and are not otherwise needed in
      libblock.
      
      Undo the recent move of blockdev-nbd.c from blockdev_ss into block_ss.
      Since bdrv_close_all() (libblock) calls blk_exp_close_all()
      (libblockdev) a stub function is required..
      
      Make qemu-nbd.c use signal handling utility functions instead of
      duplicating the code. This helps because os-posix.c is in libblockdev
      and it depends on a qemu_system_killed() symbol that qemu-nbd.c lacks.
      Once we use the signal handling utility functions we also end up
      providing the necessary symbol.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-id: 20200929125516.186715-4-stefanha@redhat.com
      [Fixed s/ndb/nbd/ typo in commit description as suggested by Eric Blake
      --Stefan]
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      cbc20bfb
  4. Oct 22, 2020
    • Claudio Fontana's avatar
      replay: do not build if TCG is not available · 9b1c9116
      Claudio Fontana authored
      
      this fixes non-TCG builds broken recently by replay reverse debugging.
      
      Stub the needed functions in stub/, splitting roughly between functions
      needed only by system emulation, by system emulation and tools,
      and by everyone.  This includes duplicating some code in replay/, and
      puts the logic for non-replay related events in the replay/ module (+
      the stubs), so this should be revisited in the future.
      
      Surprisingly, only _one_ qtest was affected by this, ide-test.c, which
      resulted in a buzz as the bh events were never delivered, and the bh
      never executed.
      
      Many other subsystems _should_ have been affected.
      
      This fixes the immediate issue, however a better way to group replay
      functionality to TCG-only code could be developed in the long term.
      
      Signed-off-by: default avatarClaudio Fontana <cfontana@suse.de>
      Message-Id: <20201013192123.22632-4-cfontana@suse.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9b1c9116
  5. Oct 09, 2020
  6. Oct 06, 2020
    • 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
    • Pavel Dovgalyuk's avatar
      migration: introduce icount field for snapshots · b39847a5
      Pavel Dovgalyuk authored
      
      Saving icount as a parameters of the snapshot allows navigation between
      them in the execution replay scenario.
      This information can be used for finding a specific snapshot for proceeding
      the recorded execution to the specific moment of the time.
      E.g., 'reverse step' action (introduced in one of the following patches)
      needs to load the nearest snapshot which is prior to the current moment
      of time.
      This patch also updates snapshot test which verifies qemu monitor output.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
      
      --
      
      v4 changes:
       - squashed format update with test output update
      v7 changes:
       - introduced the spaces between the fields in snapshot info output
       - updated the test to match new field widths
      Message-Id: <160174518865.12451.14327573383978752463.stgit@pasha-ThinkPad-X280>
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b39847a5
  7. Oct 05, 2020
  8. Sep 30, 2020
  9. Sep 29, 2020
  10. Sep 16, 2020
  11. Sep 07, 2020
    • Thomas Huth's avatar
      stubs: Move qemu_fd_register stub to util/main-loop.c · 8c278762
      Thomas Huth authored
      
      The linker of MinGW sometimes runs into the following problem:
      
      libqemuutil.a(util_main-loop.c.obj): In function `qemu_fd_register':
      /builds/huth/qemu/build/../util/main-loop.c:331: multiple definition of
       `qemu_fd_register'
      libqemuutil.a(stubs_fd-register.c.obj):/builds/huth/qemu/stubs/fd-register.c:5:
       first defined here
      collect2: error: ld returned 1 exit status
      /builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
       failed
      
      qemu_fd_register() is defined in util/main-loop.c for WIN32, so let's simply
      move the stub also there in the #else part of the corresponding #ifndef
      to fix this problem.
      
      Message-Id: <20200903054503.425435-1-thuth@redhat.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      8c278762
    • Thomas Huth's avatar
      stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub · b0476d66
      Thomas Huth authored
      
      When cross-compiling with MinGW, there are sometimes some weird linker
      errors like:
      
      ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
      /builds/huth/qemu/build/../util/main-loop.c:139: multiple definition of
       `qemu_notify_event'
      libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
       first defined here
      collect2: error: ld returned 1 exit status
      /builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
       failed
      
      It seems like it works better when the qemu_timer_notify_cb() stub (which
      calls qemu_notify_event()) is in a separate file - then we can also even
      remove the qemu_notify_event() stub now.
      
      This patch is based on ideas from the patch "stubs: Remove qemu_notify_event()"
      by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new modules" from
      Claudio Fontana.
      
      Message-Id: <20200902102433.304737-1-thuth@redhat.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      b0476d66
  12. Sep 01, 2020
  13. Aug 21, 2020
    • Paolo Bonzini's avatar
      libqemuutil, qapi, trace: convert to meson · a81df1b6
      Paolo Bonzini authored
      
      This shows how to do some "computations" in meson.build using its array
      and dictionary data structures, and also a basic usage of the sourceset
      module for conditional compilation.
      
      Notice the new "if have_system" part of util/meson.build, which fixes
      a bug in the old build system was buggy: util/dbus.c was built even for
      non-softmmu builds, but the dependency on -lgio was lost when the linking
      was done through libqemuutil.a.  Because all of its users required gio
      otherwise, the bug was hidden.  Meson instead propagates libqemuutil's
      dependencies down to its users, and shows the problem.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a81df1b6
  14. Jul 24, 2020
    • Markus Armbruster's avatar
      Revert "tpm: Clean up error reporting in tpm_init_tpmdev()" · d64072c0
      Markus Armbruster authored
      
      This reverts commit d10e05f1.
      
      We report some -tpmdev failures, but then continue as if all was fine.
      Reproducer:
      
          $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -chardev null,id=tpm0 -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
          qemu-system-x86_64: -tpmdev emulator,id=tpm0,chardev=chrtpm: tpm-emulator: tpm chardev 'chrtpm' not found.
          qemu-system-x86_64: -tpmdev emulator,id=tpm0,chardev=chrtpm: tpm-emulator: Could not cleanly shutdown the TPM: No such file or directory
          QEMU 5.0.90 monitor - type 'help' for more information
          (qemu) qemu-system-x86_64: -device tpm-tis,tpmdev=tpm0: Property 'tpm-tis.tpmdev' can't find value 'tpm0'
          $ echo $?
          1
      
      This is a regression caused by commit d10e05f1 "tpm: Clean up error
      reporting in tpm_init_tpmdev()".  It's incomplete: be->create(opts)
      continues to use error_report(), and we don't set an error when it
      fails.
      
      I figure converting the create() methods to Error would make some
      sense, but I'm not sure it's worth the effort right now.  Revert the
      broken commit instead, and add a comment to tpm_init_tpmdev().
      
      Straightforward conflict in tpm.c resolved.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
      Signed-off-by: default avatarStefan Berger <stefanb@linux.ibm.com>
      d64072c0
  15. Jul 07, 2020
  16. Jul 06, 2020
  17. Jun 24, 2020
  18. Jun 12, 2020
  19. Jun 10, 2020
  20. Jun 05, 2020
  21. May 19, 2020
  22. May 18, 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
    • Kevin Wolf's avatar
      qmp: Fail gracefully if chardev is already in use · f27a9bb3
      Kevin Wolf authored
      
      Trying to attach a QMP monitor to a chardev that is already in use
      results in a crash because monitor_init_qmp() passes &error_abort to
      qemu_chr_fe_init():
      
      $ ./x86_64-softmmu/qemu-system-x86_64 --chardev stdio,id=foo --mon foo,mode=control --mon foo,mode=control
      Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:220:
      qemu-system-x86_64: --mon foo,mode=control: Device 'foo' is in use
      Abgebrochen (Speicherabzug geschrieben)
      
      Fix this by allowing monitor_init_qmp() 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-18-kwolf@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      f27a9bb3
    • Kevin Wolf's avatar
      stubs: Update monitor stubs for qemu-storage-daemon · 6ede81d5
      Kevin Wolf authored
      
      Before we can add the monitor to qemu-storage-daemon, we need to add a
      stubs for monitor_fdsets_cleanup().
      
      We also need to make sure that stubs that are actually implemented in
      the monitor core aren't linked to qemu-storage-daemon so that we don't
      get linker errors because of duplicate symbols. This is achieved by
      moving the stubs in question to a new file stubs/monitor-core.c.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20200224143008.13362-15-kwolf@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      6ede81d5
    • Kevin Wolf's avatar
      stubs: Add arch_type · 5964ed56
      Kevin Wolf authored
      
      blockdev.c uses the arch_type constant, so before we can use the file in
      tools (i.e. outside of the system emulator), we need to add a stub for
      it. A new QEMU_ARCH_NONE is introduced for this case.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20200224143008.13362-3-kwolf@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      5964ed56
Loading