linux-stable/drivers/iommu/intel
Lu Baolu 4140d77a02 iommu/vt-d: Fix RID2PASID setup/teardown failure
The IOMMU driver shares the pasid table for PCI alias devices. When the
RID2PASID entry of the shared pasid table has been filled by the first
device, the subsequent device will encounter the "DMAR: Setup RID2PASID
failed" failure as the pasid entry has already been marked as present.
As the result, the IOMMU probing process will be aborted.

On the contrary, when any alias device is hot-removed from the system,
for example, by writing to /sys/bus/pci/devices/.../remove, the shared
RID2PASID will be cleared without any notifications to other devices.
As the result, any DMAs from those rest devices are blocked.

Sharing pasid table among PCI alias devices could save two memory pages
for devices underneath the PCIe-to-PCI bridges. Anyway, considering that
those devices are rare on modern platforms that support VT-d in scalable
mode and the saved memory is negligible, it's reasonable to remove this
part of immature code to make the driver feasible and stable.

Fixes: ef848b7e5a ("iommu/vt-d: Setup pasid entry for RID2PASID support")
Reported-by: Chenyi Qiang <chenyi.qiang@intel.com>
Reported-by: Ethan Zhao <haifeng.zhao@linux.intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Ethan Zhao <haifeng.zhao@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220623065720.727849-1-baolu.lu@linux.intel.com
Link: https://lore.kernel.org/r/20220625133430.2200315-2-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2022-07-06 12:59:21 +02:00
..
cap_audit.c iommu/vt-d: Fix an unbalanced rcu_read_lock/rcu_read_unlock() 2021-11-26 22:54:47 +01:00
cap_audit.h iommu/vt-d: Check FL and SL capability sanity in scalable mode 2021-10-18 12:31:48 +02:00
debugfs.c iommu/vt-d: Remove DEFER_DEVICE_DOMAIN_INFO 2022-03-04 16:46:30 +01:00
dmar.c iommu/vt-d: Fix PCI bus rescan device hot add 2022-07-06 12:44:07 +02:00
iommu.c iommu/vt-d: Fix RID2PASID setup/teardown failure 2022-07-06 12:59:21 +02:00
irq_remapping.c iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping() 2022-01-31 16:53:09 +01:00
Kconfig iommu/sva: Rename CONFIG_IOMMU_SVA_LIB to CONFIG_IOMMU_SVA 2022-02-14 19:17:46 +01:00
Makefile iommu/vt-d: Add common code for dmar latency performance monitors 2021-06-10 09:06:13 +02:00
pasid.c iommu/vt-d: Fix RID2PASID setup/teardown failure 2022-07-06 12:59:21 +02:00
pasid.h iommu/vt-d: Fix RID2PASID setup/teardown failure 2022-07-06 12:59:21 +02:00
perf.c iommu/vt-d: Drop the kernel doc annotation 2021-08-19 10:41:08 +02:00
perf.h iommu/vt-d: Add common code for dmar latency performance monitors 2021-06-10 09:06:13 +02:00
svm.c iommu/vt-d: Drop stop marker messages 2022-04-28 11:01:53 +02:00
trace.c