linux-stable/drivers/iommu
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
..
amd IOMMU Updates for Linux v5.19 2022-05-31 09:56:54 -07:00
arm iommu/arm-smmu: Force identity domains for legacy binding 2022-05-10 12:01:31 +01:00
intel iommu/vt-d: Fix RID2PASID setup/teardown failure 2022-07-06 12:59:21 +02:00
Kconfig iommu/sva: Rename CONFIG_IOMMU_SVA_LIB to CONFIG_IOMMU_SVA 2022-02-14 19:17:46 +01:00
Makefile iommu/sva: Rename CONFIG_IOMMU_SVA_LIB to CONFIG_IOMMU_SVA 2022-02-14 19:17:46 +01:00
apple-dart.c iommu/dart: Add missing module owner to ops structure 2022-05-04 10:36:25 +02:00
dma-iommu.c iommu/dma: Explicitly sort PCI DMA windows 2022-05-13 15:08:20 +02:00
exynos-iommu.c iommu: Split struct iommu_ops 2022-02-28 13:25:49 +01:00
fsl_pamu.c iommu/fsl_pamu: Prepare cleanup of powerpc's asm/prom.h 2022-04-28 10:20:11 +02:00
fsl_pamu.h iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace 2021-04-07 10:56:52 +02:00
fsl_pamu_domain.c iommu/fsl_pamu: Prepare cleanup of powerpc's asm/prom.h 2022-04-28 10:20:11 +02:00
fsl_pamu_domain.h iommu/fsl_pamu: remove the snoop_id field 2021-04-07 10:56:52 +02:00
hyperv-iommu.c iommu/hyperv: setup an IO-APIC IRQ remapping domain for root partition 2021-02-11 08:47:07 +00:00
io-pgfault.c iommu: Add a page fault handler 2021-04-07 10:54:29 +02:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Add error handle for page table allocation failure 2021-12-14 14:45:35 +00:00
io-pgtable-arm.c iommu/io-pgtable-arm: Fix table descriptor paddr formatting 2021-12-06 13:03:01 +01:00
io-pgtable-arm.h
io-pgtable.c iommu/io-pgtable: Add DART pagetable format 2021-08-12 13:15:02 +02:00
ioasid.c iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit 2022-02-15 11:31:35 +01:00
iommu-debugfs.c
iommu-sva-lib.c iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit 2022-02-15 11:31:35 +01:00
iommu-sva-lib.h iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit 2022-02-15 11:31:35 +01:00
iommu-sysfs.c
iommu-traces.c
iommu.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/msm', 'arm/smmu', 'ppc/pamu', 'x86/vt-d', 'x86/amd' and 'vfio-notifier-fix' into next 2022-05-20 12:27:17 +02:00
iova.c iommu/iova: Improve 32-bit free space estimate 2022-03-04 10:40:40 +01:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Fix compatible for rcar-gen4 2022-06-22 15:45:56 +02:00
irq_remapping.c x86: Kill all traces of irq_remapping_get_irq_domain() 2020-10-28 20:26:28 +01:00
irq_remapping.h x86: Kill all traces of irq_remapping_get_irq_domain() 2020-10-28 20:26:28 +01:00
msm_iommu.c iommu/msm: Fix an incorrect NULL check on list iterator 2022-05-04 10:48:15 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mediatek: Fix NULL pointer dereference when printing dev_name 2022-05-13 14:56:49 +02:00
mtk_iommu_v1.c iommu/mediatek: Fix NULL pointer dereference when printing dev_name 2022-05-13 14:56:49 +02:00
of_iommu.c iommu: Remove unused of_get_dma_window() 2021-06-08 14:15:46 +02:00
omap-iommu-debug.c
omap-iommu.c iommu/omap: Fix regression in probe for NULL pointer dereference 2022-04-08 11:16:29 +02:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c Merge branches 'arm/mediatek', 'arm/msm', 'arm/renesas', 'arm/rockchip', 'arm/smmu', 'x86/vt-d' and 'x86/amd' into next 2022-03-08 12:21:31 +01:00
s390-iommu.c iommu/s390: Tolerate repeat attach_dev calls 2022-05-20 09:57:09 +02:00
sprd-iommu.c iommu: Split struct iommu_ops 2022-02-28 13:25:49 +01:00
sun50i-iommu.c iommu: Split struct iommu_ops 2022-02-28 13:25:49 +01:00
tegra-gart.c iommu: Split struct iommu_ops 2022-02-28 13:25:49 +01:00
tegra-smmu.c Merge branches 'arm/mediatek', 'arm/msm', 'arm/renesas', 'arm/rockchip', 'arm/smmu', 'x86/vt-d' and 'x86/amd' into next 2022-03-08 12:21:31 +01:00
virtio-iommu.c iommu: Split struct iommu_ops 2022-02-28 13:25:49 +01:00