1. 01 Oct, 2020 2 commits
    • Lu Baolu's avatar
      iommu/vt-d: Fix lockdep splat in iommu_flush_dev_iotlb() · 1a3f2fd7
      Lu Baolu authored
      Lock(&iommu->lock) without disabling irq causes lockdep warnings.
      
      [   12.703950] ========================================================
      [   12.703962] WARNING: possible irq lock inversion dependency detected
      [   12.703975] 5.9.0-rc6+ #659 Not tainted
      [   12.703983] --------------------------------------------------------
      [   12.703995] systemd-udevd/284 just changed the state of lock:
      [   12.704007] ffffffffbd6ff4d8 (device_domain_lock){..-.}-{2:2}, at:
                     iommu_flush_dev_iotlb.part.57+0x2e/0x90
      [   12.704031] but this lock took another, SOFTIRQ-unsafe lock in the past:
      [   12.704043]  (&iommu->lock){+.+.}-{2:2}
      [   12.704045]
      
                     and interrupts could create inverse lock ordering between
                     them.
      
      [   12.704073]
                     other info that might help us debug this:
      [   12.704085]  Possible interrupt unsafe locking scenario:
      
      [   12.704097]        CPU0                    CPU1
      [   12.704106]        ----                    ----
      [   12.704115]   lock(&iommu->lock);
      [   12.704123]                                local_irq_disable();
      [   12.704134]                                lock(device_domain_lock);
      [   12.704146]                                lock(&iommu->lock);
      [   12.704158]   <Interrupt>
      [   12.704164]     lock(device_domain_lock);
      [   12.704174]
                      *** DEADLOCK ***
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Link: https://lore.kernel.org/r/20200927062428.13713-1-baolu.lu@linux.intel.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      1a3f2fd7
    • Adrian Huang's avatar
      iommu/amd: Fix the overwritten field in IVMD header · 0bbe4ced
      Adrian Huang authored
      Commit 387caf0b ("iommu/amd: Treat per-device exclusion
      ranges as r/w unity-mapped regions") accidentally overwrites
      the 'flags' field in IVMD (struct ivmd_header) when the I/O
      virtualization memory definition is associated with the
      exclusion range entry. This leads to the corrupted IVMD table
      (incorrect checksum). The kdump kernel reports the invalid checksum:
      
      ACPI BIOS Warning (bug): Incorrect checksum in table [IVRS] - 0x5C, should be 0x60 (20200717/tbprint-177)
      AMD-Vi: [Firmware Bug]: IVRS invalid checksum
      
      Fix the above-mentioned issue by modifying the 'struct unity_map_entry'
      member instead of the IVMD header.
      
      Cleanup: The *exclusion_range* functions are not used anymore, so
      get rid of them.
      
      Fixes: 387caf0b ("iommu/amd: Treat per-device exclusion ranges as r/w unity-mapped regions")
      Reported-and-tested-by: default avatarBaoquan He <bhe@redhat.com>
      Signed-off-by: default avatarAdrian Huang <ahuang12@lenovo.com>
      Cc: Jerry Snitselaar <jsnitsel@redhat.com>
      Link: https://lore.kernel.org/r/20200926102602.19177-1-adrianhuang0701@gmail.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      0bbe4ced
  2. 24 Sep, 2020 1 commit
  3. 20 Sep, 2020 20 commits
  4. 19 Sep, 2020 17 commits