1. 23 5月, 2012 1 次提交
    • O
      iommu/core: pass a user-provided token to fault handlers · 77ca2332
      Ohad Ben-Cohen 提交于
      Sometimes a single IOMMU user may have to deal with several
      different IOMMU devices (e.g. remoteproc).
      
      When an IOMMU fault happens, such users have to regain their
      context in order to deal with the fault.
      
      Users can't use the private fields of neither the iommu_domain nor
      the IOMMU device, because those are already used by the IOMMU core
      and low level driver (respectively).
      
      This patch just simply allows users to pass a private token (most
      notably their own context pointer) to iommu_set_fault_handler(),
      and then makes sure it is provided back to the users whenever
      an IOMMU fault happens.
      
      The patch also adopts remoteproc to the new fault handling
      interface, but the real functionality using this (recovery of
      remote processors) will only be added later in a subsequent patch
      set.
      
      Cc: Fernando Guzman Lugo <fernando.lugo@ti.com>
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      77ca2332
  2. 16 12月, 2011 1 次提交
  3. 15 11月, 2011 1 次提交
    • A
      iommu: Add iommu_device_group callback and iommu_group sysfs entry · 1460432c
      Alex Williamson 提交于
      An IOMMU group is a set of devices for which the IOMMU cannot
      distinguish transactions.  For PCI devices, a group often occurs
      when a PCI bridge is involved.  Transactions from any device
      behind the bridge appear to be sourced from the bridge itself.
      We leave it to the IOMMU driver to define the grouping restraints
      for their platform.
      
      Using this new interface, the group for a device can be retrieved
      using the iommu_device_group() callback.  Users will compare the
      value returned against the value returned for other devices to
      determine whether they are part of the same group.  Devices with
      no group are not translated by the IOMMU.  There should be no
      expectations about the group numbers as they may be arbitrarily
      assigned by the IOMMU driver and may not be persistent across boots.
      
      We also provide a sysfs interface to the group numbers here so
      that userspace can understand IOMMU dependencies between devices
      for managing safe, userspace drivers.
      
      [Some code changes by Joerg Roedel <joerg.roedel@amd.com>]
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      1460432c
  4. 10 11月, 2011 3 次提交
    • O
      iommu/core: remove the temporary pgsize settings · 6c274d1c
      Ohad Ben-Cohen 提交于
      Now that all IOMMU drivers are exporting their supported pgsizes,
      we can remove the default pgsize settings in register_iommu().
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      6c274d1c
    • O
      iommu/core: split mapping to page sizes as supported by the hardware · 7d3002cc
      Ohad Ben-Cohen 提交于
      When mapping a memory region, split it to page sizes as supported
      by the iommu hardware. Always prefer bigger pages, when possible,
      in order to reduce the TLB pressure.
      
      The logic to do that is now added to the IOMMU core, so neither the iommu
      drivers themselves nor users of the IOMMU API have to duplicate it.
      
      This allows a more lenient granularity of mappings; traditionally the
      IOMMU API took 'order' (of a page) as a mapping size, and directly let
      the low level iommu drivers handle the mapping, but now that the IOMMU
      core can split arbitrary memory regions into pages, we can remove this
      limitation, so users don't have to split those regions by themselves.
      
      Currently the supported page sizes are advertised once and they then
      remain static. That works well for OMAP and MSM but it would probably
      not fly well with intel's hardware, where the page size capabilities
      seem to have the potential to be different between several DMA
      remapping devices.
      
      register_iommu() currently sets a default pgsize behavior, so we can convert
      the IOMMU drivers in subsequent patches. After all the drivers
      are converted, the temporary default settings will be removed.
      
      Mainline users of the IOMMU API (kvm and omap-iovmm) are adopted
      to deal with bytes instead of page order.
      
      Many thanks to Joerg Roedel <Joerg.Roedel@amd.com> for significant review!
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Cc: David Brown <davidb@codeaurora.org>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Joerg Roedel <Joerg.Roedel@amd.com>
      Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
      Cc: KyongHo Cho <pullip.cho@samsung.com>
      Cc: Hiroshi DOYU <hdoyu@nvidia.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: kvm@vger.kernel.org
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      7d3002cc
    • O
      iommu/core: stop converting bytes to page order back and forth · 5009065d
      Ohad Ben-Cohen 提交于
      Express sizes in bytes rather than in page order, to eliminate the
      size->order->size conversions we have whenever the IOMMU API is calling
      the low level drivers' map/unmap methods.
      
      Adopt all existing drivers.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Cc: David Brown <davidb@codeaurora.org>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Joerg Roedel <Joerg.Roedel@amd.com>
      Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
      Cc: KyongHo Cho <pullip.cho@samsung.com>
      Cc: Hiroshi DOYU <hdoyu@nvidia.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      5009065d
  5. 21 10月, 2011 5 次提交
  6. 30 9月, 2011 1 次提交
  7. 26 9月, 2011 1 次提交
  8. 14 9月, 2011 1 次提交
    • O
      iommu/core: Add fault reporting mechanism · 4f3f8d9d
      Ohad Ben-Cohen 提交于
      Add iommu fault report mechanism to the IOMMU API, so implementations
      could report about mmu faults (translation errors, hardware errors,
      etc..).
      
      Fault reports can be used in several ways:
      - mere logging
      - reset the device that accessed the faulting address (may be necessary
        in case the device is a remote processor for example)
      - implement dynamic PTE/TLB loading
      
      A dedicated iommu_set_fault_handler() API has been added to allow
      users, who are interested to receive such reports, to provide
      their handler.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      4f3f8d9d
  9. 06 9月, 2011 1 次提交
  10. 05 9月, 2011 1 次提交
  11. 14 6月, 2011 1 次提交
  12. 08 3月, 2010 4 次提交
  13. 07 5月, 2009 1 次提交
  14. 24 3月, 2009 1 次提交
  15. 05 3月, 2009 1 次提交
  16. 03 1月, 2009 1 次提交