Skip to content

Large Page Support for IOMMU-API and KVM

Joerg Roedel kvm lkml 1 version Applied

Status from this message: Applied to kvm.git since this makes sense independently of the rest of your patchset.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 17 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/11iommu-api: Rename ->{un}map function pointers to ->{un}map_rangearch/x86/kernel/amd_iommu.c drivers/base/iommu.c drivers/pci/intel-iommu.c +1 more+10 -100 replies
2/11iommu-api: Add iommu_map and iommu_unmap functionsdrivers/base/iommu.c include/linux/iommu.h+47 -03 replies
3/11iommu-api: Add ->{un}map callbacks to iommu_opsdrivers/base/iommu.c include/linux/iommu.h+10 -00 replies
4/11VT-d: Change {un}map_range functions to implement {un}map interfacedrivers/pci/intel-iommu.c+12 -104 replies
5/11kvm: Introduce kvm_host_page_sizearch/x86/kvm/mmu.c include/linux/kvm_host.h virt/kvm/kvm_main.c+28 -162 replies
6/11kvm: Change kvm_iommu_map_pages to map large pagesvirt/kvm/iommu.c+84 -2210 replies
7/11x86/amd-iommu: Make iommu_map_page and alloc_pte aware of page sizesarch/x86/include/asm/amd_iommu_types.h arch/x86/kernel/amd_iommu.c+61 -200 replies
8/11x86/amd-iommu: Make iommu_unmap_page and fetch_pte aware of page sizesarch/x86/include/asm/amd_iommu_types.h arch/x86/kernel/amd_iommu.c+78 -180 replies
9/11x86/amd-iommu: Make amd_iommu_iova_to_phys aware of multiple page sizesarch/x86/kernel/amd_iommu.c+9 -40 replies
10/11x86/amd-iommu: Implement ->{un}map callbacks for iommu-apiarch/x86/kernel/amd_iommu.c+29 -00 replies
11/11iommu-api: Remove iommu_{un}map_range functionsarch/x86/kernel/amd_iommu.c drivers/base/iommu.c include/linux/iommu.h+2 -920 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/11] Large Page Support for IOMMU-API and KVM

Hi,

here is a patch set which implements support for variable page sizes in the IOMMU-API and changes the KVM device passthrough code to map the guest physical memory with the best page sizes.

With this code a guest with 1GB of memory mapped with a 1GB page will not use 4kb PTEs in the IO page table but will map this memory with these page sizes:

512k, 128k, <io hole>, 1M, 2M, 4M, 8M, 16M, 32M, 64M, 128M, 256M and 512M

instead.

This code also changes the AMD IOMMU driver to implement these page sizes in the IO page tables.
Please review these patches and send me any comments you might have :-)

To test this code some fixes in the AMD IOMMU driver are required which are currently in the -tip tree and will probably hit upstream soon. If anybody want to test this code please pull the code from

git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git iommu/largepages

This branch is based on avi/master and contains the fixes and the patches from this patchset.

Thanks,

Joerg

Diffstat:

 arch/x86/include/asm/amd_iommu_types.h |   34 ++++++
 arch/x86/kernel/amd_iommu.c            |  195 ++++++++++++++++++++------------
 arch/x86/kvm/mmu.c                     |   18 +---
 drivers/base/iommu.c                   |   43 +++++---
 drivers/pci/intel-iommu.c              |   22 ++--
 include/linux/iommu.h                  |   24 ++--
 include/linux/kvm_host.h               |    1 +
 virt/kvm/iommu.c                       |  106 ++++++++++++++----
 virt/kvm/kvm_main.c                    |   25 ++++
 9 files changed, 323 insertions(+), 145 deletions(-)

Shortlog:

Joerg Roedel (11):
iommu-api: Rename ->{un}map function pointers to ->{un}map_range
iommu-api: Add iommu_map and iommu_unmap functions
iommu-api: Add ->{un}map callbacks to iommu_ops
VT-d: Change {un}map_range functions to implement {un}map interface
kvm: Introduce kvm_host_page_size
kvm: Change kvm_iommu_map_pages to map large pages x86/amd-iommu: Make iommu_map_page and alloc_pte aware of page sizes x86/amd-iommu: Make iommu_unmap_page and fetch_pte aware of page sizes x86/amd-iommu: Make amd_iommu_iova_to_phys aware of multiple page sizes x86/amd-iommu: Implement ->{un}map callbacks for iommu-api
iommu-api: Remove iommu_{un}map_range functions