Re: [PATCH V4 6/7] kvm tools: Add PPC64 PCI Host Bridge

2012-01-31 Thread Alexey Kardashevskiy
. Signed-off-by: Matt Evans m...@ozlabs.org For the bits derived from my qemu code: Signed-off-by: David Gibson da...@gibson.dropbear.id.au For the bits derived from my qemu code: Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru -- Alexey -- To unsubscribe from this list: send the line

[PATCH 0/3] adding MSI/MSIX for PCI on POWER

2012-06-13 Thread Alexey Kardashevskiy
The following patches add MSIX support for PCI on POWER. The first aim is virtio-pci so it was tested. It will also support VFIO when it becomes available in public. Alexey Kardashevskiy (3): msi/msix: added functions to API to set up message address and data pseries: added allocator

[PATCH 1/3] msi/msix: added functions to API to set up message address and data

2012-06-13 Thread Alexey Kardashevskiy
-by: Alexey Kardashevskiy a...@ozlabs.ru --- hw/msi.c | 14 ++ hw/msi.h |1 + hw/msix.c | 10 ++ hw/msix.h |3 +++ 4 files changed, 28 insertions(+), 0 deletions(-) diff --git a/hw/msi.c b/hw/msi.c index 5d6ceb6..124878a 100644 --- a/hw/msi.c +++ b/hw/msi.c

[PATCH 2/3] pseries: added allocator for a block of IRQs

2012-06-13 Thread Alexey Kardashevskiy
The patch adds a simple helper which allocates a consecutive sequence of IRQs calling spapr_allocate_irq for each and checks that allocated IRQs go consequently. The patch is required for upcoming support of MSI/MSIX on POWER. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- hw/spapr.c

[PATCH 3/3] pseries pci: added MSI/MSIX support

2012-06-13 Thread Alexey Kardashevskiy
address and data patch. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- hw/spapr.c |9 ++- hw/spapr_pci.c | 266 +-- hw/spapr_pci.h | 13 +++- trace-events |9 ++ 4 files changed, 284 insertions(+), 13 deletions(-) diff

[PATCH] pseries pci: removed redundand busdev

2012-06-13 Thread Alexey Kardashevskiy
The PCIHostState struct already contains SysBusDevice so the one in sPAPRPHBState has to go. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- hw/spapr_pci.c |4 ++-- hw/spapr_pci.h |1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c

[PATCH] pseries pci: spapr_populate_pci_devices renamed to spapr_populate_pci_dt

2012-06-13 Thread Alexey Kardashevskiy
spapr_populate_pci_devices() populates the device tree only with bus properties and has nothing to do with the devices on it as PCI BAR allocation is done by the system firmware (SLOF). New name - spapr_populate_pci_dt() - describes the functionality better. Signed-off-by: Alexey Kardashevskiy

[PATCH] trace: added ability to comment out events in the list

2012-06-13 Thread Alexey Kardashevskiy
It is convenient for debug to be able to switch on/off some events easily. The only possibility now is to remove event name from the file completely and type it again when we want it back. The patch adds '#' symbol handling as a comment specifier. Signed-off-by: Alexey Kardashevskiy

Re: [PATCH 0/3] adding MSI/MSIX for PCI on POWER

2012-06-13 Thread Alexey Kardashevskiy
Forgot to CC: someone :) On 14/06/12 14:29, Alexey Kardashevskiy wrote: The following patches add MSIX support for PCI on POWER. The first aim is virtio-pci so it was tested. It will also support VFIO when it becomes available in public. Alexey Kardashevskiy (3): msi/msix: added

Re: [Qemu-devel] [PATCH 1/3] msi/msix: added functions to API to set up message address and data

2012-06-13 Thread Alexey Kardashevskiy
On 14/06/12 14:56, Alex Williamson wrote: On Thu, 2012-06-14 at 14:31 +1000, Alexey Kardashevskiy wrote: Normally QEMU expects the guest to initialize MSI/MSIX vectors. However on POWER the guest uses RTAS subsystem to configure MSI/MSIX and does not write these vectors to device's config

Re: [Qemu-devel] [PATCH 1/3] msi/msix: added functions to API to set up message address and data

2012-06-13 Thread Alexey Kardashevskiy
On 14/06/12 15:38, Alex Williamson wrote: On Thu, 2012-06-14 at 15:17 +1000, Alexey Kardashevskiy wrote: On 14/06/12 14:56, Alex Williamson wrote: On Thu, 2012-06-14 at 14:31 +1000, Alexey Kardashevskiy wrote: Normally QEMU expects the guest to initialize MSI/MSIX vectors. However on POWER

