[PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread aik
From: Alexey Kardashevskiy The IOMMU API implements groups creating/deletion, device binding and IOMMU map/unmap operations. The PowerPC implementation uses most of the API except map/unmap operations, which are implemented on POWER using hypercalls. However, in order to link a kernel with the

[PATCH 4/5] powerpc/vfio: Implement IOMMU driver for VFIO

2013-05-06 Thread aik
From: Alexey Kardashevskiy VFIO implements platform independent stuff such as a PCI driver, BAR access (via read/write on a file descriptor or direct mapping when possible) and IRQ signaling. The platform dependent part includes IOMMU initialization and handling. This implements an IOMMU

[PATCH 5/5] powerpc/vfio: Enable on pSeries platform

2013-05-06 Thread aik
From: Alexey Kardashevskiy The enables VFIO on the pSeries platform, enabling user space programs to access PCI devices directly. Signed-off-by: Alexey Kardashevskiy Cc: David Gibson Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/iommu.c |4 drivers/iommu/Kconfig

[PATCH 3/5] powerpc/vfio: Enable on POWERNV platform

2013-05-06 Thread aik
From: Alexey Kardashevskiy This initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by the VFIO driver, which is used for PCI pass through. It also implements an API for

[PATCH 1/5] iommu: Move initialization earlier

2013-05-06 Thread aik
From: Alexey Kardashevskiy The iommu_init() call initializes IOMMU internal structures and data required for the API to function such as iommu_group_alloc(). It is registered as a subsys_initcall. One of the IOMMU users is a PCI subsystem on POWER which discovers new IOMMU tables during the PCI

[PATCH 0/5] VFIO PPC64: add VFIO support on POWERPC64

2013-05-06 Thread aik
From: Alexey Kardashevskiy The series adds support for VFIO on POWERPC in user space (such as QEMU). The in-kernel real mode IOMMU support is added by another series posted separately. As the first and main aim of this series is the POWERNV platform support, the "Enable on POWERNV platform"

[PATCH 0/5] VFIO PPC64: add VFIO support on POWERPC64

2013-05-06 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru The series adds support for VFIO on POWERPC in user space (such as QEMU). The in-kernel real mode IOMMU support is added by another series posted separately. As the first and main aim of this series is the POWERNV platform support, the Enable on POWERNV

[PATCH 1/5] iommu: Move initialization earlier

2013-05-06 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru The iommu_init() call initializes IOMMU internal structures and data required for the API to function such as iommu_group_alloc(). It is registered as a subsys_initcall. One of the IOMMU users is a PCI subsystem on POWER which discovers new IOMMU tables

[PATCH 3/5] powerpc/vfio: Enable on POWERNV platform

2013-05-06 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru This initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by the VFIO driver, which is used for PCI pass through. It also implements

[PATCH 5/5] powerpc/vfio: Enable on pSeries platform

2013-05-06 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru The enables VFIO on the pSeries platform, enabling user space programs to access PCI devices directly. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Paul Mackerras pau...@samba.org ---

[PATCH 4/5] powerpc/vfio: Implement IOMMU driver for VFIO

2013-05-06 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru VFIO implements platform independent stuff such as a PCI driver, BAR access (via read/write on a file descriptor or direct mapping when possible) and IRQ signaling. The platform dependent part includes IOMMU initialization and handling. This implements

[PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru The IOMMU API implements groups creating/deletion, device binding and IOMMU map/unmap operations. The PowerPC implementation uses most of the API except map/unmap operations, which are implemented on POWER using hypercalls. However, in order to link a

[PATCH 4/4] vfio powerpc: added real mode support

2013-02-11 Thread aik
From: Alexey Kardashevskiy The patch allows the host kernel to handle H_PUT_TCE request without involving QEMU in it what should save time on switching from the kernel to QEMU and back. The patch adds an IOMMU ID parameter into the KVM_CAP_SPAPR_TCE ioctl, QEMU needs to be fixed to support

[PATCH 3/4] powerpc: preparing to support real mode optimization

2013-02-11 Thread aik
From: Alexey Kardashevskiy he current VFIO-on-POWER implementation supports only user mode driven mapping, i.e. QEMU is sending requests to map/unmap pages. However this approach is really slow in really fast hardware so it is better to be moved to the real mode. The patch adds an API to

[PATCH 2/4] powerpc kvm: added multiple TCEs requests support

2013-02-11 Thread aik
From: Alexey Kardashevskiy The patch adds real mode handlers for H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for QEMU emulated devices such as virtio devices or emulated PCI. These calls allow adding multiple entries (up to 512) into the TCE table in one call which saves time on transition

[PATCH 0/4] powerpc iommu: extending real mode support

2013-02-11 Thread aik
From: Alexey Kardashevskiy The first 2 patches in this set add a multi-tce support feature (adding/deleting several TCE records at once) in real and virtual mode. The last 2 patches enable real mode acceleration for VFIO and extend the multi-tce feature to be available for VFIO devices. The

[PATCH 1/4] powerpc: lookup_linux_pte has been made public

2013-02-11 Thread aik
From: Alexey Kardashevskiy The lookup_linux_pte() function returns a linux PTE which is required to convert KVM guest physical address into host real address in real mode. This convertion will be used by upcoming support of H_PUT_TCE_INDIRECT as TCE list address comes from the guest directly so

[PATCH 0/4] powerpc iommu: extending real mode support

2013-02-11 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru The first 2 patches in this set add a multi-tce support feature (adding/deleting several TCE records at once) in real and virtual mode. The last 2 patches enable real mode acceleration for VFIO and extend the multi-tce feature to be available for VFIO

[PATCH 1/4] powerpc: lookup_linux_pte has been made public

2013-02-11 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru The lookup_linux_pte() function returns a linux PTE which is required to convert KVM guest physical address into host real address in real mode. This convertion will be used by upcoming support of H_PUT_TCE_INDIRECT as TCE list address comes from the

[PATCH 2/4] powerpc kvm: added multiple TCEs requests support

2013-02-11 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru The patch adds real mode handlers for H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for QEMU emulated devices such as virtio devices or emulated PCI. These calls allow adding multiple entries (up to 512) into the TCE table in one call which saves time on

[PATCH 3/4] powerpc: preparing to support real mode optimization

2013-02-11 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru he current VFIO-on-POWER implementation supports only user mode driven mapping, i.e. QEMU is sending requests to map/unmap pages. However this approach is really slow in really fast hardware so it is better to be moved to the real mode. The patch adds an

[PATCH 4/4] vfio powerpc: added real mode support

2013-02-11 Thread aik
From: Alexey Kardashevskiy a...@ozlabs.ru The patch allows the host kernel to handle H_PUT_TCE request without involving QEMU in it what should save time on switching from the kernel to QEMU and back. The patch adds an IOMMU ID parameter into the KVM_CAP_SPAPR_TCE ioctl, QEMU needs to be fixed