Skip to content
Snippets Groups Projects
  1. Nov 24, 2023
    • Paolo Bonzini's avatar
      scripts: adjust url to Coverity tools · 81a541e9
      Paolo Bonzini authored
      
      The URL to the Coverity tools download has changed; the old one points
      to an obsolete version that is not supported anymore.  Adjust to point
      to the correct and supported tools.
      
      Suggested-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      81a541e9
    • Vladimir Sementsov-Ogievskiy's avatar
      coverity: physmem: use simple assertions instead of modelling · adff55b5
      Vladimir Sementsov-Ogievskiy authored
      
      Unfortunately Coverity doesn't follow the logic aroung "len" and "l"
      variables in stacks finishing with flatview_{read,write}_continue() and
      generate a lot of OVERRUN false-positives. When small buffer (2 or 4
      bytes) is passed to mem read/write path, Coverity assumes the worst
      case of sz=8 in stn_he_p()/ldn_he_p() (defined in
      include/qemu/bswap.h), and reports buffer overrun.
      
      To silence these false-positives we have model functions, which hide
      real logic from Coverity.
      
      However, it turned out that these new two assertions are enough to
      quiet Coverity.
      
      Assertions are better than hiding the logic, so let's drop the
      modelling and move to assertions for memory r/w call stacks.
      
      After patch, the sequence
      
       cov-make-library --output-file /tmp/master.xmldb \
          scripts/coverity-scan/model.c
       cov-build --dir ~/covtmp/master make -j9
       cov-analyze --user-model-file /tmp/master.xmldb \
          --dir ~/covtmp/master --all --strip-path "$(pwd)
       cov-format-errors --dir ~/covtmp/master \
          --html-output ~/covtmp/master_html_report
      
      Generate for me the same big set of CIDs excepept for 6 disappeared (so
      it becomes even better).
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-ID: <20231005140326.332830-1-vsementsov@yandex-team.ru>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      adff55b5
  2. Nov 21, 2023
    • Kevin Wolf's avatar
      block: Fix deadlocks in bdrv_graph_wrunlock() · 6bc0bcc8
      Kevin Wolf authored
      
      bdrv_graph_wrunlock() calls aio_poll(), which may run callbacks that
      have a nested event loop. Nested event loops can depend on other
      iothreads making progress, so in order to allow them to make progress it
      must not hold the AioContext lock of another thread while calling
      aio_poll().
      
      This introduces a @bs parameter to bdrv_graph_wrunlock() whose
      AioContext is temporarily dropped (which matches bdrv_graph_wrlock()),
      and a bdrv_graph_wrunlock_ctx() that can be used if the BlockDriverState
      doesn't necessarily exist any more when unlocking.
      
      This also requires a change to bdrv_schedule_unref(), which was relying
      on the incorrectly taken lock. It needs to take the lock itself now.
      While this is a separate bug, it can't be fixed a separate patch because
      otherwise the intermediate state would either deadlock or try to release
      a lock that we don't even hold.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-ID: <20231115172012.112727-3-kwolf@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      [kwolf: Fixed up bdrv_schedule_unref()]
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      6bc0bcc8
  3. Nov 13, 2023
  4. Nov 09, 2023
  5. Nov 08, 2023
  6. Nov 07, 2023
  7. Nov 06, 2023
    • Maciej S. Szmigiero's avatar
      Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) base · 0d9e8c0b
      Maciej S. Szmigiero authored
      
      This driver is like virtio-balloon on steroids: it allows both changing the
      guest memory allocation via ballooning and (in the next patch) inserting
      pieces of extra RAM into it on demand from a provided memory backend.
      
      The actual resizing is done via ballooning interface (for example, via
      the "balloon" HMP command).
      This includes resizing the guest past its boot size - that is, hot-adding
      additional memory in granularity limited only by the guest alignment
      requirements, as provided by the next patch.
      
      In contrast with ACPI DIMM hotplug where one can only request to unplug a
      whole DIMM stick this driver allows removing memory from guest in single
      page (4k) units via ballooning.
      
      After a VM reboot the guest is back to its original (boot) size.
      
      In the future, the guest boot memory size might be changed on reboot
      instead, taking into account the effective size that VM had before that
      reboot (much like Hyper-V does).
      
      For performance reasons, the guest-released memory is tracked in a few
      range trees, as a series of (start, count) ranges.
      Each time a new page range is inserted into such tree its neighbors are
      checked as candidates for possible merging with it.
      
      Besides performance reasons, the Dynamic Memory protocol itself uses page
      ranges as the data structure in its messages, so relevant pages need to be
      merged into such ranges anyway.
      
      One has to be careful when tracking the guest-released pages, since the
      guest can maliciously report returning pages outside its current address
      space, which later clash with the address range of newly added memory.
      Similarly, the guest can report freeing the same page twice.
      
      The above design results in much better ballooning performance than when
      using virtio-balloon with the same guest: 230 GB / minute with this driver
      versus 70 GB / minute with virtio-balloon.
      
      During a ballooning operation most of time is spent waiting for the guest
      to come up with newly freed page ranges, processing the received ranges on
      the host side (in QEMU and KVM) is nearly instantaneous.
      
      The unballoon operation is also pretty much instantaneous:
      thanks to the merging of the ballooned out page ranges 200 GB of memory can
      be returned to the guest in about 1 second.
      With virtio-balloon this operation takes about 2.5 minutes.
      
      These tests were done against a Windows Server 2019 guest running on a
      Xeon E5-2699, after dirtying the whole memory inside guest before each
      balloon operation.
      
      Using a range tree instead of a bitmap to track the removed memory also
      means that the solution scales well with the guest size: even a 1 TB range
      takes just a few bytes of such metadata.
      
      Since the required GTree operations aren't present in every Glib version
      a check for them was added to the meson build script, together with new
      "--enable-hv-balloon" and "--disable-hv-balloon" configure arguments.
      If these GTree operations are missing in the system's Glib version this
      driver will be skipped during QEMU build.
      
      An optional "status-report=on" device parameter requests memory status
      events from the guest (typically sent every second), which allow the host
      to learn both the guest memory available and the guest memory in use
      counts.
      
      Following commits will add support for their external emission as
      "HV_BALLOON_STATUS_REPORT" QMP events.
      
      The driver is named hv-balloon since the Linux kernel client driver for
      the Dynamic Memory Protocol is named as such and to follow the naming
      pattern established by the virtio-balloon driver.
      The whole protocol runs over Hyper-V VMBus.
      
      The driver was tested against Windows Server 2012 R2, Windows Server 2016
      and Windows Server 2019 guests and obeys the guest alignment requirements
      reported to the host via DM_CAPABILITIES_REPORT message.
      
      Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
      Signed-off-by: default avatarMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
      0d9e8c0b
  8. Oct 19, 2023
  9. Oct 18, 2023
  10. Oct 17, 2023
  11. Oct 16, 2023
  12. Oct 12, 2023
  13. Oct 11, 2023
  14. Oct 08, 2023
  15. Oct 04, 2023
  16. Oct 03, 2023
  17. Sep 29, 2023
    • Paolo Bonzini's avatar
      make-release: do not ship dtc sources · f0df613b
      Paolo Bonzini authored
      
      A new enough libfdt is included in all of Debian 11, Ubuntu 20.04
      and MSYS2.  It has also been included for several minor releases
      in Fedora and openSUSE Leap, as well as in CentOS.  Therefore
      there is no need anymore to ship the sources together with the QEMU
      tarballs.
      
      Keep the wrap file so that it can be used with --enable-download,
      but do not ship the sources anymore with either archive-source.sh
      or make-release.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f0df613b
  18. Sep 26, 2023
Loading