Skip to content
Snippets Groups Projects
  1. May 08, 2018
    • Paolo Bonzini's avatar
      exec: reintroduce MemoryRegion caching · 48564041
      Paolo Bonzini authored
      
      MemoryRegionCache was reverted to "normal" address_space_* operations
      for 2.9, due to lack of support for IOMMUs.  Reinstate the
      optimizations, caching only the IOMMU translation at address_cache_init
      but not the IOMMU lookup and target AddressSpace translation are not
      cached; now that MemoryRegionCache supports IOMMUs, it becomes more widely
      applicable too.
      
      The inlined fast path is defined in memory_ldst_cached.inc.h, while the
      slow path uses memory_ldst.inc.c as before.  The smaller fast path causes
      a little code size reduction in MemoryRegionCache users:
      
          hw/virtio/virtio.o text size before: 32373
          hw/virtio/virtio.o text size after: 31941
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      48564041
  2. Mar 06, 2018
  3. Feb 19, 2018
    • 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: default avatarEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: default avatarMarcel Apfelbaum <marcel@redhat.com>
      06329cce
  4. Feb 13, 2018
  5. Feb 07, 2018
    • 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=1531393
      
      
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Message-Id: <20180122060244.29368-5-peterx@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d25836ca
  6. Feb 06, 2018
  7. Feb 05, 2018
  8. Jan 19, 2018
    • 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: default avatarHaozhong Zhang <haozhong.zhang@intel.com>
      Message-Id: <20171211072806.2812-2-haozhong.zhang@intel.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      [ehabkost: fixed typo, fixed error_setg() format string]
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      98376843
  9. Dec 18, 2017
  10. Oct 18, 2017
  11. Oct 12, 2017
  12. Sep 21, 2017
  13. Sep 19, 2017
  14. Aug 01, 2017
    • 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: default avatarJay Zhou <jianjay.zhou@huawei.com>
      Message-Id: <1501237733-2736-1-git-send-email-jianjay.zhou@huawei.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      19310760
  15. Jul 14, 2017
  16. Jun 27, 2017
Loading