1. 27 7月, 2018 1 次提交
    • O
      iommu: Add config option to set passthrough as default · 58d11317
      Olof Johansson 提交于
      This allows the default behavior to be controlled by a kernel config
      option instead of changing the commandline for the kernel to include
      "iommu.passthrough=on" or "iommu=pt" on machines where this is desired.
      
      Likewise, for machines where this config option is enabled, it can be
      disabled at boot time with "iommu.passthrough=off" or "iommu=nopt".
      
      Also corrected iommu=pt documentation for IA-64, since it has no code that
      parses iommu= at all.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      58d11317
  2. 06 7月, 2018 2 次提交
    • G
      iommu/amd: Add basic debugfs infrastructure for AMD IOMMU · 7d0f5fd3
      Gary R Hook 提交于
      Implement a skeleton framework for debugfs support in the AMD
      IOMMU.  Add an AMD-specific Kconfig boolean that depends upon
      general enablement of DebugFS in the IOMMU.
      Signed-off-by: NGary R Hook <gary.hook@amd.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      7d0f5fd3
    • G
      iommu: Enable debugfs exposure of IOMMU driver internals · bad614b2
      Gary R Hook 提交于
      Provide base enablement for using debugfs to expose internal data of an
      IOMMU driver. When called, create the /sys/kernel/debug/iommu directory.
      
      Emit a strong warning at boot time to indicate that this feature is
      enabled.
      
      This function is called from iommu_init, and creates the initial DebugFS
      directory. Drivers may then call iommu_debugfs_new_driver_dir() to
      instantiate a device-specific directory to expose internal data.
      It will return a pointer to the new dentry structure created in
      /sys/kernel/debug/iommu, or NULL in the event of a failure.
      
      Since the IOMMU driver can not be removed from the running system, there
      is no need for an "off" function.
      Signed-off-by: NGary R Hook <gary.hook@amd.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      bad614b2
  3. 12 6月, 2018 1 次提交
    • L
      Revert "iommu/amd_iommu: Use CONFIG_DMA_DIRECT_OPS=y and dma_direct_{alloc,free}()" · e16c4790
      Linus Torvalds 提交于
      This reverts commit b468620f.
      
      It turns out that this broke drm on AMD platforms. Quoting Gabriel C:
       "I can confirm reverting b468620f fixes
        that issue for me.
      
        The GPU is working fine with SME enabled.
      
        Now with working GPU :) I can also confirm performance is back to
        normal without doing any other workarounds"
      
      Christan König analyzed it partially:
       "As far as I analyzed it we now get an -ENOMEM from dma_alloc_attrs()
        in drivers/gpu/drm/ttm/ttm_page_alloc_dma.c when IOMMU is enabled"
      
      and Christoph Hellwig responded:
       "I think the prime issue is that dma_direct_alloc respects the dma
        mask. Which we don't need if actually using the iommu. This would be
        mostly harmless exept for the the SEV bit high in the address that
        makes the checks fail.
      
        For now I'd say revert this commit for 4.17/4.18-rc and I'll look into
        addressing these issues properly"
      Reported-and-bisected-by: NGabriel C <nix.or.die@gmail.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: stable@kernel.org		# v4.17
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e16c4790
  4. 09 5月, 2018 1 次提交
  5. 03 5月, 2018 1 次提交
  6. 20 3月, 2018 2 次提交
  7. 19 9月, 2017 2 次提交
    • G
      iommu/qcom: Depend on HAS_DMA to fix compile error · 986a5f70
      Geert Uytterhoeven 提交于
      If NO_DMA=y:
      
          warning: (IPMMU_VMSA && ARM_SMMU && ARM_SMMU_V3 && QCOM_IOMMU) selects IOMMU_IO_PGTABLE_LPAE which has unmet direct dependencies (IOMMU_SUPPORT && HAS_DMA && (ARM || ARM64 || COMPILE_TEST && !GENERIC_ATOMIC64))
      
      and
      
          drivers/iommu/io-pgtable-arm.o: In function `__arm_lpae_sync_pte':
          io-pgtable-arm.c:(.text+0x206): undefined reference to `bad_dma_ops'
          drivers/iommu/io-pgtable-arm.o: In function `__arm_lpae_free_pages':
          io-pgtable-arm.c:(.text+0x6a6): undefined reference to `bad_dma_ops'
          drivers/iommu/io-pgtable-arm.o: In function `__arm_lpae_alloc_pages':
          io-pgtable-arm.c:(.text+0x812): undefined reference to `bad_dma_ops'
          io-pgtable-arm.c:(.text+0x81c): undefined reference to `bad_dma_ops'
          io-pgtable-arm.c:(.text+0x862): undefined reference to `bad_dma_ops'
          drivers/iommu/io-pgtable-arm.o: In function `arm_lpae_run_tests':
          io-pgtable-arm.c:(.init.text+0x86): undefined reference to `alloc_io_pgtable_ops'
          io-pgtable-arm.c:(.init.text+0x47c): undefined reference to `free_io_pgtable_ops'
          drivers/iommu/qcom_iommu.o: In function `qcom_iommu_init_domain':
          qcom_iommu.c:(.text+0x1ce): undefined reference to `alloc_io_pgtable_ops'
          drivers/iommu/qcom_iommu.o: In function `qcom_iommu_domain_free':
          qcom_iommu.c:(.text+0x754): undefined reference to `free_io_pgtable_ops'
      
      QCOM_IOMMU selects IOMMU_IO_PGTABLE_LPAE, which bypasses its dependency
      on HAS_DMA.  Make QCOM_IOMMU depend on HAS_DMA to fix this.
      
      Fixes: 0ae349a0 ("iommu/qcom: Add qcom_iommu")
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      986a5f70
    • G
      iommu: Add missing dependencies · a4aaeccc
      Guenter Roeck 提交于
      parisc:allmodconfig, xtensa:allmodconfig, and possibly others generate
      the following Kconfig warning.
      
      warning: (IPMMU_VMSA && ARM_SMMU && ARM_SMMU_V3 && QCOM_IOMMU) selects
      IOMMU_IO_PGTABLE_LPAE which has unmet direct dependencies (IOMMU_SUPPORT &&
      HAS_DMA && (ARM || ARM64 || COMPILE_TEST && !GENERIC_ATOMIC64))
      
      IOMMU_IO_PGTABLE_LPAE depends on (COMPILE_TEST && !GENERIC_ATOMIC64),
      so any configuration option selecting it needs to have the same dependencies.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      a4aaeccc
  8. 15 8月, 2017 3 次提交
  9. 04 8月, 2017 1 次提交
  10. 24 6月, 2017 1 次提交
    • W
      iommu/io-pgtable: depend on !GENERIC_ATOMIC64 when using COMPILE_TEST with LPAE · c1004803
      Will Deacon 提交于
      The LPAE/ARMv8 page table format relies on the ability to read and write
      64-bit page table entries in an atomic fashion. With the move to a lockless
      implementation, we also need support for cmpxchg64 to resolve races when
      installing table entries concurrently.
      
      Unfortunately, not all architectures support cmpxchg64, so the code can
      fail to compiler when building for these architectures using COMPILE_TEST.
      Rather than disable COMPILE_TEST altogether, instead check that
      GENERIC_ATOMIC64 is not selected, which is a reasonable indication that
      the architecture has support for 64-bit cmpxchg.
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      c1004803
  11. 17 5月, 2017 3 次提交
  12. 31 3月, 2017 1 次提交
  13. 06 2月, 2017 1 次提交
    • A
      iommu/mediatek: Remove bogus 'select' statements · 087a908f
      Arnd Bergmann 提交于
      The mediatek IOMMU driver enables some drivers that it does not directly
      rely on, and that causes a warning for build testing:
      
      warning: (MTK_IOMMU_V1) selects COMMON_CLK_MT2701_VDECSYS which has unmet direct dependencies (COMMON_CLK && COMMON_CLK_MT2701)
      warning: (MTK_IOMMU_V1) selects COMMON_CLK_MT2701_IMGSYS which has unmet direct dependencies (COMMON_CLK && COMMON_CLK_MT2701)
      warning: (MTK_IOMMU_V1) selects COMMON_CLK_MT2701_MMSYS which has unmet direct dependencies (COMMON_CLK && COMMON_CLK_MT2701)
      
      This removes the select statements.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      087a908f
  14. 16 9月, 2016 1 次提交
  15. 13 7月, 2016 1 次提交
  16. 21 6月, 2016 3 次提交
  17. 09 5月, 2016 1 次提交
  18. 07 4月, 2016 1 次提交
  19. 01 3月, 2016 1 次提交
  20. 29 2月, 2016 1 次提交
    • A
      iommu/mediatek: Select ARM_DMA_USE_IOMMU · 1928832f
      Arnd Bergmann 提交于
      The newly added Mediatek IOMMU driver uses the IOMMU_DMA infrastructure,
      but unlike other such drivers, it does not select 'ARM_DMA_USE_IOMMU',
      which is a prerequisite, leading to a link error:
      
      warning: (MTK_IOMMU) selects IOMMU_DMA which has unmet direct dependencies (IOMMU_SUPPORT && NEED_SG_DMA_LENGTH)
      drivers/iommu/built-in.o: In function `iommu_put_dma_cookie':
      mtk_iommu.c:(.text+0x11fe): undefined reference to `put_iova_domain'
      drivers/iommu/built-in.o: In function `iommu_dma_init_domain':
      mtk_iommu.c:(.text+0x1316): undefined reference to `init_iova_domain'
      drivers/iommu/built-in.o: In function `__iommu_dma_unmap':
      mtk_iommu.c:(.text+0x1380): undefined reference to `find_iova'
      
      This adds the same select that the other drivers have. On a related
      note, I wonder if we should just always select ARM_DMA_USE_IOMMU
      whenever any IOMMU driver is enabled. Are there any cases where
      we would enable an IOMMU but not use it?
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 0df4fabe ("iommu/mediatek: Add mt8173 IOMMU driver")
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      1928832f
  21. 25 2月, 2016 3 次提交
  22. 17 2月, 2016 1 次提交
  23. 14 12月, 2015 1 次提交
  24. 15 10月, 2015 5 次提交
  25. 06 10月, 2015 1 次提交