1. 29 7月, 2020 1 次提交
  2. 10 7月, 2020 2 次提交
  3. 23 6月, 2020 1 次提交
  4. 14 6月, 2020 1 次提交
    • M
      treewide: replace '---help---' in Kconfig files with 'help' · a7f7f624
      Masahiro Yamada 提交于
      Since commit 84af7a61 ("checkpatch: kconfig: prefer 'help' over
      '---help---'"), the number of '---help---' has been gradually
      decreasing, but there are still more than 2400 instances.
      
      This commit finishes the conversion. While I touched the lines,
      I also fixed the indentation.
      
      There are a variety of indentation styles found.
      
        a) 4 spaces + '---help---'
        b) 7 spaces + '---help---'
        c) 8 spaces + '---help---'
        d) 1 space + 1 tab + '---help---'
        e) 1 tab + '---help---'    (correct indentation)
        f) 1 tab + 1 space + '---help---'
        g) 1 tab + 2 spaces + '---help---'
      
      In order to convert all of them to 1 tab + 'help', I ran the
      following commend:
      
        $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      a7f7f624
  5. 14 5月, 2020 1 次提交
  6. 29 4月, 2020 2 次提交
    • K
      iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config · 9dd124b6
      Krzysztof Kozlowski 提交于
      Although SPAPR_TCE_IOMMU itself can be compile tested on certain PowerPC
      configurations, its presence makes arch/powerpc/kvm/Makefile to select
      modules which do not build in such configuration.
      
      The arch/powerpc/kvm/ modules use kvm_arch.spapr_tce_tables which exists
      only with CONFIG_PPC_BOOK3S_64.  However these modules are selected when
      COMPILE_TEST and SPAPR_TCE_IOMMU are chosen leading to build failures:
      
          In file included from arch/powerpc/include/asm/book3s/64/mmu-hash.h:20:0,
                           from arch/powerpc/kvm/book3s_64_vio_hv.c:22:
          arch/powerpc/include/asm/book3s/64/pgtable.h:17:0: error: "_PAGE_EXEC" redefined [-Werror]
           #define _PAGE_EXEC  0x00001 /* execute permission */
      
          In file included from arch/powerpc/include/asm/book3s/32/pgtable.h:8:0,
                           from arch/powerpc/include/asm/book3s/pgtable.h:8,
                           from arch/powerpc/include/asm/pgtable.h:18,
                           from include/linux/mm.h:95,
                           from arch/powerpc/include/asm/io.h:29,
                           from include/linux/io.h:13,
                           from include/linux/irq.h:20,
                           from arch/powerpc/include/asm/hardirq.h:6,
                           from include/linux/hardirq.h:9,
                           from include/linux/kvm_host.h:7,
                           from arch/powerpc/kvm/book3s_64_vio_hv.c:12:
          arch/powerpc/include/asm/book3s/32/hash.h:29:0: note: this is the location of the previous definition
           #define _PAGE_EXEC 0x200 /* software: exec allowed */
      
      Fixes: e93a1695 ("iommu: Enable compile testing for some of drivers")
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Link: https://lore.kernel.org/r/20200414142630.21153-1-krzk@kernel.orgSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      9dd124b6
    • G
      iommu/mediatek: Fix MTK_IOMMU dependencies · d1dcb725
      Geert Uytterhoeven 提交于
      If NO_DMA=y (e.g. Sun-3 all{mod,yes}-config):
      
          drivers/iommu/dma-iommu.o: In function `iommu_dma_mmap':
          dma-iommu.c:(.text+0x836): undefined reference to `dma_pgprot'
      
      IOMMU_DMA must not be selected, unless HAS_DMA=y.
      
      Hence fix this by making MTK_IOMMU depend on HAS_DMA.
      While at it, remove the dependency on ARM || ARM64, as that is already
      implied by the dependency on ARCH_MEDIATEK.
      
      Fixes: e93a1695 ("iommu: Enable compile testing for some of drivers")
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Link: https://lore.kernel.org/r/20200410143047.19691-1-geert@linux-m68k.orgSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      d1dcb725
  7. 27 3月, 2020 1 次提交
  8. 04 3月, 2020 1 次提交
  9. 28 2月, 2020 1 次提交
  10. 07 1月, 2020 2 次提交
  11. 23 12月, 2019 3 次提交
  12. 22 11月, 2019 1 次提交
  13. 16 10月, 2019 1 次提交
  14. 15 10月, 2019 2 次提交
  15. 11 9月, 2019 1 次提交
  16. 17 8月, 2019 1 次提交
  17. 07 6月, 2019 1 次提交
  18. 27 5月, 2019 2 次提交
  19. 21 5月, 2019 1 次提交
  20. 03 5月, 2019 1 次提交
    • J
      iommu/dma-iommu: Split iommu_dma_map_msi_msg() in two parts · ece6e6f0
      Julien Grall 提交于
      On RT, iommu_dma_map_msi_msg() may be called from non-preemptible
      context. This will lead to a splat with CONFIG_DEBUG_ATOMIC_SLEEP as
      the function is using spin_lock (they can sleep on RT).
      
      iommu_dma_map_msi_msg() is used to map the MSI page in the IOMMU PT
      and update the MSI message with the IOVA.
      
      Only the part to lookup for the MSI page requires to be called in
      preemptible context. As the MSI page cannot change over the lifecycle
      of the MSI interrupt, the lookup can be cached and re-used later on.
      
      iomma_dma_map_msi_msg() is now split in two functions:
          - iommu_dma_prepare_msi(): This function will prepare the mapping
          in the IOMMU and store the cookie in the structure msi_desc. This
          function should be called in preemptible context.
          - iommu_dma_compose_msi_msg(): This function will update the MSI
          message with the IOVA when the device is behind an IOMMU.
      Signed-off-by: NJulien Grall <julien.grall@arm.com>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Reviewed-by: NEric Auger <eric.auger@redhat.com>
      Acked-by: NJoerg Roedel <jroedel@suse.de>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      ece6e6f0
  21. 05 4月, 2019 1 次提交
    • D
      iommu/arm-smmu: Break insecure users by disabling bypass by default · 954a03be
      Douglas Anderson 提交于
      If you're bisecting why your peripherals stopped working, it's
      probably this CL.  Specifically if you see this in your dmesg:
        Unexpected global fault, this could be serious
      ...then it's almost certainly this CL.
      
      Running your IOMMU-enabled peripherals with the IOMMU in bypass mode
      is insecure and effectively disables the protection they provide.
      There are few reasons to allow unmatched stream bypass, and even fewer
      good ones.
      
      This patch starts the transition over to make it much harder to run
      your system insecurely.  Expected steps:
      
      1. By default disable bypass (so anyone insecure will notice) but make
         it easy for someone to re-enable bypass with just a KConfig change.
         That's this patch.
      
      2. After people have had a little time to come to grips with the fact
         that they need to set their IOMMUs properly and have had time to
         dig into how to do this, the KConfig will be eliminated and bypass
         will simply be disabled.  Folks who are truly upset and still
         haven't fixed their system can either figure out how to add
         'arm-smmu.disable_bypass=n' to their command line or revert the
         patch in their own private kernel.  Of course these folks will be
         less secure.
      Suggested-by: NRobin Murphy <robin.murphy@arm.com>
      Reviewed-by: NMarc Gonzalez <marc.w.gonzalez@free.fr>
      Tested-by: NMarc Gonzalez <marc.w.gonzalez@free.fr>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      954a03be
  22. 28 2月, 2019 1 次提交
    • L
      iommu/hyper-v: Add Hyper-V stub IOMMU driver · 29217a47
      Lan Tianyu 提交于
      On the bare metal, enabling X2APIC mode requires interrupt remapping
      function which helps to deliver irq to cpu with 32-bit APIC ID.
      Hyper-V doesn't provide interrupt remapping function so far and Hyper-V
      MSI protocol already supports to deliver interrupt to the CPU whose
      virtual processor index is more than 255. IO-APIC interrupt still has
      8-bit APIC ID limitation.
      
      This patch is to add Hyper-V stub IOMMU driver in order to enable
      X2APIC mode successfully in Hyper-V Linux guest. The driver returns X2APIC
      interrupt remapping capability when X2APIC mode is available. Otherwise,
      it creates a Hyper-V irq domain to limit IO-APIC interrupts' affinity
      and make sure cpus assigned with IO-APIC interrupt have 8-bit APIC ID.
      
      Define 24 IO-APIC remapping entries because Hyper-V only expose one
      single IO-APIC and one IO-APIC has 24 pins according IO-APIC spec(
      https://pdos.csail.mit.edu/6.828/2016/readings/ia32/ioapic.pdf).
      Reviewed-by: NMichael Kelley <mikelley@microsoft.com>
      Signed-off-by: NLan Tianyu <Tianyu.Lan@microsoft.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      29217a47
  23. 16 1月, 2019 1 次提交
  24. 11 1月, 2019 1 次提交
  25. 27 9月, 2018 1 次提交
    • T
      s390: vfio-ap: base implementation of VFIO AP device driver · 1fde5734
      Tony Krowiak 提交于
      Introduces a new AP device driver. This device driver
      is built on the VFIO mediated device framework. The framework
      provides sysfs interfaces that facilitate passthrough
      access by guests to devices installed on the linux host.
      
      The VFIO AP device driver will serve two purposes:
      
      1. Provide the interfaces to reserve AP devices for exclusive
         use by KVM guests. This is accomplished by unbinding the
         devices to be reserved for guest usage from the zcrypt
         device driver and binding them to the VFIO AP device driver.
      
      2. Implements the functions, callbacks and sysfs attribute
         interfaces required to create one or more VFIO mediated
         devices each of which will be used to configure the AP
         matrix for a guest and serve as a file descriptor
         for facilitating communication between QEMU and the
         VFIO AP device driver.
      
      When the VFIO AP device driver is initialized:
      
      * It registers with the AP bus for control of type 10 (CEX4
        and newer) AP queue devices. This limitation was imposed
        due to:
      
        1. A desire to keep the code as simple as possible;
      
        2. Some older models are no longer supported by the kernel
           and others are getting close to end of service.
      
        3. A lack of older systems on which to test older devices.
      
        The probe and remove callbacks will be provided to support
        the binding/unbinding of AP queue devices to/from the VFIO
        AP device driver.
      
      * Creates a matrix device, /sys/devices/vfio_ap/matrix,
        to serve as the parent of the mediated devices created, one
        for each guest, and to hold the APQNs of the AP devices bound to
        the VFIO AP device driver.
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Acked-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Message-Id: <20180925231641.4954-5-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      1fde5734
  26. 25 9月, 2018 1 次提交
  27. 27 7月, 2018 2 次提交
  28. 06 7月, 2018 3 次提交
  29. 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
  30. 09 5月, 2018 1 次提交