Skip to content
Snippets Groups Projects
  1. Apr 24, 2023
    • Juan Quintela's avatar
      migration: Create options.c · 1f0776f1
      Juan Quintela authored
      
      We move there all capabilities helpers from migration.c.
      
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      
      ---
      
      Following David advise:
      - looked through the history, capabilities are newer than 2012, so we
        can remove that bit of the header.
      - This part is posterior to Anthony.
        Original Author is Orit. Once there,
        I put myself.  Peter Xu also did quite a bit of work here.
        Anyone else wants/needs to be there?  I didn't search too hard
        because nobody asked before to be added.
      
      What do you think?
      1f0776f1
  2. Apr 20, 2023
  3. Apr 13, 2023
  4. Apr 12, 2023
    • Peter Xu's avatar
      migration: Fix potential race on postcopy_qemufile_src · 6621883f
      Peter Xu authored
      
      postcopy_qemufile_src object should be owned by one thread, either the main
      thread (e.g. when at the beginning, or at the end of migration), or by the
      return path thread (when during a preempt enabled postcopy migration).  If
      that's not the case the access to the object might be racy.
      
      postcopy_preempt_shutdown_file() can be potentially racy, because it's
      called at the end phase of migration on the main thread, however during
      which the return path thread hasn't yet been recycled; the recycle happens
      in await_return_path_close_on_source() which is after this point.
      
      It means, logically it's posslbe the main thread and the return path thread
      are both operating on the same qemufile.  While I don't think qemufile is
      thread safe at all.
      
      postcopy_preempt_shutdown_file() used to be needed because that's where we
      send EOS to dest so that dest can safely shutdown the preempt thread.
      
      To avoid the possible race, remove this only place that a race can happen.
      Instead we figure out another way to safely close the preempt thread on
      dest.
      
      The core idea during postcopy on deciding "when to stop" is that dest will
      send a postcopy SHUT message to src, telling src that all data is there.
      Hence to shut the dest preempt thread maybe better to do it directly on
      dest node.
      
      This patch proposed such a way that we change postcopy_prio_thread_created
      into PreemptThreadStatus, so that we kick the preempt thread on dest qemu
      by a sequence of:
      
        mis->preempt_thread_status = PREEMPT_THREAD_QUIT;
        qemu_file_shutdown(mis->postcopy_qemufile_dst);
      
      While here shutdown() is probably so far the easiest way to kick preempt
      thread from a blocked qemu_get_be64().  Then it reads preempt_thread_status
      to make sure it's not a network failure but a willingness to quit the
      thread.
      
      We could have avoided that extra status but just rely on migration status.
      The problem is postcopy_ram_incoming_cleanup() is just called early enough
      so we're still during POSTCOPY_ACTIVE no matter what.. So just make it
      simple to have the status introduced.
      
      One flag x-preempt-pre-7-2 is added to keep old pre-7.2 behaviors of
      postcopy preempt.
      
      Fixes: 93589827 ("migration: Send requested page directly in rp-return thread")
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      6621883f
    • Klaus Jensen's avatar
      hw/nvme: fix memory leak in nvme_dsm · 4b32319c
      Klaus Jensen authored
      
      The iocb (and the allocated memory to hold LBA ranges) leaks if reading
      the LBA ranges fails.
      
      Fix this by adding a free and an unref of the iocb.
      
      Reported-by: Coverity (CID 1508281)
      Fixes: d7d1474f ("hw/nvme: reimplement dsm to allow cancellation")
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarKlaus Jensen <k.jensen@samsung.com>
      4b32319c
    • Klaus Jensen's avatar
      hw/nvme: fix memory leak in fdp ruhid parsing · cb16e5c7
      Klaus Jensen authored
      
      Coverity reports a memory leak of memory when parsing ruhids at
      namespace initialization. Since this is just working memory, not needed
      beyond the scope of the functions, fix this by adding a g_autofree
      annotation.
      
      Reported-by: Coverity (CID 1507979)
      Fixes: 73064edf ("hw/nvme: flexible data placement emulation")
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarKlaus Jensen <k.jensen@samsung.com>
      cb16e5c7
  5. Apr 11, 2023
  6. Apr 05, 2023
    • Peter Maydell's avatar
      Revert "memory: Optimize replay of guest mapping" · b1ab8f9c
      Peter Maydell authored
      
      This reverts commit 6da24341
      ("memory: Optimize replay of guest mapping").
      
      This change breaks the mps3-an547 board under TCG (and
      probably other TCG boards using an IOMMU), which now
      assert:
      
      $ ./build/x86/qemu-system-arm --machine mps3-an547 -serial stdio
      -kernel /tmp/an547-mwe/build/test.elf
      qemu-system-arm: ../../softmmu/memory.c:1903:
      memory_region_register_iommu_notifier: Assertion `n->end <=
      memory_region_size(mr)' failed.
      
      This is because tcg_register_iommu_notifier() registers
      an IOMMU notifier which covers the entire address space,
      so the assertion added in this commit is not correct.
      
      For the 8.0 release, just revert this commit as it is
      only an optimization.
      
      Fixes: 6da24341 ("memory: Optimize replay of guest mapping")
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Message-id: 917c1c552b2d1b732f9a86c6a90684c3a5e4cada.1680640587.git.mst@redhat.com
      b1ab8f9c
  7. Apr 04, 2023
  8. Apr 03, 2023
  9. Mar 30, 2023
  10. Mar 28, 2023
Loading