1. 16 1月, 2020 1 次提交
  2. 19 12月, 2019 1 次提交
  3. 18 12月, 2019 2 次提交
  4. 16 12月, 2019 1 次提交
  5. 28 10月, 2019 2 次提交
  6. 26 10月, 2019 1 次提交
    • W
      core: replace getpagesize() with qemu_real_host_page_size · 038adc2f
      Wei Yang 提交于
      There are three page size in qemu:
      
        real host page size
        host page size
        target page size
      
      All of them have dedicate variable to represent. For the last two, we
      use the same form in the whole qemu project, while for the first one we
      use two forms: qemu_real_host_page_size and getpagesize().
      
      qemu_real_host_page_size is defined to be a replacement of
      getpagesize(), so let it serve the role.
      
      [Note] Not fully tested for some arch or device.
      Signed-off-by: NWei Yang <richardw.yang@linux.intel.com>
      Message-Id: <20191013021145.16011-3-richardw.yang@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      038adc2f
  7. 11 10月, 2019 1 次提交
  8. 05 10月, 2019 1 次提交
    • E
      memory: allow memory_region_register_iommu_notifier() to fail · 549d4005
      Eric Auger 提交于
      Currently, when a notifier is attempted to be registered and its
      flags are not supported (especially the MAP one) by the IOMMU MR,
      we generally abruptly exit in the IOMMU code. The failure could be
      handled more nicely in the caller and especially in the VFIO code.
      
      So let's allow memory_region_register_iommu_notifier() to fail as
      well as notify_flag_changed() callback.
      
      All sites implementing the callback are updated. This patch does
      not yet remove the exit(1) in the amd_iommu code.
      
      in SMMUv3 we turn the warning message into an error message saying
      that the assigned device would not work properly.
      Signed-off-by: NEric Auger <eric.auger@redhat.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      549d4005
  9. 03 10月, 2019 1 次提交
  10. 26 9月, 2019 7 次提交
  11. 16 9月, 2019 6 次提交
  12. 03 9月, 2019 9 次提交
  13. 21 8月, 2019 1 次提交
  14. 20 8月, 2019 1 次提交
    • P
      memory: fix race between TCG and accesses to dirty bitmap · 9458a9a1
      Paolo Bonzini 提交于
      There is a race between TCG and accesses to the dirty log:
      
            vCPU thread                  reader thread
            -----------------------      -----------------------
            TLB check -> slow path
              notdirty_mem_write
                write to RAM
                set dirty flag
                                         clear dirty flag
            TLB check -> fast path
                                         read memory
              write to RAM
      
      Fortunately, in order to fix it, no change is required to the
      vCPU thread.  However, the reader thread must delay the read after
      the vCPU thread has finished the write.  This can be approximated
      conservatively by run_on_cpu, which waits for the end of the current
      translation block.
      
      A similar technique is used by KVM, which has to do a synchronous TLB
      flush after doing a test-and-clear of the dirty-page flags.
      Reported-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9458a9a1
  15. 16 8月, 2019 2 次提交
  16. 15 7月, 2019 2 次提交
    • P
      memory: Introduce memory listener hook log_clear() · 077874e0
      Peter Xu 提交于
      Introduce a new memory region listener hook log_clear() to allow the
      listeners to hook onto the points where the dirty bitmap is cleared by
      the bitmap users.
      
      Previously log_sync() contains two operations:
      
        - dirty bitmap collection, and,
        - dirty bitmap clear on remote site.
      
      Let's take KVM as example - log_sync() for KVM will first copy the
      kernel dirty bitmap to userspace, and at the same time we'll clear the
      dirty bitmap there along with re-protecting all the guest pages again.
      
      We add this new log_clear() interface only to split the old log_sync()
      into two separated procedures:
      
        - use log_sync() to collect the collection only, and,
        - use log_clear() to clear the remote dirty bitmap.
      
      With the new interface, the memory listener users will still be able
      to decide how to implement the log synchronization procedure, e.g.,
      they can still only provide log_sync() method only and put all the two
      procedures within log_sync() (that's how the old KVM works before
      KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is introduced).  However with this
      new interface the memory listener users will start to have a chance to
      postpone the log clear operation explicitly if the module supports.
      That can really benefit users like KVM at least for host kernels that
      support KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2.
      
      There are three places that can clear dirty bits in any one of the
      dirty bitmap in the ram_list.dirty_memory[3] array:
      
              cpu_physical_memory_snapshot_and_clear_dirty
              cpu_physical_memory_test_and_clear_dirty
              cpu_physical_memory_sync_dirty_bitmap
      
      Currently we hook directly into each of the functions to notify about
      the log_clear().
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20190603065056.25211-7-peterx@redhat.com>
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      077874e0
    • P
      memory: Pass mr into snapshot_and_clear_dirty · 5dea4079
      Peter Xu 提交于
      Also we change the 2nd parameter of it to be the relative offset
      within the memory region. This is to be used in follow up patches.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Message-Id: <20190603065056.25211-6-peterx@redhat.com>
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      5dea4079
  17. 06 7月, 2019 1 次提交