[PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-06-26 Thread Alexey Kardashevskiy
and we may want to optimize this. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/06/27: * list of huge pages replaces with hashtable for better performance * spinlock removed from real mode and only protects insertion of new huge

[PATCH v2] vfio: add external user support

2013-06-27 Thread Alexey Kardashevskiy
. The vfio: Limit group opens patch is also required for the consistency. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- v1-v2: added definitions to vfio.h :) Should not compile but compiled. Hm. --- drivers/vfio/vfio.c | 54 ++ include/linux

Re: [PATCH 3/8] vfio: add external user support

2013-06-27 Thread Alexey Kardashevskiy
On 06/27/2013 07:42 PM, Benjamin Herrenschmidt wrote: On Thu, 2013-06-27 at 16:59 +1000, Stephen Rothwell wrote: +/* Allows an external user (for example, KVM) to unlock an IOMMU group */ +static void vfio_group_del_external_user(struct file *filep) +{ + struct vfio_group *group =

Re: [PATCH v2] vfio: add external user support

2013-06-27 Thread Alexey Kardashevskiy
On 06/28/2013 01:44 AM, Alex Williamson wrote: On Thu, 2013-06-27 at 17:14 +1000, Alexey Kardashevskiy wrote: VFIO is designed to be used via ioctls on file descriptors returned by VFIO. However in some situations support for an external user is required. The first user is KVM on PPC64

Re: [PATCH v2] vfio: add external user support

2013-06-27 Thread Alexey Kardashevskiy
On 06/28/2013 10:41 AM, Alex Williamson wrote: On Fri, 2013-06-28 at 08:57 +1000, Alexey Kardashevskiy wrote: On 06/28/2013 01:44 AM, Alex Williamson wrote: On Thu, 2013-06-27 at 17:14 +1000, Alexey Kardashevskiy wrote: VFIO is designed to be used via ioctls on file descriptors returned

Re: [PATCH v2] vfio: add external user support

2013-06-27 Thread Alexey Kardashevskiy
On 06/28/2013 12:37 PM, Alex Williamson wrote: On Fri, 2013-06-28 at 11:38 +1000, Alexey Kardashevskiy wrote: On 06/28/2013 10:41 AM, Alex Williamson wrote: On Fri, 2013-06-28 at 08:57 +1000, Alexey Kardashevskiy wrote: On 06/28/2013 01:44 AM, Alex Williamson wrote: On Thu, 2013-06-27 at 17

[PATCH] hashtable: add hash_for_each_possible_rcu_notrace()

2013-07-05 Thread Alexey Kardashevskiy
This adds hash_for_each_possible_rcu_notrace() which is basically a notrace clone of hash_for_each_possible_rcu() which cannot be used in real mode due to its tracing/debugging capability. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- include/linux/hashtable.h | 15 +++ 1

[PATCH 0/8 v5] KVM: PPC: IOMMU in-kernel handling

2013-07-06 Thread Alexey Kardashevskiy
hash_for_each_possible_rcu_notrace(), posted earlier today. Alexey Kardashevskiy (8): KVM: PPC: reserve a capability number for multitce support KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO vfio: add external user support powerpc: Prepare to support kernel handling of IOMMU map/unmap powerpc

[PATCH 1/8] KVM: PPC: reserve a capability number for multitce support

2013-07-06 Thread Alexey Kardashevskiy
This is to reserve a capablity number for upcoming support of H_PUT_TCE_INDIRECT and H_STUFF_TCE pseries hypercalls which support mulptiple DMA map/unmap operations per one call. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- include/uapi/linux/kvm.h | 1 + 1 file changed, 1 insertion

[PATCH 2/8] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-07-06 Thread Alexey Kardashevskiy
This is to reserve a capablity number for upcoming support of VFIO-IOMMU DMA operations in real mode. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- include/uapi/linux/kvm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index

[PATCH 3/8] vfio: add external user support

2013-07-06 Thread Alexey Kardashevskiy
an iommu_group struct for later use. 4. When KVM is finished, it calls vfio_group_put_external_user() to release the VFIO group by decrementing the container user counter. Everything gets released. The vfio: Limit group opens patch is also required for the consistency. Signed-off-by: Alexey

[PATCH 4/8] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-07-06 Thread Alexey Kardashevskiy
-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/06/27: * realmode_get_page() fixed to use get_page_unless_zero(). If failed, the call will be passed from real to virtual mode and safely handled. * added comment to PageCompound() in include

[PATCH 6/8] KVM: PPC: Add support for multiple-TCE hcalls

2013-07-06 Thread Alexey Kardashevskiy
the functionality of this patch, QEMU needs to query for this capability and set the hcall-multi-tce hypertas property only if the capability is present, otherwise there will be serious performance degradation. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru

[PATCH 5/8] powerpc: add real mode support for dma operations on powernv

2013-07-06 Thread Alexey Kardashevskiy
instruction for TCE invalidation. This new feature is going to be utilized by real mode support of VFIO. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/machdep.h| 12 ++ arch/powerpc/platforms/powernv/pci-ioda.c | 26 +++-- arch

[PATCH 7/8] KVM: PPC: Add support for IOMMU in-kernel handling

2013-07-06 Thread Alexey Kardashevskiy
user API support in VFIO is required. Tests show that this patch increases transmission speed from 220MB/s to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07

[PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-07-06 Thread Alexey Kardashevskiy
and we may want to optimize this. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/06/27: * list of huge pages replaces with hashtable for better performance * spinlock removed from real mode and only protects insertion of new huge

[PATCH v2] powerpc: add real mode support for dma operations on powernv

2013-07-07 Thread Alexey Kardashevskiy
instruction for TCE invalidation. This new feature is going to be utilized by real mode support of VFIO. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/08/07: * tested on p7ioc and fixed a bug with realmode addresses Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch

Re: [PATCH v2] powerpc: add real mode support for dma operations on powernv

2013-07-08 Thread Alexey Kardashevskiy
On 07/08/2013 05:20 PM, Benjamin Herrenschmidt wrote: On Mon, 2013-07-08 at 14:44 +1000, Alexey Kardashevskiy wrote: diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h index 25d76c4..7ea82c1 100644 --- a/arch/powerpc/platforms/powernv/pci.h +++ b/arch

Re: [PATCH 3/8] vfio: add external user support

2013-07-08 Thread Alexey Kardashevskiy
On 07/09/2013 07:52 AM, Alex Williamson wrote: On Sun, 2013-07-07 at 01:07 +1000, Alexey Kardashevskiy wrote: VFIO is designed to be used via ioctls on file descriptors returned by VFIO. However in some situations support for an external user is required. The first user is KVM on PPC64

Re: [PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-07-09 Thread Alexey Kardashevskiy
On 07/10/2013 03:32 AM, Alexander Graf wrote: On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: This adds special support for huge pages (16MB). The reference counting cannot be easily done for such pages in real mode (when MMU is off) so we added a list of huge pages. It is populated

Re: [PATCH 2/8] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-07-09 Thread Alexey Kardashevskiy
On 07/10/2013 01:35 AM, Alexander Graf wrote: On 06/27/2013 07:02 AM, Alexey Kardashevskiy wrote: Signed-off-by: Alexey Kardashevskiya...@ozlabs.ru --- include/uapi/linux/kvm.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h

Re: [PATCH 5/8] powerpc: add real mode support for dma operations on powernv

2013-07-09 Thread Alexey Kardashevskiy
On 07/10/2013 02:02 AM, Alexander Graf wrote: On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: The existing TCE machine calls (tce_build and tce_free) only support virtual mode as they call __raw_writeq for TCE invalidation what fails in real mode. This introduces tce_build_rm

Re: [PATCH 6/8] KVM: PPC: Add support for multiple-TCE hcalls

2013-07-09 Thread Alexey Kardashevskiy
On 07/10/2013 03:02 AM, Alexander Graf wrote: On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: This adds real mode handlers for the H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for QEMU emulated devices such as IBMVIO devices or emulated PCI. These calls allow adding multiple entries (up

Re: [PATCH 2/8] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-07-10 Thread Alexey Kardashevskiy
On 07/10/2013 08:27 PM, Alexander Graf wrote: On 10.07.2013, at 01:35, Alexey Kardashevskiy wrote: On 07/10/2013 01:35 AM, Alexander Graf wrote: On 06/27/2013 07:02 AM, Alexey Kardashevskiy wrote: Signed-off-by: Alexey Kardashevskiya...@ozlabs.ru --- include/uapi/linux/kvm.h |2

Re: [PATCH 6/8] KVM: PPC: Add support for multiple-TCE hcalls

2013-07-10 Thread Alexey Kardashevskiy
On 07/10/2013 08:05 PM, Alexander Graf wrote: On 10.07.2013, at 07:00, Alexey Kardashevskiy wrote: On 07/10/2013 03:02 AM, Alexander Graf wrote: On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: This adds real mode handlers for the H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for QEMU

Re: [PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-07-11 Thread Alexey Kardashevskiy
On 07/10/2013 03:32 AM, Alexander Graf wrote: On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: This adds special support for huge pages (16MB). The reference counting cannot be easily done for such pages in real mode (when MMU is off) so we added a list of huge pages. It is populated

Re: [PATCH 6/8] KVM: PPC: Add support for multiple-TCE hcalls

2013-07-11 Thread Alexey Kardashevskiy
On 07/11/2013 10:51 PM, Alexander Graf wrote: On 11.07.2013, at 14:39, Benjamin Herrenschmidt wrote: On Thu, 2013-07-11 at 13:15 +0200, Alexander Graf wrote: And that's bad. Jeez, seriously. Don't argue this case. We enable new features individually unless we're 100% sure we can keep

Re: [PATCH 6/8] KVM: PPC: Add support for multiple-TCE hcalls

2013-07-11 Thread Alexey Kardashevskiy
On 07/11/2013 10:58 PM, Benjamin Herrenschmidt wrote: On Thu, 2013-07-11 at 14:51 +0200, Alexander Graf wrote: I don't like bloat usually. But Alexey even had an #ifdef DEBUG in there to selectively disable in-kernel handling of multi-TCE. Not calling ENABLE_CAP would give him exactly that

Re: [PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-07-11 Thread Alexey Kardashevskiy
On 07/11/2013 11:41 PM, chandrashekar shastri wrote: Hi All, I complied the latest kernel 3.10.0+ pulled from the git on top of 3.10.0-rc5+ by enabling the new Virtualiztaion features. The compliation was sucessfull, when I rebooted the machine it fails to boot with error as systemd [1] :

Re: [PATCH] hashtable: add hash_for_each_possible_rcu_notrace()

2013-07-15 Thread Alexey Kardashevskiy
Anyone, ping? On 07/06/2013 02:16 PM, Alexey Kardashevskiy wrote: This adds hash_for_each_possible_rcu_notrace() which is basically a notrace clone of hash_for_each_possible_rcu() which cannot be used in real mode due to its tracing/debugging capability. Signed-off-by: Alexey Kardashevskiy

[PATCH 01/10] KVM: PPC: reserve a capability number for multitce support

2013-07-15 Thread Alexey Kardashevskiy
This is to reserve a capablity number for upcoming support of H_PUT_TCE_INDIRECT and H_STUFF_TCE pseries hypercalls which support mulptiple DMA map/unmap operations per one call. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/16: * changed the number Signed-off

[PATCH 00/10 v6] KVM: PPC: IOMMU in-kernel handling

2013-07-15 Thread Alexey Kardashevskiy
for KVM_BOOK3S_64. MOre details in the individual patch comments. Depends on hashtable: add hash_for_each_possible_rcu_notrace(), posted a while ago. Alexey Kardashevskiy (10): KVM: PPC: reserve a capability number for multitce support KVM: PPC: reserve a capability and ioctl numbers

[PATCH 02/10] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-07-15 Thread Alexey Kardashevskiy
This is to reserve a capablity number for upcoming support of VFIO-IOMMU DMA operations in real mode. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/16: * changed the number 2013/07/11: * changed order in a file, added comment about a gap in ioctl number Signed-off

[PATCH 04/10] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-07-15 Thread Alexey Kardashevskiy
...@samba.org Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/10: * adjusted comment (removed sentence about virtual mode) * get_page_unless_zero replaced with atomic_inc_not_zero to minimize effect of a possible

[PATCH 03/10] vfio: add external user support

2013-07-15 Thread Alexey Kardashevskiy
, it calls vfio_group_put_external_user() to release the VFIO group. This call decrements the container user counter. Everything gets released. The vfio: Limit group opens patch is also required for the consistency. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/11: * added

[PATCH 05/10] powerpc: add real mode support for dma operations on powernv

2013-07-15 Thread Alexey Kardashevskiy
instruction for TCE invalidation. This new feature is going to be utilized by real mode support of VFIO. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/11/07: * added comment why stdcix cannot be used in virtual mode 2013/08/07: * tested on p7ioc and fixed a bug with realmode

[PATCH 07/10] KVM: PPC: Add support for multiple-TCE hcalls

2013-07-15 Thread Alexey Kardashevskiy
successfully in the kernel based fast path. If they can not be handled by the kernel, they will get passed on to user space. So user space still has to have an implementation for these despite the in kernel acceleration. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy

[PATCH 06/10] KVM: PPC: enable IOMMU_API for KVM_BOOK3S_64 permanently

2013-07-15 Thread Alexey Kardashevskiy
space emulated devices which do not seem to be in use very often. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index c55c538..3b2b761 100644 --- a/arch/powerpc/kvm

[PATCH 08/10] powerpc/iommu: rework to support realmode

2013-07-15 Thread Alexey Kardashevskiy
. iommu_tce_direction is static now as it is not called from anywhere else. This will be used by upcoming real mode support of VFIO on POWER. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/iommu.h | 9 +- arch/powerpc/kernel/iommu.c | 197

[PATCH 10/10] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-07-15 Thread Alexey Kardashevskiy
. However this can change and we may want to optimize this. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/12: * removed multiple #ifdef IOMMU_API as IOMMU_API is always enabled for KVM_BOOK3S_64 2013/06/27: * list of huge pages

[PATCH 09/10] KVM: PPC: Add support for IOMMU in-kernel handling

2013-07-15 Thread Alexey Kardashevskiy
-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/11: * removed multiple #ifdef IOMMU_API as IOMMU_API is always enabled for KVM_BOOK3S_64 * kvmppc_gpa_to_hva_and_get also returns host phys address. Not much sense for this here but the next

Re: [PATCH 00/10 v6] KVM: PPC: IOMMU in-kernel handling

2013-07-18 Thread Alexey Kardashevskiy
On 07/16/2013 10:53 AM, Alexey Kardashevskiy wrote: The changes are: 1. rebased on v3.11-rc1 so the capability numbers changed again 2. fixed multiple comments from maintainers 3. KVM: PPC: Add support for IOMMU in-kernel handling is split into 2 patches, the new one is powerpc/iommu: rework

Re: [PATCH 04/10] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-07-22 Thread Alexey Kardashevskiy
Ping, anyone, please? Ben needs ack from any of MM people before proceeding with this patch. Thanks! On 07/16/2013 10:53 AM, Alexey Kardashevskiy wrote: The current VFIO-on-POWER implementation supports only user mode driven mapping, i.e. QEMU is sending requests to map/unmap pages. However

Re: [PATCH] hashtable: add hash_for_each_possible_rcu_notrace()

2013-07-22 Thread Alexey Kardashevskiy
Anyone, ping. Is it good, bad, ugly (ack/nack)? Thanks! Is there any trivial patches list? Could not find it on vger. On 07/15/2013 08:04 PM, Alexey Kardashevskiy wrote: Anyone, ping? On 07/06/2013 02:16 PM, Alexey Kardashevskiy wrote: This adds hash_for_each_possible_rcu_notrace() which

Re: [PATCH] hashtable: add hash_for_each_possible_rcu_notrace()

2013-07-22 Thread Alexey Kardashevskiy
On 07/23/2013 12:41 PM, Joe Perches wrote: On Tue, 2013-07-23 at 12:28 +1000, Alexey Kardashevskiy wrote: Anyone, ping. Is it good, bad, ugly (ack/nack)? Thanks! Is there any trivial patches list? Could not find it on vger. Jiri Kosina has triv...@kernel.org Also, there's kernel-janitors

Re: [PATCH 03/10] vfio: add external user support

2013-07-23 Thread Alexey Kardashevskiy
On 07/23/2013 12:23 PM, Alex Williamson wrote: On Tue, 2013-07-16 at 10:53 +1000, Alexey Kardashevskiy wrote: VFIO is designed to be used via ioctls on file descriptors returned by VFIO. However in some situations support for an external user is required. The first user is KVM on PPC64

[PATCH] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-07-25 Thread Alexey Kardashevskiy
in realmode_get_page() and realmode_put_page() Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/pgtable-ppc64.h | 2 ++ arch/powerpc/mm/init_64.c| 54 +++- include/linux/mm.h | 14 + include/linux/page

Re: [PATCH] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-07-25 Thread Alexey Kardashevskiy
On 07/25/2013 08:26 PM, Alexey Kardashevskiy wrote: The 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, so we want to move that to KVM. Since H_PUT_TCE can be extremely

[PATCH 00/10 v7] KVM: PPC: IOMMU in-kernel handling

2013-07-31 Thread Alexey Kardashevskiy
hash_for_each_possible_rcu_notrace(), Ben suggested to push it via his tree so I included it to the series. 4. realmode_(get|put)_page is reworked. More details in the individual patch comments. Alexey Kardashevskiy (10): hashtable: add hash_for_each_possible_rcu_notrace() KVM: PPC: reserve a capability number for multitce

[PATCH 01/10] hashtable: add hash_for_each_possible_rcu_notrace()

2013-07-31 Thread Alexey Kardashevskiy
This adds hash_for_each_possible_rcu_notrace() which is basically a notrace clone of hash_for_each_possible_rcu() which cannot be used in real mode due to its tracing/debugging capability. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- include/linux/hashtable.h | 15 +++ 1

[PATCH 02/10] KVM: PPC: reserve a capability number for multitce support

2013-07-31 Thread Alexey Kardashevskiy
This is to reserve a capablity number for upcoming support of H_PUT_TCE_INDIRECT and H_STUFF_TCE pseries hypercalls which support mulptiple DMA map/unmap operations per one call. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/16: * changed the number Signed-off

[PATCH 03/10] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-07-31 Thread Alexey Kardashevskiy
This is to reserve a capablity number for upcoming support of VFIO-IOMMU DMA operations in real mode. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/16: * changed the number 2013/07/11: * changed order in a file, added comment about a gap in ioctl number Signed-off

[PATCH 04/10] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-07-31 Thread Alexey Kardashevskiy
-foundation.org Reviewed-by: Paul Mackerras pau...@samba.org Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/25 (v7): * removed realmode_put_page and added put_page_unless_one() instead. The name has been chosen to conform the already

[PATCH 05/10] powerpc: add real mode support for dma operations on powernv

2013-07-31 Thread Alexey Kardashevskiy
instruction for TCE invalidation. This new feature is going to be utilized by real mode support of VFIO. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/11/07: * added comment why stdcix cannot be used in virtual mode 2013/08/07: * tested on p7ioc and fixed a bug with realmode

[PATCH 07/10] KVM: PPC: Add support for multiple-TCE hcalls

2013-07-31 Thread Alexey Kardashevskiy
successfully in the kernel based fast path. If they can not be handled by the kernel, they will get passed on to user space. So user space still has to have an implementation for these despite the in kernel acceleration. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy

[PATCH 06/10] KVM: PPC: enable IOMMU_API for KVM_BOOK3S_64 permanently

2013-07-31 Thread Alexey Kardashevskiy
*. With those ifdef's we could have only user space emulated devices accelerated (but not VFIO) which do not seem to be very useful. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/Kconfig b/arch

[PATCH 08/10] powerpc/iommu: rework to support realmode

2013-07-31 Thread Alexey Kardashevskiy
. iommu_tce_direction is static now as it is not called from anywhere else. This will be used by upcoming real mode support of VFIO on POWER. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/iommu.h | 9 +- arch/powerpc/kernel/iommu.c | 198

[PATCH 09/10] KVM: PPC: Add support for IOMMU in-kernel handling

2013-07-31 Thread Alexey Kardashevskiy
-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/11: * removed multiple #ifdef IOMMU_API as IOMMU_API is always enabled for KVM_BOOK3S_64 * kvmppc_gpa_to_hva_and_get also returns host phys address. Not much sense for this here but the next

[PATCH 10/10] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-07-31 Thread Alexey Kardashevskiy
. However this can change and we may want to optimize this. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/12: * removed multiple #ifdef IOMMU_API as IOMMU_API is always enabled for KVM_BOOK3S_64 2013/06/27: * list of huge pages

Re: Powerpc: Kernel warn_on when enabling IOMMU_API

2013-08-12 Thread Alexey Kardashevskiy
On 08/12/2013 08:20 PM, Bhushan Bharat-R65777 wrote: And this simple fix work for me diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index b20ff17..8869b0d 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -48,6 +48,8 @@ #include

Re: Powerpc: Kernel warn_on when enabling IOMMU_API

2013-08-12 Thread Alexey Kardashevskiy
On 08/13/2013 02:14 AM, Bhushan Bharat-R65777 wrote: -Original Message- From: Alexey Kardashevskiy [mailto:a...@ozlabs.ru] Sent: Monday, August 12, 2013 7:44 PM To: Bhushan Bharat-R65777 Cc: b...@kernel.crashing.org; linuxppc-dev@lists.ozlabs.org Subject: Re: Powerpc: Kernel

Re: Powerpc: Kernel warn_on when enabling IOMMU_API

2013-08-13 Thread Alexey Kardashevskiy
On 08/13/2013 08:44 PM, Bhushan Bharat-R65777 wrote: -Original Message- From: Alexey Kardashevskiy [mailto:a...@ozlabs.ru] Sent: Tuesday, August 13, 2013 5:41 AM To: Bhushan Bharat-R65777 Cc: b...@kernel.crashing.org; linuxppc-dev@lists.ozlabs.org Subject: Re: Powerpc: Kernel

[PATCH] Revert cxgb3: Check and handle the dma mapping errors

2013-08-14 Thread Alexey Kardashevskiy
...@linux-foundation.org Cc: Santosh Rastapur sant...@chelsio.com Cc: Jay Fenlason fenla...@redhat.com Cc: David S. Miller da...@davemloft.net Cc: Divy Le ray d...@chelsio.com Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- drivers/net/ethernet/chelsio/cxgb3/sge.c | 107

[PATCH] KVM: PPC: POWERNV: move iommu_add_device earlier

2013-08-14 Thread Alexey Kardashevskiy
() and iommu_del_device() are public now. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/iommu.h| 2 ++ arch/powerpc/kernel/iommu.c | 41 +++-- arch/powerpc/platforms/powernv/pci-ioda.c | 12 ++--- arch/powerpc/platforms/powernv

[PATCH v2] KVM: PPC: move iommu_add_device earlier

2013-08-14 Thread Alexey Kardashevskiy
driver. iommu_add_device() and iommu_del_device() are public now. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v2: * added a helper - set_iommu_table_base_and_group - which does set_iommu_table_base() and iommu_add_device() --- arch/powerpc/include/asm/iommu.h

Re: [PATCH 03/10] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-08-15 Thread Alexey Kardashevskiy
On 08/15/2013 05:16 PM, Alexander Graf wrote: On 01.08.2013, at 06:44, Alexey Kardashevskiy wrote: This is to reserve a capablity number for upcoming support of VFIO-IOMMU DMA operations in real mode. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/16

Re: [PATCH 03/10] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-08-15 Thread Alexey Kardashevskiy
On 08/15/2013 05:25 PM, Alexander Graf wrote: On 15.08.2013, at 09:24, Alexander Graf wrote: On 15.08.2013, at 09:22, Alexey Kardashevskiy wrote: On 08/15/2013 05:16 PM, Alexander Graf wrote: On 01.08.2013, at 06:44, Alexey Kardashevskiy wrote: This is to reserve a capablity number

[PATCH v8] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-08-15 Thread Alexey Kardashevskiy
the KVM_CREATE_SPAPR_TCE_IOMMU ioclt gets 0xaf. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/08/15 v8: * fixed comment again 2013/08/15: * fixed mistype in comments * fixed commit message which says what uses ioctls 0xad and 0xae 2013/07/16: * changed the number 2013/07/11: * changed

Re: [PATCH 03/10] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-08-15 Thread Alexey Kardashevskiy
On 08/15/2013 05:43 PM, Alexander Graf wrote: On 15.08.2013, at 09:42, Alexey Kardashevskiy wrote: On 08/15/2013 05:25 PM, Alexander Graf wrote: On 15.08.2013, at 09:24, Alexander Graf wrote: On 15.08.2013, at 09:22, Alexey Kardashevskiy wrote: On 08/15/2013 05:16 PM, Alexander Graf

Re: [PATCH 2/2] powerpc/iommu: check dev-iommu_group before remove a device from iommu_group

2013-08-16 Thread Alexey Kardashevskiy
On 08/16/2013 08:08 PM, Wei Yang wrote: --- arch/powerpc/kernel/iommu.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index b20ff17..5abf7c3 100644 --- a/arch/powerpc/kernel/iommu.c +++

Re: [PATCH 2/2] powerpc/iommu: check dev-iommu_group before remove a device from iommu_group

2013-08-18 Thread Alexey Kardashevskiy
On 08/19/2013 11:29 AM, Wei Yang wrote: On Fri, Aug 16, 2013 at 08:15:36PM +1000, Alexey Kardashevskiy wrote: On 08/16/2013 08:08 PM, Wei Yang wrote: --- arch/powerpc/kernel/iommu.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/iommu.c b/arch

Re: [PATCH 2/2] powerpc/iommu: check dev-iommu_group before remove a device from iommu_group

2013-08-22 Thread Alexey Kardashevskiy
On 08/19/2013 11:55 AM, Wei Yang wrote: On Mon, Aug 19, 2013 at 11:39:49AM +1000, Alexey Kardashevskiy wrote: On 08/19/2013 11:29 AM, Wei Yang wrote: On Fri, Aug 16, 2013 at 08:15:36PM +1000, Alexey Kardashevskiy wrote: On 08/16/2013 08:08 PM, Wei Yang wrote: --- arch/powerpc/kernel/iommu.c

Re: [PATCH v8] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-08-27 Thread Alexey Kardashevskiy
On 08/27/2013 05:56 PM, Gleb Natapov wrote: On Thu, Aug 15, 2013 at 05:49:26PM +1000, Alexey Kardashevskiy wrote: This is to reserve a capablity number for upcoming support of VFIO-IOMMU DMA operations in real mode. The last ioctl in the group which KVM_CREATE_SPAPR_TCE_IOMMU is added

Re: [PATCH v8] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-08-27 Thread Alexey Kardashevskiy
On 08/27/2013 08:58 PM, Gleb Natapov wrote: On Tue, Aug 27, 2013 at 06:42:18PM +1000, Alexey Kardashevskiy wrote: On 08/27/2013 05:56 PM, Gleb Natapov wrote: On Thu, Aug 15, 2013 at 05:49:26PM +1000, Alexey Kardashevskiy wrote: This is to reserve a capablity number for upcoming support

[PATCH v9 00/13] KVM: PPC: IOMMU in-kernel handling of VFIO

2013-08-28 Thread Alexey Kardashevskiy
: add hash_for_each_possible_rcu_notrace(), Ben suggested to push it via his tree so I included it to the series. * realmode_(get|put)_page is reworked. More details in the individual patch comments. Alexey Kardashevskiy (13): KVM: PPC: POWERNV: move iommu_add_device earlier hashtable: add

[PATCH v9 01/13] KVM: PPC: POWERNV: move iommu_add_device earlier

2013-08-28 Thread Alexey Kardashevskiy
() and iommu_del_device() are public now. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v8: * added the check for iommu_group!=NULL before removing device from a group as suggested by Wei Yang weiy...@linux.vnet.ibm.com v2: * added a helper - set_iommu_table_base_and_group - which does

[PATCH v9 02/13] hashtable: add hash_for_each_possible_rcu_notrace()

2013-08-28 Thread Alexey Kardashevskiy
This adds hash_for_each_possible_rcu_notrace() which is basically a notrace clone of hash_for_each_possible_rcu() which cannot be used in real mode due to its tracing/debugging capability. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v8: * fixed warnings from check_patch.pl

[PATCH v9 03/13] KVM: PPC: reserve a capability number for multitce support

2013-08-28 Thread Alexey Kardashevskiy
This is to reserve a capablity number for upcoming support of H_PUT_TCE_INDIRECT and H_STUFF_TCE pseries hypercalls which support mulptiple DMA map/unmap operations per one call. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/16: * changed the number --- include/uapi

[PATCH v9 04/13] KVM: PPC: reserve a capability and KVM device type for realmode VFIO

2013-08-28 Thread Alexey Kardashevskiy
to be used for initialization. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v9: * KVM ioctl is replaced with SPAPR TCE IOMMU KVM device type with KVM_DEV_SPAPR_TCE_IOMMU_ATTR_LINKAGE attribute 2013/08/15: * fixed mistype in comments * fixed commit message which says what uses

[PATCH v9 05/13] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-08-28 Thread Alexey Kardashevskiy
-foundation.org Reviewed-by: Paul Mackerras pau...@samba.org Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/25 (v7): * removed realmode_put_page and added put_page_unless_one() instead. The name has been chosen to conform the already

[PATCH v9 06/13] powerpc: add real mode support for dma operations on powernv

2013-08-28 Thread Alexey Kardashevskiy
instruction for TCE invalidation. This new feature is going to be utilized by real mode support of VFIO. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v8: * fixed check_patch.pl warnings 2013/11/07: * added comment why stdcix cannot be used in virtual mode 2013/08/07: * tested

[PATCH v9 07/13] KVM: PPC: enable IOMMU_API for KVM_BOOK3S_64 permanently

2013-08-28 Thread Alexey Kardashevskiy
*. With those ifdef's we could have only user space emulated devices accelerated (but not VFIO) which do not seem to be very useful. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/Kconfig b/arch

[PATCH v9 08/13] KVM: PPC: Add support for multiple-TCE hcalls

2013-08-28 Thread Alexey Kardashevskiy
successfully in the kernel based fast path. If they can not be handled by the kernel, they will get passed on to user space. So user space still has to have an implementation for these despite the in kernel acceleration. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy

[PATCH v9 09/13] powerpc/iommu: rework to support realmode

2013-08-28 Thread Alexey Kardashevskiy
. iommu_tce_direction is static now as it is not called from anywhere else. This will be used by upcoming real mode support of VFIO on POWER. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v8: * fixed warnings from check_patch.pl --- arch/powerpc/include/asm/iommu.h | 9 +- arch

[PATCH v9 10/13] KVM: PPC: remove warning from kvmppc_core_destroy_vm

2013-08-28 Thread Alexey Kardashevskiy
in real life and there is no any obvious place to put it. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/kvm/book3s_hv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 9e823ad..5f15ff7 100644 --- a/arch

[PATCH v9 11/13] KVM: PPC: add trampolines for VFIO external API

2013-08-28 Thread Alexey Kardashevskiy
KVM is going to use VFIO's external API. However KVM can operate even VFIO is not compiled or loaded so KVM is linked to VFIO dynamically. This adds proxy functions for VFIO external API. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/kvm/book3s_64_vio.c | 49

[PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-08-28 Thread Alexey Kardashevskiy
between KVM and VFIO. Tests show that this patch increases transmission speed from 220MB/s to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v9

[PATCH v9 13/13] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-08-28 Thread Alexey Kardashevskiy
. However this can change and we may want to optimize this. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: 2013/07/12: * removed multiple #ifdef IOMMU_API as IOMMU_API is always enabled for KVM_BOOK3S_64 2013/06/27: * list of huge pages

Re: [PATCH v9 00/13] KVM: PPC: IOMMU in-kernel handling of VFIO

2013-08-30 Thread Alexey Kardashevskiy
On 08/28/2013 06:37 PM, Alexey Kardashevskiy wrote: This accelerates VFIO DMA operations on POWER by moving them into kernel. This depends on VFIO external API patch which is on its way to upstream. Changes: v9: * replaced the link logical bus number to IOMMU group ioctl to KVM

Re: [PATCH v9 04/13] KVM: PPC: reserve a capability and KVM device type for realmode VFIO

2013-09-01 Thread Alexey Kardashevskiy
On 09/01/2013 09:27 PM, Gleb Natapov wrote: On Wed, Aug 28, 2013 at 06:37:41PM +1000, Alexey Kardashevskiy wrote: This reserves a capability number for upcoming support of VFIO-IOMMU DMA operations in real mode. This reserves a number for a new SPAPR TCE IOMMU KVM device which is going

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-01 Thread Alexey Kardashevskiy
On 09/01/2013 10:06 PM, Gleb Natapov wrote: On Wed, Aug 28, 2013 at 06:50:41PM +1000, Alexey Kardashevskiy wrote: This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT and H_STUFF_TCE requests targeted an IOMMU TCE table without passing them to user space which saves time

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-03 Thread Alexey Kardashevskiy
On 09/03/2013 08:53 PM, Gleb Natapov wrote: On Mon, Sep 02, 2013 at 01:14:29PM +1000, Alexey Kardashevskiy wrote: On 09/01/2013 10:06 PM, Gleb Natapov wrote: On Wed, Aug 28, 2013 at 06:50:41PM +1000, Alexey Kardashevskiy wrote: This allows the host kernel to handle H_PUT_TCE

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-05 Thread Alexey Kardashevskiy
On 09/06/2013 04:10 AM, Gleb Natapov wrote: On Wed, Sep 04, 2013 at 02:01:28AM +1000, Alexey Kardashevskiy wrote: On 09/03/2013 08:53 PM, Gleb Natapov wrote: On Mon, Sep 02, 2013 at 01:14:29PM +1000, Alexey Kardashevskiy wrote: On 09/01/2013 10:06 PM, Gleb Natapov wrote: On Wed, Aug 28, 2013

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-06 Thread Alexey Kardashevskiy
On 09/06/2013 04:01 PM, Gleb Natapov wrote: On Fri, Sep 06, 2013 at 09:38:21AM +1000, Alexey Kardashevskiy wrote: On 09/06/2013 04:10 AM, Gleb Natapov wrote: On Wed, Sep 04, 2013 at 02:01:28AM +1000, Alexey Kardashevskiy wrote: On 09/03/2013 08:53 PM, Gleb Natapov wrote: On Mon, Sep 02, 2013

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-06 Thread Alexey Kardashevskiy
On 09/06/2013 04:57 PM, Gleb Natapov wrote: On Thu, Sep 05, 2013 at 02:05:09PM +1000, Benjamin Herrenschmidt wrote: On Tue, 2013-09-03 at 13:53 +0300, Gleb Natapov wrote: Or supporting all IOMMU links (and leaving emulated stuff as is) in on device is the last thing I have to do and then

[PATCH v10 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-06 Thread Alexey Kardashevskiy
between KVM and VFIO. Tests show that this patch increases transmission speed from 220MB/s to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v10: * all IOMMU TCE links

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-06 Thread Alexey Kardashevskiy
On 09/06/2013 04:57 PM, Gleb Natapov wrote: On Thu, Sep 05, 2013 at 02:05:09PM +1000, Benjamin Herrenschmidt wrote: On Tue, 2013-09-03 at 13:53 +0300, Gleb Natapov wrote: Or supporting all IOMMU links (and leaving emulated stuff as is) in on device is the last thing I have to do and then

[PATCH] pci: fix interrupt-map for bridges

2013-09-12 Thread Alexey Kardashevskiy
. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- This is the example of working system: [root@erif_root pci@1]# lspci 0001:00:01.0 PCI bridge: Red Hat, Inc. Device 0001 0001:01:02.0 PCI bridge: Red Hat, Inc. Device 0001 0001:01:03.0 PCI bridge: Red Hat, Inc. Device 0001 0001:02:01.0 Ethernet

[PATCH v2] pci: fix interrupt-map for bridges

2013-09-24 Thread Alexey Kardashevskiy
. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v2: * removed redundand r-stack push-pop --- This is the example of working system: [root@erif_root pci@1]# lspci 0001:00:01.0 PCI bridge: Red Hat, Inc. Device 0001 0001:01:02.0 PCI bridge: Red Hat, Inc. Device 0001 0001:01:03.0 PCI

ptrace and emulated mfspr/mtspr on DSCR

2012-07-06 Thread Alexey Kardashevskiy
Hi! I am trying to change DSCR's value of a specific process with pid=XXX. For this, I attach by ptrace() to XXX, inject a piece of code which does mfspr/mtspr, continue XXX and see how it is changing. So far so good. The problem is with continue. The XXX process does not wake up until I press

  1   2   3   4   5   6   7   8   9   10   >