1. 22 1月, 2019 2 次提交
  2. 14 12月, 2018 1 次提交
  3. 07 12月, 2018 1 次提交
    • Y
      iommu/amd: Fix amd_iommu=force_isolation · c12b08eb
      Yu Zhao 提交于
      The parameter is still there but it's ignored. We need to check its
      value before deciding to go into passthrough mode for AMD IOMMU v2
      capable device.
      
      We occasionally use this parameter to force v2 capable device into
      translation mode to debug memory corruption that we suspect is
      caused by DMA writes.
      
      To address the following comment from Joerg Roedel on the first
      version, v2 capability of device is completely ignored.
      > This breaks the iommu_v2 use-case, as it needs a direct mapping for the
      > devices that support it.
      
      And from Documentation/admin-guide/kernel-parameters.txt:
        This option does not override iommu=pt
      
      Fixes: aafd8ba0 ("iommu/amd: Implement add_device and remove_device")
      Signed-off-by: NYu Zhao <yuzhao@google.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      c12b08eb
  4. 06 12月, 2018 1 次提交
  5. 28 11月, 2018 3 次提交
  6. 15 11月, 2018 6 次提交
  7. 08 10月, 2018 1 次提交
  8. 05 10月, 2018 1 次提交
    • S
      iommu/amd: Clear memory encryption mask from physical address · b3e9b515
      Singh, Brijesh 提交于
      Boris Ostrovsky reported a memory leak with device passthrough when SME
      is active.
      
      The VFIO driver uses iommu_iova_to_phys() to get the physical address for
      an iova. This physical address is later passed into vfio_unmap_unpin() to
      unpin the memory. The vfio_unmap_unpin() uses pfn_valid() before unpinning
      the memory. The pfn_valid() check was failing because encryption mask was
      part of the physical address returned. This resulted in the memory not
      being unpinned and therefore leaked after the guest terminates.
      
      The memory encryption mask must be cleared from the physical address in
      iommu_iova_to_phys().
      
      Fixes: 2543a786 ("iommu/amd: Allow the AMD IOMMU to work with memory encryption")
      Reported-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: <iommu@lists.linux-foundation.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: kvm@vger.kernel.org
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: <stable@vger.kernel.org> # 4.14+
      Signed-off-by: NBrijesh Singh <brijesh.singh@amd.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      b3e9b515
  9. 26 9月, 2018 1 次提交
  10. 18 8月, 2018 1 次提交
  11. 08 8月, 2018 1 次提交
  12. 20 7月, 2018 1 次提交
    • A
      iommu/amd: Remove redundant WARN_ON() · f1a066fc
      Anna-Maria Gleixner 提交于
      The WARN_ON() was introduced in commit 272e4f99 ("iommu/amd: WARN
      when __[attach|detach]_device are called with irqs enabled") to ensure
      that the domain->lock is taken in proper irqs disabled context. This
      is required, because the domain->lock is taken as well in irq
      context.
      
      The proper context check by the WARN_ON() is redundant, because it is
      already covered by LOCKDEP. When working with locks and changing
      context, a run with LOCKDEP is required anyway and would detect the
      wrong lock context.
      
      Furthermore all callers for those functions are within the same file
      and all callers acquire another lock which already disables interrupts.
      Signed-off-by: NAnna-Maria Gleixner <anna-maria@linutronix.de>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      f1a066fc
  13. 06 7月, 2018 3 次提交
  14. 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
  15. 06 6月, 2018 1 次提交
    • T
      irq_remapping: Use apic_ack_irq() · 8a2b7d14
      Thomas Gleixner 提交于
      To address the EBUSY fail of interrupt affinity settings in case that the
      previous setting has not been cleaned up yet, use the new apic_ack_irq()
      function instead of the special ir_ack_apic_edge() implementation which is
      merily a wrapper around ack_APIC_irq().
      
      Preparatory change for the real fix
      
      Fixes: dccfe314 ("x86/vector: Simplify vector move cleanup")
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NSong Liu <songliubraving@fb.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <liu.song.a23@gmail.com>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: stable@vger.kernel.org
      Cc: Mike Travis <mike.travis@hpe.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Tariq Toukan <tariqt@mellanox.com>
      Link: https://lkml.kernel.org/r/20180604162224.555716895@linutronix.de
      8a2b7d14
  16. 15 5月, 2018 2 次提交
  17. 11 5月, 2018 1 次提交
    • G
      PCI: Add "pci=noats" boot parameter · cef74409
      Gil Kupfer 提交于
      Adds a "pci=noats" boot parameter.  When supplied, all ATS related
      functions fail immediately and the IOMMU is configured to not use
      device-IOTLB.
      
      Any function that checks for ATS capabilities directly against the devices
      should also check this flag.  Currently, such functions exist only in IOMMU
      drivers, and they are covered by this patch.
      
      The motivation behind this patch is the existence of malicious devices.
      Lots of research has been done about how to use the IOMMU as protection
      from such devices.  When ATS is supported, any I/O device can access any
      physical address by faking device-IOTLB entries.  Adding the ability to
      ignore these entries lets sysadmins enhance system security.
      Signed-off-by: NGil Kupfer <gilkup@cs.technion.ac.il>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NJoerg Roedel <jroedel@suse.de>
      cef74409
  18. 03 5月, 2018 3 次提交
  19. 29 3月, 2018 9 次提交