remarkable-linux/drivers/iommu
Jiang Liu 59ce0515cd iommu/vt-d: Update DRHD/RMRR/ATSR device scope caches when PCI hotplug happens
Current Intel DMAR/IOMMU driver assumes that all PCI devices associated
with DMAR/RMRR/ATSR device scope arrays are created at boot time and
won't change at runtime, so it caches pointers of associated PCI device
object. That assumption may be wrong now due to:
1) introduction of PCI host bridge hotplug
2) PCI device hotplug through sysfs interfaces.

Wang Yijing has tried to solve this issue by caching <bus, dev, func>
tupple instead of the PCI device object pointer, but that's still
unreliable because PCI bus number may change in case of hotplug.
Please refer to http://lkml.org/lkml/2013/11/5/64
Message from Yingjing's mail:
after remove and rescan a pci device
[  611.857095] dmar: DRHD: handling fault status reg 2
[  611.857109] dmar: DMAR:[DMA Read] Request device [86:00.3] fault addr ffff7000
[  611.857109] DMAR:[fault reason 02] Present bit in context entry is clear
[  611.857524] dmar: DRHD: handling fault status reg 102
[  611.857534] dmar: DMAR:[DMA Read] Request device [86:00.3] fault addr ffff6000
[  611.857534] DMAR:[fault reason 02] Present bit in context entry is clear
[  611.857936] dmar: DRHD: handling fault status reg 202
[  611.857947] dmar: DMAR:[DMA Read] Request device [86:00.3] fault addr ffff5000
[  611.857947] DMAR:[fault reason 02] Present bit in context entry is clear
[  611.858351] dmar: DRHD: handling fault status reg 302
[  611.858362] dmar: DMAR:[DMA Read] Request device [86:00.3] fault addr ffff4000
[  611.858362] DMAR:[fault reason 02] Present bit in context entry is clear
[  611.860819] IPv6: ADDRCONF(NETDEV_UP): eth3: link is not ready
[  611.860983] dmar: DRHD: handling fault status reg 402
[  611.860995] dmar: INTR-REMAP: Request device [[86:00.3] fault index a4
[  611.860995] INTR-REMAP:[fault reason 34] Present field in the IRTE entry is clear

This patch introduces a new mechanism to update the DRHD/RMRR/ATSR device scope
caches by hooking PCI bus notification.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
2014-03-04 17:51:06 +01:00
..
amd_iommu.c iommu/amd: Use dev_is_pci() to check whether it is pci device 2014-01-07 15:21:32 +01:00
amd_iommu_init.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
amd_iommu_proto.h perf/x86/amd: Add IOMMU Performance Counter resource management 2013-06-19 13:04:52 +02:00
amd_iommu_types.h perf/x86/amd: Add IOMMU Performance Counter resource management 2013-06-19 13:04:52 +02:00
amd_iommu_v2.c IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
arm-smmu.c arm/smmu: Use irqsafe spinlock for domain lock 2014-02-20 13:04:47 +01:00
dmar.c iommu/vt-d: Update DRHD/RMRR/ATSR device scope caches when PCI hotplug happens 2014-03-04 17:51:06 +01:00
exynos-iommu.c iommu/exynos: Remove dead code (set_prefbuf) 2013-08-14 11:28:45 +02:00
fsl_pamu.c iommu/fsl: Remove unnecessary 'fsl-pamu' prefixes 2013-08-14 11:44:30 +02:00
fsl_pamu.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
fsl_pamu_domain.c iommu/fsl_pamu: Use dev_is_pci() to check whether it is pci device 2014-01-07 15:23:08 +01:00
fsl_pamu_domain.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
intel-iommu.c iommu/vt-d: Update DRHD/RMRR/ATSR device scope caches when PCI hotplug happens 2014-03-04 17:51:06 +01:00
intel_irq_remapping.c iommu/vt-d: Introduce a rwsem to protect global data structures 2014-03-04 17:51:05 +01:00
iommu-traces.c iommu: Add iommu_error class event to iommu trace 2013-09-25 11:07:04 +02:00
iommu.c Merge branches 'iommu/fixes', 'tracing', 'core', 'arm/tegra', 'x86/vt-d', 'arm/smmu' and 'arm/shmobile' into next 2013-11-01 14:44:25 +01:00
iova.c iommu: Fix typo in iommu 2012-07-24 12:58:49 +02:00
irq_remapping.c iommu/vt-d, trivial: clean sparse warnings 2014-01-09 12:44:16 +01:00
irq_remapping.h iommu/vt-d: add quirk for broken interrupt remapping on 55XX chipsets 2013-04-18 17:00:47 +02:00
Kconfig iommu: shmobile: Enable driver compilation with COMPILE_TEST 2014-01-07 15:10:11 +01:00
Makefile iommu: Add event tracing feature to iommu 2013-09-24 12:35:24 +02:00
msm_iommu.c iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu_dev.c drivers/iommu: remove unnecessary platform_set_drvdata() 2013-09-11 15:56:24 -07:00
msm_iommu_hw-8xxx.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
of_iommu.c iommu: add missing include 2014-01-07 15:16:27 +01:00
omap-iommu-debug.c drivers/iommu/omap-iommu-debug.c: fix decimal permissions 2014-02-25 15:25:42 -08:00
omap-iommu.c drivers/iommu: remove unnecessary platform_set_drvdata() 2013-09-11 15:56:24 -07:00
omap-iommu.h iommu/omap: Adapt to runtime pm 2012-12-03 18:48:23 +01:00
omap-iommu2.c iommu/omap: Adapt to runtime pm 2012-12-03 18:48:23 +01:00
omap-iopgtable.h drivers/iommu/omap-iopgtable.h: remove unneeded cast of void* 2013-11-13 12:09:00 +09:00
omap-iovmm.c iommu/omap: fix checkpatch warnings in omap iommu code 2013-06-20 16:53:26 +02:00
pci.h iommu: Move swap_pci_ref function to drivers/iommu/pci.h. 2013-04-23 14:55:00 +02:00
shmobile-iommu.c iommu/shmobile: Allocate archdata with kzalloc() 2014-01-07 15:35:25 +01:00
shmobile-ipmmu.c iommu/shmobile: Turn the flush_lock mutex into a spinlock 2014-01-07 15:35:25 +01:00
shmobile-ipmmu.h iommu/shmobile: Turn the flush_lock mutex into a spinlock 2014-01-07 15:35:25 +01:00
tegra-gart.c iommu/tegra-gart: Staticize tegra_gart_pm_ops 2013-11-01 14:23:20 +01:00
tegra-smmu.c iommu/tegra-smmu: Staticize tegra_smmu_pm_ops 2013-11-01 14:23:33 +01:00