Skip to content
Snippets Groups Projects
  1. Sep 19, 2023
  2. Aug 29, 2023
  3. Jul 12, 2023
  4. Jun 23, 2023
  5. Jun 13, 2023
    • Steve Sistare's avatar
      exec/memory: Introduce RAM_NAMED_FILE flag · b0182e53
      Steve Sistare authored
      
      migrate_ignore_shared() is an optimization that avoids copying memory
      that is visible and can be mapped on the target.  However, a
      memory-backend-ram or a memory-backend-memfd block with the RAM_SHARED
      flag set is not migrated when migrate_ignore_shared() is true.  This is
      wrong, because the block has no named backing store, and its contents will
      be lost.  To fix, ignore shared memory iff it is a named file.  Define a
      new flag RAM_NAMED_FILE to distinguish this case.
      
      Signed-off-by: default avatarSteve Sistare <steven.sistare@oracle.com>
      Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
      Message-Id: <1686151116-253260-1-git-send-email-steven.sistare@oracle.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      b0182e53
  6. Jun 06, 2023
    • Paolo Bonzini's avatar
      atomics: eliminate mb_read/mb_set · 06831001
      Paolo Bonzini authored
      
      qatomic_mb_read and qatomic_mb_set were the very first atomic primitives
      introduced for QEMU; their semantics are unclear and they provide a false
      sense of safety.
      
      The last use of qatomic_mb_read() has been removed, so delete it.
      qatomic_mb_set() instead can survive as an optimized
      qatomic_set()+smp_mb(), similar to Linux's smp_store_mb(), but
      rename it to qatomic_set_mb() to match the order of the two
      operations.
      
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      06831001
  7. May 23, 2023
  8. May 15, 2023
  9. Mar 28, 2023
  10. Mar 20, 2023
  11. Mar 07, 2023
  12. Feb 28, 2023
    • Akihiko Odaki's avatar
      softmmu: Use memmove in flatview_write_continue · 4a73aee8
      Akihiko Odaki authored
      We found a case where the source passed to flatview_write_continue() may
      overlap with the destination when fuzzing igb, a new proposed network
      device with sanitizers.
      
      igb uses pci_dma_map() to get Tx packet, and pci_dma_write() to write Rx
      buffer. While pci_dma_write() is usually used to write data from
      memory not mapped to the guest, if igb is configured to perform
      loopback, the data will be sourced from the guest memory. The source and
      destination can overlap and the usage of memcpy() will be invalid in
      such a case.
      
      While we do not really have to deal with such an invalid request for
      igb, detecting the overlap in igb code beforehand requires complex code,
      and only covers this specific case. Instead, just replace memcpy() with
      memmove() to tolerate overlaps. Using memmove() will slightly damage the
      performance as it will need to check overlaps before using SIMD
      instructions for copying, but the cost should be negligible, considering
      the inherent complexity of flatview_write_continue().
      
      The test cases generated by the fuzzer is available at:
      https://patchew.org/QEMU/20230129053316.1071513-1-alxndr@bu.edu/
      
      
      
      The fixed test case is:
      fuzz/crash_47dfe62d9f911bf523ff48cd441b61c0013ed805
      
      Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@daynix.com>
      Acked-by: default avatarAlexander Bulekov <alxndr@bu.edu>
      Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20230131030155.18932-1-akihiko.odaki@daynix.com>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      4a73aee8
  13. Feb 27, 2023
  14. Jan 20, 2023
    • Markus Armbruster's avatar
      include/block: Untangle inclusion loops · e2c1c34f
      Markus Armbruster authored
      
      We have two inclusion loops:
      
             block/block.h
          -> block/block-global-state.h
          -> block/block-common.h
          -> block/blockjob.h
          -> block/block.h
      
             block/block.h
          -> block/block-io.h
          -> block/block-common.h
          -> block/blockjob.h
          -> block/block.h
      
      I believe these go back to Emanuele's reorganization of the block API,
      merged a few months ago in commit d7e2fe4a.
      
      Fortunately, breaking them is merely a matter of deleting unnecessary
      includes from headers, and adding them back in places where they are
      now missing.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20221221133551.3967339-2-armbru@redhat.com>
      e2c1c34f
  15. Jan 18, 2023
    • Philippe Mathieu-Daudé's avatar
      bulk: Rename TARGET_FMT_plx -> HWADDR_FMT_plx · 883f2c59
      Philippe Mathieu-Daudé authored
      
      The 'hwaddr' type is defined in "exec/hwaddr.h" as:
      
          hwaddr is the type of a physical address
         (its size can be different from 'target_ulong').
      
      All definitions use the 'HWADDR_' prefix, except TARGET_FMT_plx:
      
       $ fgrep define include/exec/hwaddr.h
       #define HWADDR_H
       #define HWADDR_BITS 64
       #define HWADDR_MAX UINT64_MAX
       #define TARGET_FMT_plx "%016" PRIx64
               ^^^^^^
       #define HWADDR_PRId PRId64
       #define HWADDR_PRIi PRIi64
       #define HWADDR_PRIo PRIo64
       #define HWADDR_PRIu PRIu64
       #define HWADDR_PRIx PRIx64
       #define HWADDR_PRIX PRIX64
      
      Since hwaddr's size can be *different* from target_ulong, it is
      very confusing to read one of its format using the 'TARGET_FMT_'
      prefix, normally used for the target_long / target_ulong types:
      
      $ fgrep TARGET_FMT_ include/exec/cpu-defs.h
       #define TARGET_FMT_lx "%08x"
       #define TARGET_FMT_ld "%d"
       #define TARGET_FMT_lu "%u"
       #define TARGET_FMT_lx "%016" PRIx64
       #define TARGET_FMT_ld "%" PRId64
       #define TARGET_FMT_lu "%" PRIu64
      
      Apparently this format was missed during commit a8170e5e
      ("Rename target_phys_addr_t to hwaddr"), so complete it by
      doing a bulk-rename with:
      
       $ sed -i -e s/TARGET_FMT_plx/HWADDR_FMT_plx/g $(git grep -l TARGET_FMT_plx)
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Message-Id: <20230110212947.34557-1-philmd@linaro.org>
      [thuth: Fix some warnings from checkpatch.pl along the way]
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      883f2c59
  16. Dec 14, 2022
    • Markus Armbruster's avatar
      cleanup: Tweak and re-run return_directly.cocci · 66997c42
      Markus Armbruster authored
      
      Tweak the semantic patch to drop redundant parenthesis around the
      return expression.
      
      Coccinelle drops a comment in hw/rdma/vmw/pvrdma_cmd.c; restored
      manually.
      
      Coccinelle messes up vmdk_co_create(), not sure why.  Change dropped,
      will be done manually in the next commit.
      
      Line breaks in target/avr/cpu.h and hw/rdma/vmw/pvrdma_cmd.c tidied up
      manually.
      
      Whitespace in tools/virtiofsd/fuse_lowlevel.c tidied up manually.
      
      checkpatch.pl complains "return of an errno should typically be -ve"
      two times for hw/9pfs/9p-synth.c.  Preexisting, the patch merely makes
      it visible to checkpatch.pl.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20221122134917.1217307-2-armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Acked-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      66997c42
  17. Nov 08, 2022
    • Zhenzhong Duan's avatar
      memory: Fix wrong end address dump · f9c307c3
      Zhenzhong Duan authored
      
      The end address of memory region section isn't correctly calculated
      which leads to overflowed mtree dump:
      
        Dispatch
          Physical sections
            ......
            #70 @0000000000002000..0000000000011fff io [ROOT]
            #71 @0000000000005000..0000000000005fff (noname)
            #72 @0000000000005000..0000000000014fff io [ROOT]
            #73 @0000000000005658..0000000000005658 vmport
            #74 @0000000000005659..0000000000015658 io [ROOT]
            #75 @0000000000006000..0000000000015fff io [ROOT]
      
      After fix:
            #70 @0000000000002000..0000000000004fff io [ROOT]
            #71 @0000000000005000..0000000000005fff (noname)
            #72 @0000000000005000..0000000000005657 io [ROOT]
            #73 @0000000000005658..0000000000005658 vmport
            #74 @0000000000005659..0000000000005fff io [ROOT]
            #75 @0000000000006000..000000000000ffff io [ROOT]
      
      Fixes: 5e8fd947 ("memory: Rework "info mtree" to print flat views and dispatch trees")
      Signed-off-by: default avatarZhenzhong Duan <zhenzhong.duan@intel.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Message-Id: <20220622095912.3430583-1-zhenzhong.duan@intel.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      f9c307c3
  18. Oct 26, 2022
  19. Sep 06, 2022
  20. Aug 26, 2022
  21. Jun 21, 2022
  22. Jun 15, 2022
  23. Apr 06, 2022
  24. Mar 21, 2022
  25. Mar 07, 2022
  26. Mar 06, 2022
  27. Feb 21, 2022
  28. Jan 20, 2022
  29. Nov 29, 2021
  30. Nov 02, 2021
  31. Oct 29, 2021
Loading