1. 06 Mar, 2018 1 commit
  2. 19 Feb, 2018 1 commit
    • Marcel Apfelbaum's avatar
      mem: add share parameter to memory-backend-ram · 06329cce
      Marcel Apfelbaum authored
      Currently only file backed memory backend can
      be created with a "share" flag in order to allow
      sharing guest RAM with other processes in the host.
      
      Add the "share" flag also to RAM Memory Backend
      in order to allow remapping parts of the guest RAM
      to different host virtual addresses. This is needed
      by the RDMA devices in order to remap non-contiguous
      QEMU virtual addresses to a contiguous virtual address range.
      
      Moved the "share" flag to the Host Memory base class,
      modified phys_mem_alloc to include the new parameter
      and a new interface memory_region_init_ram_shared_nomigrate.
      
      There are no functional changes if the new flag is not used.
      Reviewed-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: 's avatarMarcel Apfelbaum <marcel@redhat.com>
      06329cce
  3. 13 Feb, 2018 3 commits
  4. 07 Feb, 2018 1 commit
    • Peter Xu's avatar
      memory: do explicit cleanup when remove listeners · d25836ca
      Peter Xu authored
      When unregister memory listeners, we should call, e.g.,
      region_del() (and possibly other undo operations) on every existing
      memory region sections there, otherwise we may leak resources that are
      held during the region_add(). This patch undo the stuff for the
      listeners, which emulates the case when the address space is set from
      current to an empty state.
      
      I found this problem when debugging a refcount leak issue that leads to
      a device unplug event lost (please see the "Bug:" line below).  In that
      case, the leakage of resource is the PCI BAR memory region refcount.
      And since memory regions are not keeping their own refcount but onto
      their owners, so the vfio-pci device's (who is the owner of the PCI BAR
      memory regions) refcount is leaked, and event missing.
      
      We had encountered similar issues before and fixed in other
      way (ee4c1128, "vhost: Release memory references on cleanup"). This
      patch can be seen as a more high-level fix of similar problems that are
      caused by the resource leaks from memory listeners. So now we can remove
      the explicit unref of memory regions since that'll be done altogether
      during unregistering of listeners now.
      
      Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1531393Signed-off-by: 's avatarPeter Xu <peterx@redhat.com>
      Message-Id: <20180122060244.29368-5-peterx@redhat.com>
      Reviewed-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      d25836ca
  5. 06 Feb, 2018 1 commit
  6. 05 Feb, 2018 1 commit
  7. 19 Jan, 2018 1 commit
    • Haozhong Zhang's avatar
      hostmem-file: add "align" option · 98376843
      Haozhong Zhang authored
      When mmap(2) the backend files, QEMU uses the host page size
      (getpagesize(2)) by default as the alignment of mapping address.
      However, some backends may require alignments different than the page
      size. For example, mmap a device DAX (e.g., /dev/dax0.0) on Linux
      kernel 4.13 to an address, which is 4K-aligned but not 2M-aligned,
      fails with a kernel message like
      
      [617494.969768] dax dax0.0: qemu-system-x86: dax_mmap: fail, unaligned vma (0x7fa37c579000 - 0x7fa43c579000, 0x1fffff)
      
      Because there is no common approach to get such alignment requirement,
      we add the 'align' option to 'memory-backend-file', so that users or
      management utils, which have enough knowledge about the backend, can
      specify a proper alignment via this option.
      Signed-off-by: 's avatarHaozhong Zhang <haozhong.zhang@intel.com>
      Message-Id: <20171211072806.2812-2-haozhong.zhang@intel.com>
      Reviewed-by: 's avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: 's avatarStefan Hajnoczi <stefanha@redhat.com>
      [ehabkost: fixed typo, fixed error_setg() format string]
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      98376843
  8. 18 Dec, 2017 1 commit
  9. 18 Oct, 2017 2 commits
  10. 12 Oct, 2017 1 commit
  11. 21 Sep, 2017 18 commits
  12. 19 Sep, 2017 1 commit
  13. 01 Aug, 2017 1 commit
    • Jay Zhou's avatar
      migration: optimize the downtime · 19310760
      Jay Zhou authored
      Qemu_savevm_state_cleanup takes about 300ms in my ram migration tests
      with a 8U24G vm(20G is really occupied), the main cost comes from
      KVM_SET_USER_MEMORY_REGION ioctl when mem.memory_size = 0 in
      kvm_set_user_memory_region. In kmod, the main cost is
      kvm_zap_obsolete_pages, which traverses the active_mmu_pages list to
      zap the unsync sptes.
      
      It can be optimized by delaying memory_global_dirty_log_stop to the next
      vm_start.
      
      Changes v2->v3:
       - NULL VMChangeStateHandler if it is deleted and protect the scenario
         of nested invocations of memory_global_dirty_log_start/stop [Paolo]
      
      Changes v1->v2:
       - create a VMChangeStateHandler in memory.c to reduce the coupling [Paolo]
      Signed-off-by: 's avatarJay Zhou <jianjay.zhou@huawei.com>
      Message-Id: <1501237733-2736-1-git-send-email-jianjay.zhou@huawei.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      19310760
  14. 14 Jul, 2017 5 commits
  15. 27 Jun, 2017 1 commit
  16. 15 Jun, 2017 1 commit