1. 24 10月, 2016 1 次提交
  2. 27 9月, 2016 3 次提交
    • P
      migration: sync all address spaces · 9c1f8f44
      Paolo Bonzini 提交于
      Migrating a VM during reboot sometimes results in differences
      between the source and destination in the SMRAM area.
      
      This is because migration_bitmap_sync() only fetches from KVM
      the dirty log of address_space_memory.  SMRAM memory slots
      are ignored and the modifications to SMRAM are not sent to the
      destination.
      Reported-by: NHe Rongguang <herongguang.he@huawei.com>
      Reviewed-by: NHe Rongguang <herongguang.he@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9c1f8f44
    • P
      memory: introduce IOMMUOps.notify_flag_changed · 5bf3d319
      Peter Xu 提交于
      The new interface can be used to replace the old notify_started() and
      notify_stopped(). Meanwhile it provides explicit flags so that IOMMUs
      can know what kind of notifications it is requested for.
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <1474606948-14391-3-git-send-email-peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5bf3d319
    • P
      memory: introduce IOMMUNotifier and its caps · cdb30812
      Peter Xu 提交于
      IOMMU Notifier list is used for notifying IO address mapping changes.
      Currently VFIO is the only user.
      
      However it is possible that future consumer like vhost would like to
      only listen to part of its notifications (e.g., cache invalidations).
      
      This patch introduced IOMMUNotifier and IOMMUNotfierFlag bits for a
      finer grained control of it.
      
      IOMMUNotifier contains a bitfield for the notify consumer describing
      what kind of notification it is interested in. Currently two kinds of
      notifications are defined:
      
      - IOMMU_NOTIFIER_MAP:    for newly mapped entries (additions)
      - IOMMU_NOTIFIER_UNMAP:  for entries to be removed (cache invalidates)
      
      When registering the IOMMU notifier, we need to specify one or multiple
      types of messages to listen to.
      
      When notifications are triggered, its type will be checked against the
      notifier's type bits, and only notifiers with registered bits will be
      notified.
      
      (For any IOMMU implementation, an in-place mapping change should be
       notified with an UNMAP followed by a MAP.)
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <1474606948-14391-2-git-send-email-peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      cdb30812
  3. 04 7月, 2016 2 次提交
    • P
      memory: Assert that memory_region_init_rom_device() ops aren't NULL · 39e0b03d
      Peter Maydell 提交于
      It doesn't make sense to pass a NULL ops argument to
      memory_region_init_rom_device(), because the effect will
      be that if the guest tries to write to the memory region
      then QEMU will segfault. Catch the bug earlier by sanity
      checking the arguments to this function, and remove the
      misleading documentation that suggests that passing NULL
      might be sensible.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1467122287-24974-4-git-send-email-peter.maydell@linaro.org
      39e0b03d
    • P
      memory: Provide memory_region_init_rom() · a1777f7f
      Peter Maydell 提交于
      Provide a new helper function memory_region_init_rom() for memory
      regions which are read-only (and unlike those created by
      memory_region_init_rom_device() don't have special behaviour
      for writes). This has the same behaviour as calling
      memory_region_init_ram() and then memory_region_set_readonly()
      (which is what we do today in boards with pure ROMs) but is a
      more easily discoverable API for the purpose.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1467122287-24974-2-git-send-email-peter.maydell@linaro.org
      a1777f7f
  4. 01 7月, 2016 1 次提交
  5. 22 6月, 2016 1 次提交
  6. 29 5月, 2016 3 次提交
  7. 23 5月, 2016 1 次提交
  8. 19 5月, 2016 1 次提交
  9. 23 3月, 2016 1 次提交
  10. 07 3月, 2016 2 次提交
  11. 25 2月, 2016 3 次提交
  12. 23 2月, 2016 1 次提交
    • P
      include: Clean up includes · 90ce6e26
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      
      NB: If this commit breaks compilation for your out-of-tree
      patchseries or fork, then you need to make sure you add
      #include "qemu/osdep.h" to any new .c files that you have.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      90ce6e26
  13. 21 1月, 2016 1 次提交
    • P
      memory: Add address_space_init_shareable() · f0c02d15
      Peter Crosthwaite 提交于
      This will either create a new AS or return a pointer to an
      already existing equivalent one, if we have already created
      an AS for the specified root memory region.
      
      The motivation is to reuse address spaces as much as possible.
      It's going to be quite common that bus masters out in device land
      have pointers to the same memory region for their mastering yet
      each will need to create its own address space. Let the memory
      API implement sharing for them.
      
      Aside from the perf optimisations, this should reduce the amount
      of redundant output on info mtree as well.
      
      Thee returned value will be malloced, but the malloc will be
      automatically freed when the AS runs out of refs.
      Signed-off-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      [PMM: dropped check for NULL root as unused; added doc-comment;
       squashed Peter C's reference-counting patch into this one;
       don't compare name string when deciding if we can share ASes;
       read as->malloced before the unref of as->root to avoid possible
       read-after-free if as->root was the owner of as]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Acked-by: NEdgar E. Iglesias <edgar.iglesias@xilinx.com>
      f0c02d15
  14. 18 12月, 2015 6 次提交
  15. 06 10月, 2015 1 次提交
    • D
      memory: Allow replay of IOMMU mapping notifications · a788f227
      David Gibson 提交于
      When we have guest visible IOMMUs, we allow notifiers to be registered
      which will be informed of all changes to IOMMU mappings.  This is used by
      vfio to keep the host IOMMU mappings in sync with guest IOMMU mappings.
      
      However, unlike with a memory region listener, an iommu notifier won't be
      told about any mappings which already exist in the (guest) IOMMU at the
      time it is registered.  This can cause problems if hotplugging a VFIO
      device onto a guest bus which had existing guest IOMMU mappings, but didn't
      previously have an VFIO devices (and hence no host IOMMU mappings).
      
      This adds a memory_region_iommu_replay() function to handle this case.  It
      replays any existing mappings in an IOMMU memory region to a specified
      notifier.  Because the IOMMU memory region doesn't internally remember the
      granularity of the guest IOMMU it has a small hack where the caller must
      specify a granularity at which to replay mappings.
      
      If there are finer mappings in the guest IOMMU these will be reported in
      the iotlb structures passed to the notifier which it must handle (probably
      causing it to flag an error).  This isn't new - the VFIO iommu notifier
      must already handle notifications about guest IOMMU mappings too short
      for it to represent in the host IOMMU.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NLaurent Vivier <lvivier@redhat.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      a788f227
  16. 11 9月, 2015 2 次提交
  17. 13 8月, 2015 1 次提交
  18. 24 7月, 2015 1 次提交
  19. 06 7月, 2015 1 次提交
    • P
      Stop including qemu-common.h in memory.h · fba0a593
      Peter Maydell 提交于
      Including qemu-common.h from other header files is generally a bad
      idea, because it means it's very easy to end up with a circular
      dependency. For instance, if we wanted to include memory.h from
      qom/cpu.h we'd end up with this loop:
       memory.h -> qemu-common.h -> cpu.h -> cpu-qom.h -> qom/cpu.h -> memory.h
      
      Remove the include from memory.h. This requires us to fix up a few
      other files which were inadvertently getting declarations indirectly
      through memory.h.
      
      The biggest change is splitting the fprintf_function typedef out
      into its own header so other headers can get at it without having
      to include qemu-common.h.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <1435933104-15216-1-git-send-email-peter.maydell@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fba0a593
  20. 01 7月, 2015 1 次提交
  21. 05 6月, 2015 4 次提交
  22. 30 4月, 2015 1 次提交
  23. 28 4月, 2015 1 次提交