kernel_optimize_test/drivers/iommu
Ohad Ben-Cohen 7d3002cc8c iommu/core: split mapping to page sizes as supported by the hardware
When mapping a memory region, split it to page sizes as supported
by the iommu hardware. Always prefer bigger pages, when possible,
in order to reduce the TLB pressure.

The logic to do that is now added to the IOMMU core, so neither the iommu
drivers themselves nor users of the IOMMU API have to duplicate it.

This allows a more lenient granularity of mappings; traditionally the
IOMMU API took 'order' (of a page) as a mapping size, and directly let
the low level iommu drivers handle the mapping, but now that the IOMMU
core can split arbitrary memory regions into pages, we can remove this
limitation, so users don't have to split those regions by themselves.

Currently the supported page sizes are advertised once and they then
remain static. That works well for OMAP and MSM but it would probably
not fly well with intel's hardware, where the page size capabilities
seem to have the potential to be different between several DMA
remapping devices.

register_iommu() currently sets a default pgsize behavior, so we can convert
the IOMMU drivers in subsequent patches. After all the drivers
are converted, the temporary default settings will be removed.

Mainline users of the IOMMU API (kvm and omap-iovmm) are adopted
to deal with bytes instead of page order.

Many thanks to Joerg Roedel <Joerg.Roedel@amd.com> for significant review!

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Cc: David Brown <davidb@codeaurora.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Joerg Roedel <Joerg.Roedel@amd.com>
Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: KyongHo Cho <pullip.cho@samsung.com>
Cc: Hiroshi DOYU <hdoyu@nvidia.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: kvm@vger.kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-11-10 11:40:37 +01:00
..
amd_iommu_init.c
amd_iommu_proto.h
amd_iommu_types.h
amd_iommu.c iommu/core: stop converting bytes to page order back and forth 2011-11-10 11:40:37 +01:00
dmar.c Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2011-10-26 16:17:32 +02:00
intel-iommu.c iommu/core: stop converting bytes to page order back and forth 2011-11-10 11:40:37 +01:00
intr_remapping.c Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2011-10-26 16:17:32 +02:00
intr_remapping.h
iommu.c iommu/core: split mapping to page sizes as supported by the hardware 2011-11-10 11:40:37 +01:00
iova.c
Kconfig Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu 2011-10-30 15:46:19 -07:00
Makefile Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu 2011-10-30 15:46:19 -07:00
msm_iommu_dev.c
msm_iommu.c iommu/core: stop converting bytes to page order back and forth 2011-11-10 11:40:37 +01:00
omap-iommu-debug.c omap: iommu: omapify 'struct iommu' and exposed API 2011-08-26 11:46:01 +02:00
omap-iommu.c iommu/core: stop converting bytes to page order back and forth 2011-11-10 11:40:37 +01:00
omap-iovmm.c iommu/core: split mapping to page sizes as supported by the hardware 2011-11-10 11:40:37 +01:00