linux-stable/drivers/iommu
Lu Baolu ad789d991e iommu/vt-d: Fix RID2PASID setup/teardown failure
commit 4140d77a02 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-12 16:42:15 +02:00
..
amd iommu/amd: Increase timeout waiting for GA log enablement 2022-06-09 10:30:37 +02:00
arm iommu/arm-smmu-v3: check return value after calling platform_get_resource() 2022-06-14 18:45:01 +02:00
intel iommu/vt-d: Fix RID2PASID setup/teardown failure 2022-07-12 16:42:15 +02: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: Fix iova map result check bug 2022-06-09 10:30:51 +02:00
exynos-iommu.c iommu: Split struct iommu_ops 2022-02-28 13:25:49 +01:00
fsl_pamu.c iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace 2021-04-07 10:56:52 +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: Split struct iommu_ops 2022-02-28 13:25:49 +01: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 iommu/io-pgtable-arm: Move some definitions to a header 2020-09-28 23:48:06 +01:00
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 iommu: Make sysfs robust for non-API groups 2022-05-04 15:13:39 +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-29 09:04:34 +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
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
msm_iommu.c iommu/msm: Fix an incorrect NULL check on list iterator 2022-06-09 10:30:51 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mediatek: Fix NULL pointer dereference when printing dev_name 2022-06-09 10:30:35 +02:00
mtk_iommu.h iommu/mediatek: Add mutex for m4u_group and m4u_dom in data 2022-06-09 10:30:35 +02:00
mtk_iommu_v1.c iommu/mediatek: Fix NULL pointer dereference when printing dev_name 2022-06-09 10:30:35 +02:00
of_iommu.c iommu: Remove unused of_get_dma_window() 2021-06-08 14:15:46 +02:00
omap-iommu-debug.c iommu/omap: Check for failure of a call to omap_iommu_dump_ctx 2020-07-22 15:02:33 +02:00
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: Split struct iommu_ops 2022-02-28 13:25:49 +01: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