Re: [Qemu-devel] [PATCH] trace: added ability to comment out events in the list

2012-06-14 Thread Alexey Kardashevskiy
On 14/06/12 23:18, Stefan Hajnoczi wrote: On Thu, Jun 14, 2012 at 02:41:40PM +1000, Alexey Kardashevskiy wrote: It is convenient for debug to be able to switch on/off some events easily. The only possibility now is to remove event name from the file completely and type it again when we want

[PATCH] msi/msix: added functions to API to set up message address, and data

2012-06-21 Thread Alexey Kardashevskiy
where MSI/MSIX vectors point to. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- hw/msi.c | 14 ++ hw/msi.h |1 + hw/msix.c |8 hw/msix.h |3 +++ 4 files changed, 26 insertions(+) diff --git a/hw/msi.c b/hw/msi.c index 5233204..c7b3e6a 100644 --- a/hw

[PATCH] msi/msix: added public API to set/get MSI message address, and data

2012-06-21 Thread Alexey Kardashevskiy
for a symmetry. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- hw/msi.c | 29 + hw/msi.h |2 ++ hw/msix.c | 11 ++- hw/msix.h |3 +++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/hw/msi.c b/hw/msi.c index 5233204..9ad84a4 100644

Re: [PATCH] msi/msix: added public API to set/get MSI message address, and data

2012-06-21 Thread Alexey Kardashevskiy
On 21/06/12 20:38, Jan Kiszka wrote: On 2012-06-21 12:28, Alexey Kardashevskiy wrote: On 21/06/12 17:39, Jan Kiszka wrote: On 2012-06-21 09:18, Alexey Kardashevskiy wrote: agrhhh. sha1 of the patch changed after rebasing :) Added (msi|msix)_(set|get)_message() function for whoever might

[PATCH] msi/msix: added API to set MSI message address and data

2012-06-21 Thread Alexey Kardashevskiy
hypercalls. So in order to support MSIX for virtio-pci on POWER we have to initialize MSI/MSIX message from QEMU. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- hw/msi.c | 13 + hw/msi.h |1 + hw/msix.c |9 + hw/msix.h |2 ++ 4 files changed, 25 insertions

Re: [PATCH] msi/msix: added API to set MSI message address and data

2012-06-21 Thread Alexey Kardashevskiy
On 21/06/12 21:49, Jan Kiszka wrote: On 2012-06-21 13:39, Alexey Kardashevskiy wrote: Added (msi|msix)_set_message() functions. Currently msi_notify()/msix_notify() write to these vectors to signal the guest about an interrupt so the correct values have to written there by the guest or QEMU

[PATCH] msi/msix: added API to set MSI message address and data

2012-06-21 Thread Alexey Kardashevskiy
vectors, instead it uses RTAS hypercalls. So in order to support MSIX for virtio-pci on POWER we have to initialize MSI/MSIX message from QEMU. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- hw/msi.c | 13 + hw/msi.h |1 + hw/msix.c |9 + hw/msix.h |2 ++ 4

Re: [PATCH] msi/msix: added API to set MSI message address and data

2012-07-01 Thread Alexey Kardashevskiy
Ping? On 22/06/12 11:15, Alexey Kardashevskiy wrote: Added (msi|msix)_set_message() function for whoever might want to use them. Currently msi_notify()/msix_notify() write to these vectors to signal the guest about an interrupt so the correct values have to written there by the guest

Re: [PATCH] msi/msix: added API to set MSI message address and data

2012-07-18 Thread Alexey Kardashevskiy
On 18/07/12 22:43, Michael S. Tsirkin wrote: On Thu, Jun 21, 2012 at 09:39:10PM +1000, Alexey Kardashevskiy wrote: Added (msi|msix)_set_message() functions. Currently msi_notify()/msix_notify() write to these vectors to signal the guest about an interrupt so the correct values have

Re: [PATCH] msi/msix: added API to set MSI message address and data

2012-07-18 Thread Alexey Kardashevskiy
On 19/07/12 01:23, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 11:17:12PM +1000, Alexey Kardashevskiy wrote: On 18/07/12 22:43, Michael S. Tsirkin wrote: On Thu, Jun 21, 2012 at 09:39:10PM +1000, Alexey Kardashevskiy wrote: Added (msi|msix)_set_message() functions. Currently msi_notify

[PATCH] powerpc-kvm: fixing page alignment for TCE

