1. 05 9月, 2016 2 次提交
  2. 07 7月, 2016 1 次提交
    • J
      iommu/amd: Fix unity mapping initialization race · 522e5cb7
      Joerg Roedel 提交于
      There is a race condition in the AMD IOMMU init code that
      causes requested unity mappings to be blocked by the IOMMU
      for a short period of time. This results on boot failures
      and IO_PAGE_FAULTs on some machines.
      
      Fix this by making sure the unity mappings are installed
      before all other DMA is blocked.
      
      Fixes: aafd8ba0 ('iommu/amd: Implement add_device and remove_device')
      Cc: stable@vger.kernel.org # v4.2+
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      522e5cb7
  3. 27 6月, 2016 1 次提交
  4. 07 4月, 2016 5 次提交
  5. 25 2月, 2016 2 次提交
    • J
      iommu/amd: Apply workaround for ATS write permission check · 358875fd
      Jay Cornwall 提交于
      The AMD Family 15h Models 30h-3Fh (Kaveri) BIOS and Kernel Developer's
      Guide omitted part of the BIOS IOMMU L2 register setup specification.
      Without this setup the IOMMU L2 does not fully respect write permissions
      when handling an ATS translation request.
      
      The IOMMU L2 will set PTE dirty bit when handling an ATS translation with
      write permission request, even when PTE RW bit is clear. This may occur by
      direct translation (which would cause a PPR) or by prefetch request from
      the ATC.
      
      This is observed in practice when the IOMMU L2 modifies a PTE which maps a
      pagecache page. The ext4 filesystem driver BUGs when asked to writeback
      these (non-modified) pages.
      
      Enable ATS write permission check in the Kaveri IOMMU L2 if BIOS has not.
      Signed-off-by: NJay Cornwall <jay@jcornwall.me>
      Cc: <stable@vger.kernel.org> # v3.19+
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      358875fd
    • S
      iommu/amd: Fix boot warning when device 00:00.0 is not iommu covered · 38e45d02
      Suravee Suthikulpanit 提交于
      The setup code for the performance counters in the AMD IOMMU driver
      tests whether the counters can be written. It tests to setup a counter
      for device 00:00.0, which fails on systems where this particular device
      is not covered by the IOMMU.
      
      Fix this by not relying on device 00:00.0 but only on the IOMMU being
      present.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      38e45d02
  6. 21 10月, 2015 5 次提交
  7. 09 10月, 2015 1 次提交
  8. 04 10月, 2015 1 次提交
  9. 29 9月, 2015 1 次提交
  10. 24 9月, 2015 1 次提交
  11. 14 8月, 2015 1 次提交
  12. 30 7月, 2015 1 次提交
  13. 11 6月, 2015 2 次提交
  14. 24 4月, 2015 1 次提交
  15. 04 2月, 2015 1 次提交
  16. 23 1月, 2015 1 次提交
    • T
      iommu/amd: Fix irq remapping detection logic · 3f4cb7c0
      Thomas Gleixner 提交于
      Commit 7fa1c842 "iommu/irq_remapping: Change variable
      disable_irq_remap to be static" returns unconditionally success from
      the irq remapping prepare callback if the iommu can be initialized.
      
      The change assumed that iommu_go_to_state(IOMMU_ACPI_FINISHED) returns
      a failure if irq remapping is not enabled, but thats not the case.
      
      The function returns success when the iommu is initialized to the
      point which is required for remapping to work. The actual state of the
      irq remapping feature is reflected in the status variable
      amd_iommu_irq_remap, which is not considered in the return value.
      
      The fix is simple: If the iommu_go_to_state() returns success,
      evaluate the remapping state amd_iommu_irq_remap and reflect it in the
      return value.
      
      Fixes: 7fa1c842 iommu/irq_remapping: Change variable disable_irq_remap to be static
      Reported-and-tested-by: NBorislav Petkov <bp@alien8.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      3f4cb7c0
  17. 15 1月, 2015 3 次提交
  18. 26 9月, 2014 1 次提交
  19. 04 7月, 2014 1 次提交
    • A
      iommu/amd: Add sysfs support · 066f2e98
      Alex Williamson 提交于
      AMD-Vi support for IOMMU sysfs.  This allows us to associate devices
      with a specific IOMMU device and examine the capabilities and features
      of that IOMMU.  The AMD IOMMU is hosted on and actual PCI device, so
      we make that device the parent for the IOMMU class device.  This
      initial implementaiton exposes only the capability header and extended
      features register for the IOMMU.
      
      # find /sys | grep ivhd
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:00.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:02.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:04.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:09.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:11.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:12.0
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:12.2
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/devices/0000:00:13.0
      ...
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/power
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/power/control
      ...
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/device
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/subsystem
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/amd-iommu
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/amd-iommu/cap
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/amd-iommu/features
      /sys/devices/pci0000:00/0000:00:00.2/iommu/ivhd0/uevent
      /sys/class/iommu/ivhd0
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      066f2e98
  20. 13 5月, 2014 1 次提交
    • S
      iommu/amd: fix enabling exclusion range for an exact device · 2c16c9fd
      Su Friendy 提交于
      set_device_exclusion_range(u16 devid, struct ivmd_header *m) enables
      exclusion range for ONE device. IOMMU does not translate the access
      to the exclusion range from the device.
      
      The device is specified by input argument 'devid'. But 'devid' is not
      passed to the actual set function set_dev_entry_bit(), instead
      'm->devid' is passed. 'm->devid' does not specify the exact device
      which needs enable the exclusion range. 'm->devid' represents DeviceID
      field of IVMD, which has different meaning depends on IVMD type.
      
      The caller init_exclusion_range() sets 'devid' for ONE device. When
      m->type is equal to ACPI_IVMD_TYPE_ALL or ACPI_IVMD_TYPE_RANGE,
      'm->devid' is not equal to 'devid'.
      
      This patch fixes 'm->devid' to 'devid'.
      Signed-off-by: NSu Friendy <friendy.su@sony.com.cn>
      Signed-off-by: NTamori Masahiro <Masahiro.Tamori@jp.sony.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      2c16c9fd
  21. 24 3月, 2014 1 次提交
  22. 07 12月, 2013 1 次提交
    • L
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng 提交于
      Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
      <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
      inclusions and remove some inclusions of those files that aren't
      necessary.
      
      First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
      should not be included directly from any files that are built for
      CONFIG_ACPI unset, because that generally leads to build warnings about
      undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
      <linux/acpi.h> includes those files and for CONFIG_ACPI unset it
      provides stub ACPI symbols to be used in that case.
      
      Second, there are ordering dependencies between those files that always
      have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
      prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
      latter depends on are always there.  And <acpi/acpi.h> which provides
      basic ACPICA type declarations should always be included prior to any other
      ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
      <linux/acpi.h> as appropriate.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  23. 14 8月, 2013 1 次提交
  24. 19 6月, 2013 1 次提交
  25. 23 4月, 2013 2 次提交
    • W
      iommu/amd: fix error return code in early_amd_iommu_init() · 83ed9c13
      Wei Yongjun 提交于
      Fix to return -ENOMEM int the memory alloc error handling
      case instead of 0, as done elsewhere in this function.
      Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      83ed9c13
    • S
      iommu/AMD: Per-thread IOMMU Interrupt Handling · 3f398bc7
      Suravee Suthikulpanit 提交于
      In the current interrupt handling scheme, there are as many threads as
      the number of IOMMUs. Each thread is created and assigned to an IOMMU at
      the time of registering interrupt handlers (request_threaded_irq).
      When an IOMMU HW generates an interrupt, the irq handler (top half) wakes up
      the corresponding thread to process event and PPR logs of all IOMMUs
      starting from the 1st IOMMU.
      
      In the system with multiple IOMMU,this handling scheme complicates the
      synchronization of the IOMMU data structures and status registers as
      there could be multiple threads competing for the same IOMMU while
      the other IOMMU could be left unhandled.
      
      To simplify, this patch is proposing a different interrupt handling scheme
      by having each thread only managing interrupts of the corresponding IOMMU.
      This can be achieved by passing the struct amd_iommu when registering the
      interrupt handlers. This structure is unique for each IOMMU and can be used
      by the bottom half thread to identify the IOMMU to be handled instead
      of calling for_each_iommu.  Besides this also eliminate the needs to lock
      the IOMMU for processing event and PPR logs.
      Signed-off-by: NSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      3f398bc7
  26. 20 4月, 2013 1 次提交