1. 22 10月, 2015 3 次提交
  2. 15 10月, 2015 1 次提交
    • R
      iommu: Implement common IOMMU ops for DMA mapping · 0db2e5d1
      Robin Murphy 提交于
      Taking inspiration from the existing arch/arm code, break out some
      generic functions to interface the DMA-API to the IOMMU-API. This will
      do the bulk of the heavy lifting for IOMMU-backed dma-mapping.
      
      Since associating an IOVA allocator with an IOMMU domain is a fairly
      common need, rather than introduce yet another private structure just to
      do this for ourselves, extend the top-level struct iommu_domain with the
      notion. A simple opaque cookie allows reuse by other IOMMU API users
      with their various different incompatible allocator types.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      0db2e5d1
  3. 18 7月, 2015 1 次提交
    • N
      include, lib: add __printf attributes to several function prototypes · 8db14860
      Nicolas Iooss 提交于
      Using __printf attributes helps to detect several format string issues
      at compile time (even though -Wformat-security is currently disabled in
      Makefile).  For example it can detect when formatting a pointer as a
      number, like the issue fixed in commit a3fa71c4 ("wl18xx: show
      rx_frames_per_rates as an array as it really is"), or when the arguments
      do not match the format string, c.f.  for example commit 5ce1aca8
      ("reiserfs: fix __RASSERT format string").
      
      To prevent similar bugs in the future, add a __printf attribute to every
      function prototype which needs one in include/linux/ and lib/.  These
      functions were mostly found by using gcc's -Wsuggest-attribute=format
      flag.
      Signed-off-by: NNicolas Iooss <nicolas.iooss_linux@m4x.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8db14860
  4. 11 6月, 2015 1 次提交
  5. 09 6月, 2015 3 次提交
  6. 31 3月, 2015 3 次提交
  7. 02 12月, 2014 2 次提交
  8. 14 11月, 2014 2 次提交
  9. 04 11月, 2014 1 次提交
    • 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
  10. 30 9月, 2014 1 次提交
    • W
      iommu: introduce domain attribute for nesting IOMMUs · c02607aa
      Will Deacon 提交于
      Some IOMMUs, such as the ARM SMMU, support two stages of translation.
      The idea behind such a scheme is to allow a guest operating system to
      use the IOMMU for DMA mappings in the first stage of translation, with
      the hypervisor then installing mappings in the second stage to provide
      isolation of the DMA to the physical range assigned to that virtual
      machine.
      
      In order to allow IOMMU domains to be used for second-stage translation,
      this patch adds a new iommu_attr (IOMMU_ATTR_NESTING) for setting
      second-stage domains prior to device attach. The attribute can also be
      queried to see if a domain is actually making use of nesting.
      Acked-by: NJoerg Roedel <jroedel@suse.de>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      c02607aa
  11. 25 9月, 2014 3 次提交
  12. 08 7月, 2014 1 次提交
    • A
      iommu: Fix IOMMU sysfs stubs · e09f8ea5
      Alex Williamson 提交于
      0-day kernel build testing reports:
      
         arch/x86/kvm/x86.o: In function `iommu_device_destroy':
      >> (.text+0x7a0a): multiple definition of `iommu_device_destroy'
         arch/x86/kvm/../../../virt/kvm/vfio.o:vfio.c:(.text+0x490): first defined here
         arch/x86/kvm/x86.o: In function `iommu_device_link':
      >> (.text+0x7a15): multiple definition of `iommu_device_link'
         arch/x86/kvm/../../../virt/kvm/vfio.o:vfio.c:(.text+0x49b): first defined here
         arch/x86/kvm/x86.o: In function `iommu_device_unlink':
      >> (.text+0x7a25): multiple definition of `iommu_device_unlink'
         arch/x86/kvm/../../../virt/kvm/vfio.o:vfio.c:(.text+0x4ab): first defined here
         arch/x86/kvm/x86.o: In function `iommu_device_create':
      >> (.text+0x79f8): multiple definition of `iommu_device_create'
         arch/x86/kvm/../../../virt/kvm/vfio.o:vfio.c:(.text+0x47e): first defined here
      
      These are due to failing to define the stubs as static inline.  Fix.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      e09f8ea5
  13. 07 7月, 2014 1 次提交
  14. 04 7月, 2014 2 次提交
    • A
      iommu: Add sysfs support for IOMMUs · c61959ec
      Alex Williamson 提交于
      IOMMUs currently have no common representation to userspace, most
      seem to have no representation at all aside from a few printks
      on bootup.  There are however features of IOMMUs that are useful
      to know about.  For instance the IOMMU might support superpages,
      making use of processor large/huge pages more important in a device
      assignment scenario.  It's also useful to create cross links between
      devices and IOMMU hardware units, so that users might be able to
      load balance their devices to avoid thrashing a single hardware unit.
      
      This patch adds a device create and destroy interface as well as
      device linking, making it very lightweight for an IOMMU driver to add
      basic support.  IOMMU drivers can provide additional attributes
      automatically by using an attribute_group.
      
      The attributes exposed are expected to be relatively device specific,
      the means to retrieve them certainly are, so there are currently no
      common attributes for the new class created here.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      c61959ec
    • A
      iommu/core: Create central IOMMU group lookup/creation interface · 104a1c13
      Alex Williamson 提交于
      Currently each IOMMU driver that supports IOMMU groups has its own
      code for discovering the base device used in grouping.  This code
      is generally not specific to the IOMMU hardware, but to the bus of
      the devices managed by the IOMMU.  We can therefore create a common
      interface for supporting devices on different buses.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      104a1c13
  15. 07 1月, 2014 1 次提交
  16. 30 12月, 2013 1 次提交
  17. 17 12月, 2013 1 次提交
  18. 25 9月, 2013 1 次提交
    • S
      iommu: Change iommu driver to call io_page_fault trace event · 56fa4849
      Shuah Khan 提交于
      Change iommu driver call io_page_fault trace event. This iommu_error class
      event can be enabled to trigger when an iommu error occurs. Trace information
      includes driver name, device name, iova, and flags.
      
      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] ....     2.003774: io_page_fault: IOMMU:pci 0000:00:02.0 iova=0x00000000cb800000 flags=0x0002
             swapper/0-1     [003] ....     2.004098: io_page_fault: IOMMU:pci 0000:00:1d.0 iova=0x00000000cadc6000 flags=0x0002
             swapper/0-1     [003] ....     2.004115: io_page_fault: IOMMU:pci 0000:00:1a.0 iova=0x00000000cadc6000 flags=0x0002
             swapper/0-1     [003] ....     2.004129: io_page_fault: IOMMU:pci 0000:00:1f.0 iova=0x0000000000000000 flags=0x0002
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      56fa4849
  19. 14 8月, 2013 1 次提交
  20. 25 4月, 2013 1 次提交
  21. 20 4月, 2013 1 次提交
  22. 03 4月, 2013 2 次提交
  23. 06 2月, 2013 4 次提交
  24. 25 9月, 2012 1 次提交
  25. 03 8月, 2012 1 次提交