2012-09-04 Thread Alexey Kardashevskiy
From: Paul Mackerras pau...@samba.org TODO: ask Paul to make a proper message. This is the fix for a host kernel compiled with a page size other than 4K (TCE page size). In the case of a 64K page size, the host used to lose address bits in hpte_rpn(). The patch fixes it. Signed-off-by: Alexey

[PATCH] iommu: adding missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-02-10 Thread Alexey Kardashevskiy
, the empty kvm_iommu_map_pages/kvm_iommu_unmap_pages have to be defined, so does the patch. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Cc: David Gibson da...@gibson.dropbear.id.au --- arch/powerpc/kernel/iommu.c | 17 + 1 file changed, 17 insertions(+) diff --git a/arch

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

2013-02-18 Thread Alexey Kardashevskiy
On 15/02/13 14:24, Paul Mackerras wrote: On Mon, Feb 11, 2013 at 11:12:41PM +1100, a...@ozlabs.ru wrote: +static long emulated_h_put_tce(struct kvmppc_spapr_tce_table *stt, + unsigned long ioba, unsigned long tce) +{ + unsigned long idx = ioba SPAPR_TCE_SHIFT; +

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

2013-05-06 Thread Alexey Kardashevskiy
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. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras

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

2013-05-06 Thread Alexey Kardashevskiy
the sparsemem vmemmap mappings aren't accessible. This adds an API to increment/decrement page counter as get_user_pages API used for user mode mapping does not work in the real mode. CONFIG_SPARSEMEM_VMEMMAP and CONFIG_FLATMEM are supported. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru

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

2013-05-06 Thread Alexey Kardashevskiy
and we may want to optimize this. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- arch/powerpc/include/asm/kvm_host.h |2 + arch/powerpc/include/asm/kvm_ppc.h | 24 +++ arch/powerpc/kvm

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

2013-05-06 Thread Alexey Kardashevskiy
. Although the series compiles, it does not make sense without VFIO patches which are posted separately. The iommu: Add a function to find an iommu group by id patch has already gone to linux-next (from iommu tree) but it is not in upstream yet so I am including it here for the reference. Alexey

[PATCH 5/6] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-06 Thread Alexey Kardashevskiy
-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- Documentation/virtual/kvm/api.txt | 28 arch/powerpc/include/asm/kvm_host.h |2 + arch/powerpc/include/asm/kvm_ppc.h |2 + arch/powerpc/include/uapi/asm/kvm.h |7 + arch/powerpc/kvm

[PATCH 4/6] iommu: Add a function to find an iommu group by id

2013-05-06 Thread Alexey Kardashevskiy
in order to support in-kernel handling of DMA map/unmap requests. This adds the iommu_group_get_by_id(id) function which performs this search. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- drivers/iommu/iommu.c | 29

[PATCH 1/6] KVM: PPC: Make lookup_linux_pte public

2013-05-06 Thread Alexey Kardashevskiy
physical address. This makes lookup_linux_pte() public so that code can call it. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Paul Mackerras pau...@samba.org --- arch/powerpc/include/asm/kvm_ppc.h |3 +++ arch/powerpc/kvm

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

2013-05-06 Thread Alexey Kardashevskiy
On 05/07/2013 07:07 AM, Alex Williamson wrote: On Mon, 2013-05-06 at 17:21 +1000, a...@ozlabs.ru wrote: 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

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

2013-05-06 Thread Alexey Kardashevskiy
On 05/07/2013 11:42 AM, Alex Williamson wrote: On Tue, 2013-05-07 at 10:49 +1000, Alexey Kardashevskiy wrote: On 05/07/2013 07:07 AM, Alex Williamson wrote: On Mon, 2013-05-06 at 17:21 +1000, a...@ozlabs.ru wrote: From: Alexey Kardashevskiy a...@ozlabs.ru The IOMMU API implements groups

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

2013-05-07 Thread Alexey Kardashevskiy
On 05/07/2013 04:02 PM, David Gibson wrote: On Tue, May 07, 2013 at 03:51:31PM +1000, Alexey Kardashevskiy wrote: On 05/07/2013 03:29 PM, David Gibson wrote: On Mon, May 06, 2013 at 05:25:56PM +1000, Alexey Kardashevskiy wrote: This allows the host kernel to handle H_PUT_TCE

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

2013-05-10 Thread Alexey Kardashevskiy
On 05/10/2013 04:51 PM, David Gibson wrote: On Mon, May 06, 2013 at 05:25:53PM +1000, 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 virtio devices or emulated PCI. These calls allow adding

[PATCH 1/4] KVM: PPC: Add support for multiple-TCE hcalls

2013-05-20 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. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru

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

2013-05-20 Thread Alexey Kardashevskiy
the sparsemem vmemmap mappings aren't accessible. This adds an API to increment/decrement page counter as get_user_pages API used for user mode mapping does not work in the real mode. CONFIG_SPARSEMEM_VMEMMAP and CONFIG_FLATMEM are supported. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru

[PATCH 0/4 v2] KVM: PPC: IOMMU in-kernel handling

2013-05-20 Thread Alexey Kardashevskiy
between VFIO and the new handlers is to be made in QEMU via ioctl to the KVM fd. The series was made and tested against v3.10-rc1. Alexey Kardashevskiy (4): KVM: PPC: Add support for multiple-TCE hcalls powerpc: Prepare to support kernel handling of IOMMU map/unmap KVM: PPC: Add support

[PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-20 Thread Alexey Kardashevskiy
that this patch increases transmission speed from 220MB/s to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- Changes: 2013-05-20: * removed

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

2013-05-20 Thread Alexey Kardashevskiy
and we may want to optimize this. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- Changes: * the real mode handler now searches for a huge page by gpa (used to be pte) * the virtual mode handler

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

2013-05-26 Thread Alexey Kardashevskiy
On 05/25/2013 12:45 PM, David Gibson wrote: On Wed, May 22, 2013 at 04:06:57PM -0500, Scott Wood wrote: On 05/20/2013 10:06:46 PM, Alexey Kardashevskiy wrote: diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 8465c2a..da6bf61 100644 --- a/arch/powerpc/kvm/powerpc.c

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

2013-05-27 Thread Alexey Kardashevskiy
On 05/27/2013 08:23 PM, Paolo Bonzini wrote: Il 25/05/2013 04:45, David Gibson ha scritto: + case KVM_CREATE_SPAPR_TCE_IOMMU: { + struct kvm_create_spapr_tce_iommu create_tce_iommu; + struct kvm *kvm = filp-private_data; + + r = -EFAULT; + if

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

2013-05-28 Thread Alexey Kardashevskiy
On 05/29/2013 03:45 AM, Scott Wood wrote: On 05/26/2013 09:44:24 PM, Alexey Kardashevskiy wrote: On 05/25/2013 12:45 PM, David Gibson wrote: On Wed, May 22, 2013 at 04:06:57PM -0500, Scott Wood wrote: On 05/20/2013 10:06:46 PM, Alexey Kardashevskiy wrote: diff --git a/arch/powerpc/kvm

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

2013-05-28 Thread Alexey Kardashevskiy
On 05/29/2013 09:35 AM, Scott Wood wrote: On 05/28/2013 06:30:40 PM, Alexey Kardashevskiy wrote: @@ -939,6 +940,9 @@ struct kvm_s390_ucas_mapping { #define KVM_GET_DEVICE_ATTR _IOW(KVMIO, 0xe2, struct kvm_device_attr) #define KVM_HAS_DEVICE_ATTR _IOW(KVMIO, 0xe3, struct

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

2013-05-28 Thread Alexey Kardashevskiy
On 05/29/2013 02:32 AM, Scott Wood wrote: On 05/24/2013 09:45:24 PM, David Gibson wrote: On Wed, May 22, 2013 at 04:06:57PM -0500, Scott Wood wrote: On 05/20/2013 10:06:46 PM, Alexey Kardashevskiy wrote: diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 8465c2a

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

2013-05-29 Thread Alexey Kardashevskiy
On 05/30/2013 06:05 AM, Scott Wood wrote: On 05/28/2013 07:12:32 PM, Alexey Kardashevskiy wrote: On 05/29/2013 09:35 AM, Scott Wood wrote: On 05/28/2013 06:30:40 PM, Alexey Kardashevskiy wrote: @@ -939,6 +940,9 @@ struct kvm_s390_ucas_mapping { #define KVM_GET_DEVICE_ATTR _IOW

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

2013-05-29 Thread Alexey Kardashevskiy
On 05/30/2013 09:14 AM, Scott Wood wrote: On 05/29/2013 06:10:33 PM, Alexey Kardashevskiy wrote: On 05/30/2013 06:05 AM, Scott Wood wrote: On 05/28/2013 07:12:32 PM, Alexey Kardashevskiy wrote: On 05/29/2013 09:35 AM, Scott Wood wrote: On 05/28/2013 06:30:40 PM, Alexey Kardashevskiy wrote

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

2013-06-05 Thread Alexey Kardashevskiy
the sparsemem vmemmap mappings aren't accessible. This adds an API to increment/decrement page counter as get_user_pages API used for user mode mapping does not work in the real mode. CONFIG_SPARSEMEM_VMEMMAP and CONFIG_FLATMEM are supported. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru

[PATCH 1/4] KVM: PPC: Add support for multiple-TCE hcalls

2013-06-05 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. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru

[PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-05 Thread Alexey Kardashevskiy
that this patch increases transmission speed from 220MB/s to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- Changes: 2013/06/05: * changed

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

2013-06-05 Thread Alexey Kardashevskiy
and we may want to optimize this. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- Changes: 2013/06/05: * fixed compile error when CONFIG_IOMMU_API=n 2013/05/20: * the real mode handler now searches

Re: [PATCH 1/4] KVM: PPC: Add support for multiple-TCE hcalls

2013-06-17 Thread Alexey Kardashevskiy
On 06/17/2013 08:06 AM, Alexander Graf wrote: On 05.06.2013, at 08:11, 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

Re: [PATCH 1/4] KVM: PPC: Add support for multiple-TCE hcalls

2013-06-17 Thread Alexey Kardashevskiy
On 06/17/2013 06:40 PM, Alexander Graf wrote: On 17.06.2013, at 10:34, Alexey Kardashevskiy wrote: On 06/17/2013 06:02 PM, Alexander Graf wrote: On 17.06.2013, at 09:55, Alexey Kardashevskiy wrote: On 06/17/2013 08:06 AM, Alexander Graf wrote: On 05.06.2013, at 08:11, Alexey

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

2013-06-17 Thread Alexey Kardashevskiy
On 06/16/2013 02:26 PM, Benjamin Herrenschmidt wrote: +#if defined(CONFIG_SPARSEMEM_VMEMMAP) || defined(CONFIG_FLATMEM) +int realmode_get_page(struct page *page) +{ +if (PageCompound(page)) +return -EAGAIN; + +get_page(page); + +return 0; +}

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

2013-06-18 Thread Alexey Kardashevskiy
On 06/16/2013 02:39 PM, Benjamin Herrenschmidt wrote: static pte_t kvmppc_lookup_pte(pgd_t *pgdir, unsigned long hva, bool writing, -unsigned long *pte_sizep) +unsigned long *pte_sizep, bool do_get_page) { pte_t *ptep; unsigned int shift

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

2013-06-19 Thread Alexey Kardashevskiy
On 06/20/2013 01:49 AM, Alex Williamson wrote: On Thu, 2013-06-20 at 00:50 +1000, Benjamin Herrenschmidt wrote: On Wed, 2013-06-19 at 11:58 +0200, Alexander Graf wrote: Alex, any objection ? Which Alex? :) Heh, mostly Williamson in this specific case but your input is still welcome :-)

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

2013-06-20 Thread Alexey Kardashevskiy
On 06/20/2013 05:47 PM, Benjamin Herrenschmidt wrote: On Thu, 2013-06-20 at 15:28 +1000, David Gibson wrote: Just out of curiosity - would not get_file() and fput_atomic() on a group's file* do the right job instead of vfio_group_add_external_user() and vfio_group_del_external_user()? I was

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

2013-06-22 Thread Alexey Kardashevskiy
On 06/21/2013 12:55 AM, Alex Williamson wrote: On Thu, 2013-06-20 at 18:48 +1000, Alexey Kardashevskiy wrote: On 06/20/2013 05:47 PM, Benjamin Herrenschmidt wrote: On Thu, 2013-06-20 at 15:28 +1000, David Gibson wrote: Just out of curiosity - would not get_file() and fput_atomic

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

2013-06-26 Thread Alexey Kardashevskiy
The changes are: 1. rebased on v3.10-rc7 2. removed spinlocks from real mode 3. added security checks between KVM and VFIO MOre details in the individual patch comments. Alexey Kardashevskiy (8): KVM: PPC: reserve a capability number for multitce support KVM: PPC: reserve a capability

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

2013-06-26 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/06

[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 5/8] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-06-26 Thread Alexey Kardashevskiy
Gibson da...@gibson.dropbear.id.au Signed-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

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

2013-06-26 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 4/8] hashtable: add hash_for_each_possible_rcu_notrace()

2013-06-26 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 1/8] KVM: PPC: reserve a capability number for multitce support

2013-06-26 Thread Alexey Kardashevskiy
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 d88c8ee..970b1f5 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -666,6 +666,7

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

2013-06-26 Thread Alexey Kardashevskiy
. The vfio: Limit group opens patch is also required for the consistency. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- drivers/vfio/vfio.c | 53 +++ 1 file changed, 53 insertions(+) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index

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 =

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

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 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] :

[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

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

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

  1   2   >