1. 31 3月, 2015 3 次提交
  2. 04 2月, 2015 1 次提交
  3. 26 1月, 2015 1 次提交
  4. 19 1月, 2015 2 次提交
  5. 02 12月, 2014 2 次提交
  6. 04 11月, 2014 3 次提交
    • H
      iommu: Improve error handling when setting bus iommu · d7da6bdc
      Heiko Stübner 提交于
      When some part of bus_set_iommu fails it should undo any made changes
      and not simply leave everything as is.
      
      This includes unregistering the bus notifier in iommu_bus_init when
      add_iommu_group fails and also setting the bus->iommu_ops back to NULL.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      d7da6bdc
    • J
      iommu: Do more input validation in iommu_map_sg() · 38ec010d
      Joerg Roedel 提交于
      The IOMMU-API works on page boundarys, unlike the DMA-API
      which can work with sub-page buffers. The sg->offset
      field does not make sense on the IOMMU level, so force it to
      be 0. Do some error-path consolidation while at it.
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      38ec010d
    • O
      iommu: Add iommu_map_sg() function · 315786eb
      Olav Haugan 提交于
      Mapping and unmapping are more often than not in the critical path.
      map_sg allows IOMMU driver implementations to optimize the process
      of mapping buffers into the IOMMU page tables.
      
      Instead of mapping a buffer one page at a time and requiring potentially
      expensive TLB operations for each page, this function allows the driver
      to map all pages in one go and defer TLB maintenance until after all
      pages have been mapped.
      
      Additionally, the mapping operation would be faster in general since
      clients does not have to keep calling map API over and over again for
      each physically contiguous chunk of memory that needs to be mapped to a
      virtually contiguous region.
      Signed-off-by: NOlav Haugan <ohaugan@codeaurora.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      315786eb
  7. 25 9月, 2014 5 次提交
    • M
      iommu: Fix bus notifier breakage · fb3e3065
      Mark Salter 提交于
      iommu_bus_init() registers a bus notifier on the given bus by using
      a statically defined notifier block:
      
        static struct notifier_block iommu_bus_nb = {
                .notifier_call = iommu_bus_notifier,
        };
      
      This same notifier block is used for all busses. This causes a
      problem for notifiers registered after iommu has registered this
      callback on multiple busses. The problem is that a subsequent
      notifier being registered on a bus which has this iommu notifier
      will also get linked in to the notifier list of all other busses
      which have this iommu notifier.
      
      This patch fixes this by allocating the notifier_block at runtime.
      Some error checking is also added to catch any allocation failure
      or notifier registration error.
      Signed-off-by: NMark Salter <msalter@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      fb3e3065
    • A
      iommu: Rework iommu_group_get_for_pci_dev() · f096c061
      Alex Williamson 提交于
      It turns out that our assumption that aliases are always to the same
      slot isn't true.  One particular platform reports an IVRS alias of the
      SATA controller (00:11.0) for the legacy IDE controller (00:14.1).
      When we hit this, we attempt to use a single IOMMU group for
      everything on the same bus, which in this case is the root complex.
      We already have multiple groups defined for the root complex by this
      point, resulting in multiple WARN_ON hits.
      
      This patch makes these sorts of aliases work again with IOMMU groups
      by reworking how we search through the PCI address space to find
      existing groups.  This should also now handle looped dependencies and
      all sorts of crazy inter-dependencies that we'll likely never see.
      
      The recursion used here should never be very deep.  It's unlikely to
      have individual aliases and only theoretical that we'd ever see a
      chain where one alias causes us to search through to yet another
      alias.  We're also only dealing with PCIe device on a single bus,
      which means we'll typically only see multiple slots in use on the root
      complex.  Loops are also a theoretically possibility, which I've
      tested using fake DMA alias quirks and prevent from causing problems
      using a bitmap of the devfn space that's been visited.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Cc: stable@vger.kernel.org # 3.17
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      f096c061
    • J
      iommu: Remove iommu_domain_has_cap() API function · 24278a24
      Joerg Roedel 提交于
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      24278a24
    • J
      iommu: Introduce iommu_capable API function · 3c0e0ca0
      Joerg Roedel 提交于
      This function will replace the current iommu_domain_has_cap
      function and clean up the interface while at it.
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      3c0e0ca0
    • J
      iommu: Convert iommu-caps from define to enum · 1aed0748
      Joerg Roedel 提交于
      Allow compile-time type-checking.
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      1aed0748
  8. 26 8月, 2014 1 次提交
  9. 19 8月, 2014 1 次提交
  10. 07 7月, 2014 1 次提交
  11. 04 7月, 2014 1 次提交
  12. 24 9月, 2013 8 次提交
    • F
      iommu: No need to pass '0x' when '%pa' is used · abedb049
      Fabio Estevam 提交于
      Commit 6197ca82 (iommu: Use %pa and %zx instead of casting) introduced the
      usage of '%pa', but still kept the '0x', which leads to printing '0x0x'.
      
      Remove the '0x' when '%pa' is used.
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      abedb049
    • S
      iommu: Change iommu driver to call unmap trace event · 3a50639c
      Shuah Khan 提交于
      Change iommu driver to call unmap trace event. This iommu_map_unmap class
      event can be enabled to trigger when iommu unmap iommu ops is called. Trace
      information includes iova, physical address (map event only), and size.
      
      Testing:
      Added trace calls to iommu_prepare_identity_map() for testing some of the
      conditions that are hard to trigger. Here is the trace from the testing:
      
             swapper/0-1     [003] ....     1.854102: unmap: IOMMU: iova=0x00000000cb800000 size=0x400
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      3a50639c
    • S
      iommu: Change iommu driver to call map trace event · e0be7c86
      Shuah Khan 提交于
      Change iommu driver to call map trace event. This iommu_map_unmap class event
      can be enabled to trigger when iommu map iommu ops is called. Trace information
      includes iova, physical address (map event only), and size.
      
      Testing:
      Added trace calls to iommu_prepare_identity_map() for testing some of the
      conditions that are hard to trigger. Here is the trace from the testing:
      
             swapper/0-1     [003] ....     1.854102: map: IOMMU: iova=0x00000000cb800000 paddr=0x00000000cf9fffff size=0x400
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      e0be7c86
    • S
      iommu: Change iommu driver to call detach_device_to_domain trace event · 69980630
      Shuah Khan 提交于
      Change iommu driver to call detach_device_to_domain trace event. This
      iommu_device class event can be enabled to trigger when devices are detached
      from a domain. Trace information includes device name.
      
      Testing:
      Added trace calls to iommu_prepare_identity_map() for testing some of the
      conditions that are hard to trigger. Here is the trace from the testing:
      
             swapper/0-1     [003] ....     1.854102: detach_device_from_domain: IOMMU: device=0000:00:02.0
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      69980630
    • S
      iommu: Change iommu driver to call attach_device_to_domain trace event · b54db778
      Shuah Khan 提交于
      Change iommu driver to call attach_device_to_domain trace event. This
      iommu_device class event can be enabled to trigger when devices are attached
      to a domain. Trace information includes device name.
      
      Testing:
      Added trace calls to iommu_prepare_identity_map() for testing some of the
      conditions that are hard to trigger. Here is the trace from the testing:
      
            swapper/0-1     [003] ....     1.854102: attach_device_to_domain: IOMMU: device=0000:00:02.0
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      b54db778
    • S
      iommu: Change iommu driver to call remove_device_to_group trace event · 2e757086
      Shuah Khan 提交于
      Change iommu driver to call remove_device_to_group trace event. This
      iommu_group class event can be enabled to trigger when devices get
      removed from an iommu group. Trace information includes iommu group id and
      device name.
      
      Testing:
      Added trace calls to iommu_prepare_identity_map() for testing some of the
      conditions that are hard to trigger. Here is the trace from the testing:
      
             swapper/0-1     [003] ....     1.854101: remove_device_from_group: IOMMU: groupID=0 device=0000:00:02.0
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      2e757086
    • S
      iommu: Change iommu driver to call add_device_to_group trace event · d1cf7e82
      Shuah Khan 提交于
      Change iommu driver to call add_device_to_group trace event. This iommu_group
      class event can be enabled to trigger when devices get added to an iommu group.
      Trace information includes iommu group id and device name.
      
      Testing:
      The following is trace is generated when intel-iommu driver adds devices to
      to iommu groups during boot-time during its initialization:
      
             swapper/0-1     [003] ....     1.854793: add_device_to_group: IOMMU: groupID=0 device=0000:00:00.0
             swapper/0-1     [003] ....     1.854797: add_device_to_group: IOMMU: groupID=1 device=0000:00:02.0
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      d1cf7e82
    • S
      iommu: Add event tracing feature to iommu · 7f6db171
      Shuah Khan 提交于
      Add tracing feature to iommu to report various iommu events. Classes
      iommu_group, iommu_device, and iommu_map_unmap are defined.
      
      iommu_group class events can be enabled to trigger when devices get added
      to and removed from an iommu group. Trace information includes iommu group
      id and device name.
      
      iommu:add_device_to_group
      iommu:remove_device_from_group
      
      iommu_device class events can be enabled to trigger when devices are attached
      to and detached from a domain. Trace information includes device name.
      
      iommu:attach_device_to_domain
      iommu:detach_device_from_domain
      
      iommu_map_unmap class events can be enabled to trigger when iommu map and
      unmap iommu ops. Trace information includes iova, physical address (map event
      only), and size.
      
      iommu:map
      iommu:unmap
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      7f6db171
  13. 24 6月, 2013 1 次提交
  14. 23 6月, 2013 1 次提交
  15. 20 6月, 2013 1 次提交
    • A
      iommu: Split iommu_unmaps · bd13969b
      Alex Williamson 提交于
      iommu_map splits requests into pages that the iommu driver reports
      that it can handle.  The iommu_unmap path does not do the same.  This
      can cause problems not only from callers that might expect the same
      behavior as the map path, but even from the failure path of iommu_map,
      should it fail at a point where it has mapped and needs to unwind a
      set of pages that the iommu driver cannot handle directly.  amd_iommu,
      for example, will BUG_ON if asked to unmap a non power of 2 size.
      
      Fix this by extracting and generalizing the sizing code from the
      iommu_map path and use it for both map and unmap.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      bd13969b
  16. 25 4月, 2013 1 次提交
  17. 03 4月, 2013 2 次提交
  18. 06 2月, 2013 4 次提交
  19. 11 1月, 2013 1 次提交
    • A
      iommu: moving initialization earlier · 097e3635
      Alexey Kardashevskiy 提交于
      The iommu_init() initializes IOMMU internal structures and data
      required for the IOMMU API as iommu_group_alloc().
      It is registered as a subsys_initcall now.
      
      One of the IOMMU users is going to be a PCI subsystem on POWER.
      It discovers new IOMMU tables during the PCI scan so the logical
      place to call iommu_group_alloc() is the moment when a new group
      is discovered. However PCI scan is done from subsys_initcall hook
      as IOMMU does so PCI hook can be (and is) called before the IOMMU one.
      
      The patch moves IOMMU subsystem initialization one step earlier
      to make sure that IOMMU is initialized before PCI scan begins.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      097e3635