1. 18 2月, 2015 6 次提交
  2. 13 2月, 2015 22 次提交
  3. 11 2月, 2015 7 次提交
    • P
      Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150210.0' into staging · 449008f8
      Peter Maydell 提交于
      RCU fixes and cleanup (Paolo Bonzini)
      Switch to v2 IOMMU interface (Alex Williamson)
      DEBUG build fix (Alexey Kardashevskiy)
      
      # gpg: Signature made Tue 10 Feb 2015 17:37:06 GMT using RSA key ID 3BB08B22
      # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex@shazbot.org>"
      # gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"
      
      * remotes/awilliam/tags/vfio-update-20150210.0:
        vfio: Fix debug message compile error
        vfio: Use vfio type1 v2 IOMMU interface
        vfio: unmap and free BAR data in instance_finalize
        vfio: free dynamically-allocated data in instance_finalize
        vfio: cleanup vfio_get_device error path, remove vfio_populate_device callback
        memory: unregister AddressSpace MemoryListener within BQL
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      449008f8
    • A
      vfio: Fix debug message compile error · bc5baffa
      Alexey Kardashevskiy 提交于
      This fixes a compiler error which occurs if DEBUG_VFIO is defined.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      bc5baffa
    • A
      vfio: Use vfio type1 v2 IOMMU interface · 2e6e697e
      Alex Williamson 提交于
      The difference between v1 and v2 is fairly subtle, simply more
      deterministic behavior for unmaps.  The v1 interface allows the user
      to attempt to unmap sub-regions of previous mappings, returning
      success with zero size if unable to comply.  This was a reflection of
      the underlying IOMMU API.  The v2 interface requires that the user
      may only unmap fully contained mappings, ie. an unmap cannot intersect
      or bisect a previous mapping, but may cover multiple mappings.  QEMU
      never made use of the sub-region v1 support anyway, so we can support
      either v1 or v2.  We'll favor v2 since it's newer.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      2e6e697e
    • P
      vfio: unmap and free BAR data in instance_finalize · ba5e6bfa
      Paolo Bonzini 提交于
      In the case of VFIO, the unrealize callback is too early to munmap the
      BARs.  The munmap must be delayed until memory accesses are complete.
      To do this, split vfio_unmap_bars in two.  The removal step, now called
      vfio_unregister_bars, remains in vfio_exitfn.  The reclamation step
      is vfio_unmap_bars and is moved to the instance_finalize callback.
      
      Similarly, quirk MemoryRegions have to be removed during
      vfio_unregister_bars, but freeing the data structure must be delayed
      to vfio_unmap_bars.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      ba5e6bfa
    • P
      vfio: free dynamically-allocated data in instance_finalize · 77a10d04
      Paolo Bonzini 提交于
      In order to enable out-of-BQL address space lookup, destruction of
      devices needs to be split in two phases.
      
      Unrealize is the first phase; once it complete no new accesses will
      be started, but there may still be pending memory accesses can still
      be completed.
      
      The second part is freeing the device, which only happens once all memory
      accesses are complete.  At this point the reference count has dropped to
      zero, an RCU grace period must have completed (because the RCU-protected
      FlatViews hold a reference to the device via memory_region_ref).  This is
      when instance_finalize is called.
      
      Freeing data belongs in an instance_finalize callback, because the
      dynamically allocated memory can still be used after unrealize by the
      pending memory accesses.
      
      This starts the process by creating an instance_finalize callback and
      freeing most of the dynamically-allocated data in instance_finalize.
      Because instance_finalize is also called on error paths or also when
      the device is actually not realized, the common code needs some changes
      to be ready for this.  The error path in vfio_initfn can be simplified too.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      77a10d04
    • P
      vfio: cleanup vfio_get_device error path, remove vfio_populate_device callback · 217e9fdc
      Paolo Bonzini 提交于
      Now that vfio_put_base_device is called unconditionally at instance_finalize
      time, it can be called twice if vfio_populate_device fails.  This works
      but it is slightly harder to follow.
      
      Change vfio_get_device to not touch the vbasedev struct until it will
      definitely succeed, moving the vfio_populate_device call back to vfio-pci.
      This way, vfio_put_base_device will only be called once.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      217e9fdc
    • P
      memory: unregister AddressSpace MemoryListener within BQL · 6e48e8f9
      Paolo Bonzini 提交于
      address_space_destroy_dispatch is called from an RCU callback and hence
      outside the iothread mutex (BQL).  However, after address_space_destroy
      no new accesses can hit the destroyed AddressSpace so it is not necessary
      to observe changes to the memory map.  Move the memory_listener_unregister
      call earlier, to make it thread-safe again.
      Reported-by: NAlex Williamson <alex.williamson@redhat.com>
      Fixes: 374f2981Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      6e48e8f9
  4. 10 2月, 2015 5 次提交
    • P
      Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-02-10' into staging · 5c697ae7
      Peter Maydell 提交于
      trivial patches for 2015-02-10
      
      # gpg: Signature made Tue 10 Feb 2015 07:27:11 GMT using RSA key ID A4C3D7DB
      # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@debian.org>"
      
      * remotes/mjt/tags/pull-trivial-patches-2015-02-10: (45 commits)
        virtio: Fix warning caused by missing 'static' attribute
        vga: Fix warning caused by missing 'static' attribute
        stubs: Fix warning caused by missing include statement
        spice: Add missing 'static' attribute
        serial: Fix warnings caused by missing 'static' attribute
        moxie: Fix warning caused by missing include statement
        migration: Fix warnings caused by missing 'static' attribute
        migration: Fix warning caused by missing declaration of vmstate_dummy
        disas/sh4: Fix warning caused by missing 'static' attribute
        translate-all: Use g_try_malloc() for dynamic translator buffer
        vnc: g_realloc() can't fail, bury dead error handling
        rdma: g_malloc0() can't fail, bury dead error handling
        kvm: g_malloc() can't fail, bury dead error handling
        rtl8139: g_malloc() can't fail, bury dead error handling
        onenand: g_malloc() can't fail, bury dead error handling
        Fix name error in migration stream analyzation script
        QJSON: fix typo in author's email address
        util/uri: URI member path can be null, compare more carfully
        util/uri: realloc2n() can't fail, drop dead error handling
        util/uri: uri_new() can't fail, drop dead error handling
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5c697ae7
    • S
      virtio: Fix warning caused by missing 'static' attribute · 43d73554
      Stefan Weil 提交于
      Warning from the Sparse static analysis tool:
      
      hw/char/virtio-serial-bus.c:31:3:
       warning: symbol 'vserdevices' was not declared. Should it be static?
      
      Cc: Amit Shah <amit.shah@redhat.com>
      Cc: Anthony Liguori <aliguori@amazon.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      43d73554
    • S
      vga: Fix warning caused by missing 'static' attribute · 73d22caf
      Stefan Weil 提交于
      Warning from the Sparse static analysis tool:
      
      hw/display/vga.c:2012:26: warning:
       symbol 'vmstate_vga_endian' was not declared. Should it be static?
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      73d22caf
    • S
      stubs: Fix warning caused by missing include statement · 2822c1b6
      Stefan Weil 提交于
      Warning from the Sparse static analysis tool:
      
      stubs/qtest.c:14:6:
       warning: symbol 'qtest_allowed' was not declared. Should it be static?
      
      Add the missing include statement which declares qtest_allowed.
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      2822c1b6
    • S
      spice: Add missing 'static' attribute · 51575c3f
      Stefan Weil 提交于
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      51575c3f