1. 16 12月, 2015 1 次提交
    • D
      Revert "scatterlist: use sg_phys()" · 3e6110fd
      Dan Williams 提交于
      commit db0fa0cb "scatterlist: use sg_phys()" did replacements of
      the form:
      
          phys_addr_t phys = page_to_phys(sg_page(s));
          phys_addr_t phys = sg_phys(s) & PAGE_MASK;
      
      However, this breaks platforms where sizeof(phys_addr_t) >
      sizeof(unsigned long).  Revert for 4.3 and 4.4 to make room for a
      combined helper in 4.5.
      
      Cc: <stable@vger.kernel.org>
      Cc: Jens Axboe <axboe@fb.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Fixes: db0fa0cb ("scatterlist: use sg_phys()")
      Suggested-by: NJoerg Roedel <joro@8bytes.org>
      Reported-by: NVitaly Lavrov <vel21ripn@gmail.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      3e6110fd
  2. 22 10月, 2015 5 次提交
  3. 17 8月, 2015 1 次提交
    • D
      scatterlist: use sg_phys() · db0fa0cb
      Dan Williams 提交于
      Coccinelle cleanup to replace open coded sg to physical address
      translations.  This is in preparation for introducing scatterlists that
      reference __pfn_t.
      
      // sg_phys.cocci: convert usage page_to_phys(sg_page(sg)) to sg_phys(sg)
      // usage: make coccicheck COCCI=sg_phys.cocci MODE=patch
      
      virtual patch
      
      @@
      struct scatterlist *sg;
      @@
      
      - page_to_phys(sg_page(sg)) + sg->offset
      + sg_phys(sg)
      
      @@
      struct scatterlist *sg;
      @@
      
      - page_to_phys(sg_page(sg))
      + sg_phys(sg) & PAGE_MASK
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      db0fa0cb
  4. 30 6月, 2015 1 次提交
  5. 11 6月, 2015 2 次提交
  6. 09 6月, 2015 7 次提交
  7. 05 6月, 2015 5 次提交
  8. 29 5月, 2015 1 次提交
  9. 31 3月, 2015 4 次提交
  10. 04 2月, 2015 1 次提交
  11. 26 1月, 2015 1 次提交
  12. 19 1月, 2015 2 次提交
  13. 02 12月, 2014 2 次提交
  14. 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
  15. 25 9月, 2014 4 次提交
    • 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