linux/drivers/iommu
Woodhouse, David 6491d4d028 intel-iommu: Free old page tables before creating superpage
The dma_pte_free_pagetable() function will only free a page table page
if it is asked to free the *entire* 2MiB range that it covers. So if a
page table page was used for one or more small mappings, it's likely to
end up still present in the page tables... but with no valid PTEs.

This was fine when we'd only be repopulating it with 4KiB PTEs anyway
but the same virtual address range can end up being reused for a
*large-page* mapping. And in that case were were trying to insert the
large page into the second-level page table, and getting a complaint
from the sanity check in __domain_mapping() because there was already a
corresponding entry. This was *relatively* harmless; it led to a memory
leak of the old page table page, but no other ill-effects.

Fix it by calling dma_pte_clear_range (hopefully redundant) and
dma_pte_free_pagetable() before setting up the new large page.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Ravi Murty <Ravi.Murty@intel.com>
Tested-by: Sudeep Dutt <sudeep.dutt@intel.com>
Cc: stable@kernel.org [3.0+]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-20 10:06:04 -08:00
..
amd_iommu_init.c iommu/amd: Work around wrong IOAPIC device-id in IVRS table 2012-10-16 14:52:51 +02:00
amd_iommu_proto.h iommu/amd: Add initialization routines for AMD interrupt remapping 2012-09-28 17:43:52 +02:00
amd_iommu_types.h Merge branches 'dma-debug', 'iommu/fixes', 'arm/tegra', 'arm/exynos', 'x86/amd', 'x86/vt-d' and 'x86/amd-irq-remapping' into next 2012-10-02 14:40:03 +02:00
amd_iommu_v2.c IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
amd_iommu.c Merge branches 'dma-debug', 'iommu/fixes', 'arm/tegra', 'arm/exynos', 'x86/amd', 'x86/vt-d' and 'x86/amd-irq-remapping' into next 2012-10-02 14:40:03 +02:00
dmar.c iommu/dmar: Use pr_format() instead of PREFIX to tidy up pr_*() calls 2012-06-11 10:27:44 +02:00
exynos-iommu.c iommu/exynos: use list_del_init instead of list_del/INIT_LIST_HEAD 2012-09-18 12:44:02 +02:00
intel_irq_remapping.c irq_remap: disable IRQ remapping if any IOAPIC lacks an IOMMU 2012-08-10 11:28:16 +02:00
intel-iommu.c intel-iommu: Free old page tables before creating superpage 2012-12-20 10:06:04 -08:00
iommu.c Merge branches 'iommu/fixes', 'x86/amd', 'groups', 'arm/tegra' and 'api/domain-attr' into next 2012-07-23 12:17:00 +02:00
iova.c iommu: Fix typo in iommu 2012-07-24 12:58:49 +02:00
irq_remapping.c iommu/irq: Use amd_iommu_irq_ops if supported 2012-09-28 17:43:53 +02:00
irq_remapping.h iommu/amd: Add initialization routines for AMD interrupt remapping 2012-09-28 17:43:52 +02:00
Kconfig iommu/amd: Check if IOAPIC information is correct 2012-09-28 17:31:09 +02:00
Makefile ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c 2012-11-20 10:04:41 -08:00
msm_iommu_dev.c
msm_iommu.c iommu/msm: Implement DOMAIN_ATTR_GEOMETRY attribute 2012-07-11 12:20:05 +02:00
of_iommu.c iommu: Add DMA window parser, of_get_dma_window() 2012-06-25 13:50:28 +02:00
omap-iommu2.c ARM: OMAP2+: Move iommu/iovmm headers to platform_data 2012-11-20 10:05:01 -08:00
omap-iommu-debug.c ARM: OMAP2+: Move iommu/iovmm headers to platform_data 2012-11-20 10:05:01 -08:00
omap-iommu.c ARM: OMAP2+: Move iommu/iovmm headers to platform_data 2012-11-20 10:05:01 -08:00
omap-iommu.h ARM: OMAP2+: Make some definitions local 2012-11-20 10:04:51 -08:00
omap-iopgtable.h ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c 2012-11-20 10:04:41 -08:00
omap-iovmm.c ARM: OMAP2+: Move iommu/iovmm headers to platform_data 2012-11-20 10:05:01 -08:00
tegra-gart.c iommu/tegra: Implement DOMAIN_ATTR_GEOMETRY attribute 2012-07-11 12:25:57 +02:00
tegra-smmu.c Linux 3.7-rc7 2012-11-25 21:34:34 -08:00