android_kernel_google_msm/drivers/iommu
Woodhouse, David 16639bce52 intel-iommu: Free old page tables before creating superpage
commit 6491d4d028 upstream.

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 08:50:46 -08:00
..
amd_iommu.c iommu/amd: Fix hotplug with iommu=pt 2012-08-09 08:31:32 -07:00
amd_iommu_init.c iommu/amd: Fix missing iommu_shutdown initialization in passthrough mode 2012-07-16 09:03:51 -07:00
amd_iommu_proto.h iommu/amd: Add function to get IOMMUv2 domain for pdev 2011-12-12 15:19:05 +01:00
amd_iommu_types.h iommu/amd: Cache pdev pointer to root-bridge 2012-06-10 00:36:18 +09:00
amd_iommu_v2.c iommu/amd: Add missing spin_lock initialization 2012-08-09 08:31:31 -07:00
dmar.c iommu: Fix off by one in dmar_get_fault_reason() 2012-06-01 15:18:27 +08:00
intel-iommu.c intel-iommu: Free old page tables before creating superpage 2013-01-17 08:50:46 -08:00
intr_remapping.c irq_remap: disable IRQ remapping if any IOAPIC lacks an IOMMU 2012-10-02 10:30:38 -07:00
intr_remapping.h
iommu.c Merge branches 'iommu/page-sizes' and 'iommu/group-id' into next 2012-01-09 13:06:28 +01:00
iova.c
Kconfig ARM: IOMMU: Tegra30: Add iommu_ops for SMMU driver 2012-01-26 13:59:02 +01:00
Makefile ARM: IOMMU: Tegra30: Add iommu_ops for SMMU driver 2012-01-26 13:59:02 +01:00
msm_iommu.c iommu/msm: Fix error handling in msm_iommu_unmap() 2012-01-30 12:53:14 +01:00
msm_iommu_dev.c
omap-iommu-debug.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
omap-iommu.c ARM: OMAP: make iommu subsys_initcall to fix builtin omap3isp 2012-02-27 14:18:42 +01:00
omap-iovmm.c Merge branches 'iommu/fixes', 'arm/omap' and 'x86/amd' into next 2012-01-09 13:04:05 +01:00
tegra-gart.c iommu/tegra-gart: fix spin_unlock in map failure path 2012-03-13 11:17:42 +01:00
tegra-smmu.c iommu/tegra: smmu: Fix deadly typo 2012-10-28 10:14:15 -07:00