remarkable-linux/drivers/iommu
Jiang Liu 3a5670e8ac iommu/vt-d: Introduce a rwsem to protect global data structures
Introduce a global rwsem dmar_global_lock, which will be used to
protect DMAR related global data structures from DMAR/PCI/memory
device hotplug operations in process context.

DMA and interrupt remapping related data structures are read most,
and only change when memory/PCI/DMAR hotplug event happens.
So a global rwsem solution is adopted for balance between simplicity
and performance.

For interrupt remapping driver, function intel_irq_remapping_supported(),
dmar_table_init(), intel_enable_irq_remapping(), disable_irq_remapping(),
reenable_irq_remapping() and enable_drhd_fault_handling() etc
are called during booting, suspending and resuming with interrupt
disabled, so no need to take the global lock.

For interrupt remapping entry allocation, the locking model is:
	down_read(&dmar_global_lock);
	/* Find corresponding iommu */
	iommu = map_hpet_to_ir(id);
	if (iommu)
		/*
		 * Allocate remapping entry and mark entry busy,
		 * the IOMMU won't be hot-removed until the
		 * allocated entry has been released.
		 */
		index = alloc_irte(iommu, irq, 1);
	up_read(&dmar_global_lock);

For DMA remmaping driver, we only uses the dmar_global_lock rwsem to
protect functions which are only called in process context. For any
function which may be called in interrupt context, we will use RCU
to protect them in following patches.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
2014-03-04 17:51:05 +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: Introduce a rwsem to protect global data structures 2014-03-04 17:51:05 +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: Introduce a rwsem to protect global data structures 2014-03-04 17:51:05 +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