1. 08 7月, 2016 2 次提交
  2. 07 7月, 2016 3 次提交
  3. 06 7月, 2016 1 次提交
  4. 05 7月, 2016 5 次提交
    • C
      pci: Convert msi_init() to Error and fix callers to check it · 1108b2f8
      Cao jin 提交于
      msi_init() reports errors with error_report(), which is wrong
      when it's used in realize().
      
      Fix by converting it to Error.
      
      Fix its callers to handle failure instead of ignoring it.
      
      For those callers who don't handle the failure, it might happen:
      when user want msi on, but he doesn't get what he want because of
      msi_init fails silently.
      
      cc: Gerd Hoffmann <kraxel@redhat.com>
      cc: John Snow <jsnow@redhat.com>
      cc: Dmitry Fleytman <dmitry@daynix.com>
      cc: Jason Wang <jasowang@redhat.com>
      cc: Michael S. Tsirkin <mst@redhat.com>
      cc: Hannes Reinecke <hare@suse.de>
      cc: Paolo Bonzini <pbonzini@redhat.com>
      cc: Alex Williamson <alex.williamson@redhat.com>
      cc: Markus Armbruster <armbru@redhat.com>
      cc: Marcel Apfelbaum <marcel@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NCao jin <caoj.fnst@cn.fujitsu.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      1108b2f8
    • A
      spapr_pci/spapr_pci_vfio: Support Dynamic DMA Windows (DDW) · ae4de14c
      Alexey Kardashevskiy 提交于
      This adds support for Dynamic DMA Windows (DDW) option defined by
      the SPAPR specification which allows to have additional DMA window(s)
      
      The "ddw" property is enabled by default on a PHB but for compatibility
      the pseries-2.6 machine and older disable it.
      This also creates a single DMA window for the older machines to
      maintain backward migration.
      
      This implements DDW for PHB with emulated and VFIO devices. The host
      kernel support is required. The advertised IOMMU page sizes are 4K and
      64K; 16M pages are supported but not advertised by default, in order to
      enable them, the user has to specify "pgsz" property for PHB and
      enable huge pages for RAM.
      
      The existing linux guests try creating one additional huge DMA window
      with 64K or 16MB pages and map the entire guest RAM to. If succeeded,
      the guest switches to dma_direct_ops and never calls TCE hypercalls
      (H_PUT_TCE,...) again. This enables VFIO devices to use the entire RAM
      and not waste time on map/unmap later. This adds a "dma64_win_addr"
      property which is a bus address for the 64bit window and by default
      set to 0x800.0000.0000.0000 as this is what the modern POWER8 hardware
      uses and this allows having emulated and VFIO devices on the same bus.
      
      This adds 4 RTAS handlers:
      * ibm,query-pe-dma-window
      * ibm,create-pe-dma-window
      * ibm,remove-pe-dma-window
      * ibm,reset-pe-dma-window
      These are registered from type_init() callback.
      
      These RTAS handlers are implemented in a separate file to avoid polluting
      spapr_iommu.c with PCI.
      
      This changes sPAPRPHBState::dma_liobn to an array to allow 2 LIOBNs
      and updates all references to dma_liobn. However this does not add
      64bit LIOBN to the migration stream as in fact even 32bit LIOBN is
      rather pointless there (as it is a PHB property and the management
      software can/should pass LIOBNs via CLI) but we keep it for the backward
      migration support.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      ae4de14c
    • A
      vfio/spapr: Create DMA window dynamically (SPAPR IOMMU v2) · 2e4109de
      Alexey Kardashevskiy 提交于
      New VFIO_SPAPR_TCE_v2_IOMMU type supports dynamic DMA window management.
      This adds ability to VFIO common code to dynamically allocate/remove
      DMA windows in the host kernel when new VFIO container is added/removed.
      
      This adds a helper to vfio_listener_region_add which makes
      VFIO_IOMMU_SPAPR_TCE_CREATE ioctl and adds just created IOMMU into
      the host IOMMU list; the opposite action is taken in
      vfio_listener_region_del.
      
      When creating a new window, this uses heuristic to decide on the TCE table
      levels number.
      
      This should cause no guest visible change in behavior.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      [dwg: Added some casts to prevent printf() warnings on certain targets
       where the kernel headers' __u64 doesn't match uint64_t or PRIx64]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      2e4109de
    • A
      vfio: Add host side DMA window capabilities · f4ec5e26
      Alexey Kardashevskiy 提交于
      There are going to be multiple IOMMUs per a container. This moves
      the single host IOMMU parameter set to a list of VFIOHostDMAWindow.
      
      This should cause no behavioral change and will be used later by
      the SPAPR TCE IOMMU v2 which will also add a vfio_host_win_del() helper.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      f4ec5e26
    • A
      vfio: spapr: Add DMA memory preregistering (SPAPR IOMMU v2) · 318f67ce
      Alexey Kardashevskiy 提交于
      This makes use of the new "memory registering" feature. The idea is
      to provide the userspace ability to notify the host kernel about pages
      which are going to be used for DMA. Having this information, the host
      kernel can pin them all once per user process, do locked pages
      accounting (once) and not spent time on doing that in real time with
      possible failures which cannot be handled nicely in some cases.
      
      This adds a prereg memory listener which listens on address_space_memory
      and notifies a VFIO container about memory which needs to be
      pinned/unpinned. VFIO MMIO regions (i.e. "skip dump" regions) are skipped.
      
      The feature is only enabled for SPAPR IOMMU v2. The host kernel changes
      are required. Since v2 does not need/support VFIO_IOMMU_ENABLE, this does
      not call it when v2 is detected and enabled.
      
      This enforces guest RAM blocks to be host page size aligned; however
      this is not new as KVM already requires memory slots to be host page
      size aligned.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      [dwg: Fix compile error on 32-bit host]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      318f67ce
  5. 04 7月, 2016 12 次提交
  6. 01 7月, 2016 5 次提交
  7. 29 6月, 2016 12 次提交