[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

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

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

[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 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 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 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 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 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 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 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 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

[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

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

[RFC PATCH] PPC: KVM: vfio kvm device: support spapr tce

2013-10-04 Thread Alexey Kardashevskiy
but it works. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/kvm/Kconfig | 1 + arch/powerpc/kvm/Makefile | 4 include/linux/kvm_host.h | 8 --- include/linux/vfio.h | 3 +++ include/uapi/linux/kvm.h | 1 + virt/kvm/vfio.c | 46

Re: [RFC PATCH] PPC: KVM: vfio kvm device: support spapr tce

2013-10-04 Thread Alexey Kardashevskiy
On 05.10.2013 2:05, Alex Williamson wrote: On Fri, 2013-10-04 at 22:24 +1000, Alexey Kardashevskiy wrote: This is a very rough change set required for ppc64 to use this KVM device. vfio_rm.c is a piece of code which is going to be called from the realmode (MMU off), and I will put

Re: [RFC PATCH] PPC: KVM: vfio kvm device: support spapr tce

2013-10-04 Thread Alexey Kardashevskiy
On 10/05/2013 11:52 AM, Alexey Kardashevskiy wrote: On 05.10.2013 2:05, Alex Williamson wrote: On Fri, 2013-10-04 at 22:24 +1000, Alexey Kardashevskiy wrote: This is a very rough change set required for ppc64 to use this KVM device. vfio_rm.c is a piece of code which is going to be called

[RFC PATCH v2] KVM: PPC: vfio kvm device: support spapr tce

2013-11-05 Thread Alexey Kardashevskiy
Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v2: * it does not try to introduce a realmode search function. Instead, liobn-to-iommu-group lookup is done by VFIO KVM device in virtual mode and the result (iommu_group pointer) is cached in kvm_arch so the realmode handlers do

[PATCH v3] KVM: PPC: vfio kvm device: support spapr tce

2013-11-19 Thread Alexey Kardashevskiy
uses kvm_vfio_find_group_by_liobn() once per KVM run and caches the result in kvm_arch. iommu_group_put() for all groups will be called when KVM finishes (in the SPAPR TCE in KVM enablement patch). Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v3: * total rework * added a release

Re: [PATCH v3] KVM: PPC: vfio kvm device: support spapr tce

2013-11-20 Thread Alexey Kardashevskiy
On 11/21/2013 07:57 AM, Alex Williamson wrote: On Wed, 2013-11-20 at 16:18 +1100, Alexey Kardashevskiy wrote: In addition to the external VFIO user API, a VFIO KVM device has been introduced recently. sPAPR TCE IOMMU is para-virtualized and the guest does map/unmap via hypercalls which take

[PATCH v4] KVM: PPC: vfio kvm device: support spapr tce

2013-11-25 Thread Alexey Kardashevskiy
uses kvm_vfio_find_group_by_liobn() once per KVM run and caches the result in kvm_arch. iommu_group_put() for all groups will be called when KVM finishes (in the SPAPR TCE in KVM enablement patch). Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v4: * fixed few bugs * changed

Re: [PATCH 1/4] KVM: PPC: Book3S HV: Fix physical address calculations

2013-12-06 Thread Alexey Kardashevskiy
On 11/16/2013 05:46 PM, Paul Mackerras wrote: This fixes a bug in kvmppc_do_h_enter() where the physical address for a page can be calculated incorrectly if transparent huge pages (THP) are active. Until THP came along, it was true that if we encountered a large (16M) page in

Re: [PATCH 0/4] PPC: KVM: fix RESUME_GUEST checks

2014-02-06 Thread Alexey Kardashevskiy
On 02/07/2014 04:39 AM, Alexander Graf wrote: On 06.02.2014, at 17:36, Greg Kurz gk...@linux.vnet.ibm.com wrote: As discussed in this thread: http://patchwork.ozlabs.org/patch/309166/ We need some consistency in the way we check whether the guest should resume or not because: - new

Re: [PATCH] PPC: KVM: Introduce hypervisor call H_GET_TCE

2014-02-21 Thread Alexey Kardashevskiy
On 02/22/2014 06:23 AM, Benjamin Herrenschmidt wrote: On Fri, 2014-02-21 at 16:31 +0100, Laurent Dufour wrote: This fix introduces the H_GET_TCE hypervisor call which is basically the reverse of H_PUT_TCE, as defined in the Power Architecture Platform Requirements (PAPR). The hcall H_GET_TCE

[PATCH 0/3] Prepare for in-kernel VFIO DMA operations acceleration

2014-06-05 Thread Alexey Kardashevskiy
This reserves 2 capability numbers. This implements an extended version of KVM_CREATE_SPAPR_TCE_64 ioctl. Please advise how to proceed with these patches as I suspect that first two should go via Paolo's tree while the last one via Alex Graf's tree (correct?). Thanks! Alexey Kardashevskiy (3

[PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Alexey Kardashevskiy
(DDW), let's add @bus_offset and @page_shift which are also required by DDW. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Documentation/virtual/kvm/api.txt | 46 + arch/powerpc/include/asm/kvm_host.h | 4 +++- arch/powerpc/include/asm/kvm_ppc.h

[PATCH 2/3] PPC: KVM: Reserve KVM_CAP_SPAPR_TCE_64 capability number

2014-06-05 Thread Alexey Kardashevskiy
This adds a capability number for 64-bit TCE tables support. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- include/uapi/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 944cd21..e6972bf 100644 --- a/include/uapi

[PATCH 1/3] PPC: KVM: Reserve KVM_CAP_SPAPR_TCE_VFIO capability number

2014-06-05 Thread Alexey Kardashevskiy
the KVM_CREATE_SPAPR_TCE KVM ioctl because in that case TCE requests will not be passed to the user space which is desired action in the situation like that. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- include/uapi/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Alexey Kardashevskiy
On 06/05/2014 05:38 PM, Benjamin Herrenschmidt wrote: On Thu, 2014-06-05 at 17:25 +1000, Alexey Kardashevskiy wrote: +This creates a virtual TCE (translation control entry) table, which +is an IOMMU for PAPR-style virtual I/O. It is used to translate +logical addresses used in virtual I/O

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Alexey Kardashevskiy
On 06/05/2014 10:30 PM, Benjamin Herrenschmidt wrote: On Thu, 2014-06-05 at 13:56 +0200, Alexander Graf wrote: What if we ask user space to give us a pointer to user space allocated memory along with the TCE registration? We would still ask user space to only use the returned fd for TCE

Re: [PATCH 0/3] Prepare for in-kernel VFIO DMA operations acceleration

2014-06-05 Thread Alexey Kardashevskiy
On 06/05/2014 09:57 PM, Alexander Graf wrote: On 05.06.14 09:25, Alexey Kardashevskiy wrote: This reserves 2 capability numbers. This implements an extended version of KVM_CREATE_SPAPR_TCE_64 ioctl. Please advise how to proceed with these patches as I suspect that first two should go via

Re: [PATCH 0/3] Prepare for in-kernel VFIO DMA operations acceleration

2014-06-25 Thread Alexey Kardashevskiy
On 06/26/2014 07:12 AM, Alexander Graf wrote: On 06.06.14 02:20, Alexey Kardashevskiy wrote: On 06/05/2014 09:57 PM, Alexander Graf wrote: On 05.06.14 09:25, Alexey Kardashevskiy wrote: This reserves 2 capability numbers. This implements an extended version of KVM_CREATE_SPAPR_TCE_64 ioctl

[PATCH] PC, KVM, CMA: Fix regression caused by wrong get_order() use

2014-08-12 Thread Alexey Kardashevskiy
...@samba.org Cc: Alexander Graf ag...@suse.de Cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Cc: Joonsoo Kim iamjoonsoo@lge.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Cc: sta...@vger.kernel.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/kvm

[PATCH v2] PC, KVM, CMA: Fix regression caused by wrong get_order() use

2014-08-13 Thread Alexey Kardashevskiy
). Suggested-by: Paul Mackerras pau...@samba.org Cc: Alexander Graf ag...@suse.de Cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Cc: Joonsoo Kim iamjoonsoo@lge.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Changes: v2: * s

Re: [PATCH v2] PC, KVM, CMA: Fix regression caused by wrong get_order() use

2014-08-14 Thread Alexey Kardashevskiy
On 08/14/2014 11:40 PM, Alexander Graf wrote: On 14.08.14 07:13, Aneesh Kumar K.V wrote: Alexey Kardashevskiy a...@ozlabs.ru writes: fc95ca7284bc54953165cba76c3228bd2cdb9591 claims that there is no functional change but this is not true as it calls get_order() (which takes bytes) where

Re: [PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-03 Thread Alexey Kardashevskiy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/04/2014 07:05 AM, Alexander Graf wrote: Am 03.10.2014 um 14:05 schrieb Paul Mackerras pau...@samba.org: On Thu, Oct 02, 2014 at 07:06:40PM +0200, Alexander Graf wrote: I think we're best off to keep the user space API native endian.

[PATCH kernel 9/9] KVM: PPC: Add support for multiple-TCE hcalls

2015-09-15 Thread Alexey Kardashevskiy
and PR-syle KVM are supported. Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- Documentation/virtual/kvm/api.txt | 25 ++ arch/powerpc/include/asm/kvm_ppc.h | 12 +++ arch/powerpc/kvm/book3s_64_vio.c| 111 +++- arch/power

[PATCH kernel 4/9] KVM: PPC: Use RCU for arch.spapr_tce_tables

2015-09-15 Thread Alexey Kardashevskiy
-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kvm/book3s.c | 2 +- arch/powerpc/kvm/book3s_64_vio.c| 20 +++- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/inclu

[PATCH kernel 5/9] KVM: PPC: Account TCE-containing pages in locked_vm

2015-09-15 Thread Alexey Kardashevskiy
. This counts the number of pages required for a table plus pages for the kvmppc_spapr_tce_table struct (TCE table descriptor) itself. This does not change the amount of (de)allocated memory. Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- arch/powerpc/kvm/book3s_64_vio.

[PATCH kernel 6/9] KVM: PPC: Replace SPAPR_TCE_SHIFT with IOMMU_PAGE_SHIFT_4K

2015-09-15 Thread Alexey Kardashevskiy
SPAPR_TCE_SHIFT is used in few places only and since IOMMU_PAGE_SHIFT_4K can be easily used instead, remove SPAPR_TCE_SHIFT. Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 -- arch/powerpc/kvm/book3s_64_vio.c | 3 ++- arch/p

[PATCH kernel 8/9] KVM: Fix KVM_SMI chapter number

2015-09-15 Thread Alexey Kardashevskiy
The KVM_SMI capability is following the KVM_S390_SET_IRQ_STATE capability which is "4.95", this changes the number of the KVM_SMI chapter to 4.96. Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- Documentation/virtual/kvm/api.txt | 2 +- 1 file changed, 1 insertio

[PATCH kernel 0/9] KVM: PPC: Add in-kernel multitce handling

2015-09-15 Thread Alexey Kardashevskiy
modes are supported. This does not affect VFIO, this support is coming next. Please comment. Thanks. Alexey Kardashevskiy (9): rcu: Define notrace version of list_for_each_entry_rcu KVM: PPC: Make real_vmalloc_addr() public KVM: PPC: Rework H_PUT_TCE/H_GET_TCE handlers KVM: PPC: Use RCU

[PATCH kernel 2/9] KVM: PPC: Make real_vmalloc_addr() public

2015-09-15 Thread Alexey Kardashevskiy
it to the powerpc code as it does not do anything special for KVM. Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- arch/powerpc/include/asm/mmu-hash64.h | 3 +++ arch/powerpc/kvm/book3s_hv_rm_mmu.c | 17 - arch/powerpc/mm/hash_utils_64.c | 17 + 3

[PATCH kernel 1/9] rcu: Define notrace version of list_for_each_entry_rcu

2015-09-15 Thread Alexey Kardashevskiy
This defines list_for_each_entry_rcu_notrace and list_entry_rcu_notrace which use rcu_dereference_raw_notrace instead of rcu_dereference_raw. This allows using list_for_each_entry_rcu_notrace in real mode (MMU is off). Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- include

[PATCH kernel 3/9] KVM: PPC: Rework H_PUT_TCE/H_GET_TCE handlers

2015-09-15 Thread Alexey Kardashevskiy
is added) so no change in behaviour is expected. Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- arch/powerpc/kvm/book3s_64_vio_hv.c | 102 +++- 1 file changed, 66 insertions(+), 36 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_vio_hv.c b/arch/p

Re: [PATCH kernel 7/9] KVM: PPC: Move reusable bits of H_PUT_TCE handler to helpers

2015-12-21 Thread Alexey Kardashevskiy
On 12/08/2015 04:27 PM, David Gibson wrote: On Tue, Sep 15, 2015 at 08:49:37PM +1000, Alexey Kardashevskiy wrote: Upcoming multi-tce support (H_PUT_TCE_INDIRECT/H_STUFF_TCE hypercalls) will validate TCE (not to have unexpected bits) and IO address (to be within the DMA window boundaries

Re: [PATCH kernel 9/9] KVM: PPC: Add support for multiple-TCE hcalls

2015-12-21 Thread Alexey Kardashevskiy
On 12/08/2015 04:48 PM, David Gibson wrote: On Tue, Sep 15, 2015 at 08:49:39PM +1000, Alexey Kardashevskiy wrote: This adds real and virtual mode handlers for the H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for user space emulated devices such as IBMVIO devices or emulated PCI. These calls

Re: [PATCH kernel 5/9] KVM: PPC: Account TCE-containing pages in locked_vm

2015-11-29 Thread Alexey Kardashevskiy
On 11/30/2015 01:06 PM, Paul Mackerras wrote: On Tue, Sep 15, 2015 at 08:49:35PM +1000, Alexey Kardashevskiy wrote: At the moment pages used for TCE tables (in addition to pages addressed by TCEs) are not counted in locked_vm counter so a malicious userspace tool can call ioctl

<    1   2