Re: [Qemu-devel] [RFC PATCH] vfio: VFIO PCI driver for Qemu

2012-07-27 Thread Alexey Kardashevskiy
On 28/07/12 05:22, Blue Swirl wrote: On Wed, Jul 25, 2012 at 5:03 PM, Alex Williamson + +static void vfio_enable_intx_kvm(VFIODevice *vdev) +{ +#ifdef CONFIG_KVM These shouldn't be needed. The device will not be useful without KVM, so the file shouldn't be compiled for non-KVM case at all. I

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-28 Thread Alexey Kardashevskiy
; mechanism for now since the previous netlink version produced > too many gag reflexes. It's easy enough to set a bit in the > group flags too indicate such support in the future, so I > think we can move ahead without it. > > Appreciate any feedback or suggestions. Thanks,

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-28 Thread Alexey Kardashevskiy
strerror(errno)); for (i = 0; i < vdev->nr_vectors; i++) { @@ -355,6 +356,8 @@ static void vfio_enable_msi(VFIODevice *vdev, bool msix) qemu_free(vdev->msi_vectors); vdev->nr_vectors = 0; return; +} else if (0 < ret) { +vdev->nr_vecto

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-28 Thread Alexey Kardashevskiy
led: %s\n", __FUNCTION__, vdev->host.seg, vdev->host.bus, vdev->host.dev, vdev->host.func, addr, val, len, strerror(errno)); @@ -675,6 +704,7 @@ static int vfio_setup_msi(VFIODevice *vdev) vdev->config_offset + pos + PCI_CAP_FLAGS) != s

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-28 Thread Alexey Kardashevskiy
Hi! On 29/11/11 14:46, Alex Williamson wrote: > On Tue, 2011-11-29 at 12:52 +1100, Alexey Kardashevskiy wrote: >> Hi! >> >> I tried (successfully) to run it on POWER and while doing that I found some >> issues. I'll try to >> explain them in separate mails

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-12-01 Thread Alexey Kardashevskiy
On 29/11/11 16:48, Alex Williamson wrote: > On Tue, 2011-11-29 at 15:34 +1100, Alexey Kardashevskiy wrote: >> Hi! >> >> On 29/11/11 14:46, Alex Williamson wrote: >>> On Tue, 2011-11-29 at 12:52 +1100, Alexey Kardashevskiy wrote: >>>> Hi! >>>&

Re: [PATCH V4 2/7] kvm tools: Generate SPAPR PPC64 guest device tree

2012-01-31 Thread Alexey Kardashevskiy
scripts/dtc/libfdt. >> >> Signed-off-by: Matt Evans > > For the bits derived from my code: > > Signed-off-by: David Gibson > For the bits derived from my code: Signed-off-by: Alexey Kardashevskiy -- Alexey -- To unsubscribe from this list: send the

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

2012-01-31 Thread Alexey Kardashevskiy
; and >> DT nodes generated for each. >> >> Signed-off-by: Matt Evans > > For the bits derived from my qemu code: > > Signed-off-by: David Gibson > For the bits derived from my qemu code: Signed-off-by: Alexey Kardashevskiy -- Alexey -- To unsubscribe from

[RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-10 Thread Alexey Kardashevskiy
. The proposed patch does not change capability pointers when the same type capability is about to add. Signed-off-by: Alexey Kardashevskiy --- hw/pci.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index aa0c0b8..1f7c924 100644 --- a/hw/pci.c

[RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexey Kardashevskiy
. The proposed patch does not change capability pointers when the same type capability is about to add. Signed-off-by: Alexey Kardashevskiy --- hw/pci.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index aa0c0b8..1f7c924 100644 --- a/hw/pci.c

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexey Kardashevskiy
11.05.2012 20:52, Alexander Graf написал: > > On 11.05.2012, at 08:45, Alexey Kardashevskiy wrote: > >> Normally the pci_add_capability is called on devices to add new >> capability. This is ok for emulated devices which capabilities list >> is being built by QEMU. &g

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexey Kardashevskiy
12.05.2012 5:20, Jason Baron написал: > On Fri, May 11, 2012 at 04:45:21PM +1000, Alexey Kardashevskiy wrote: >> Normally the pci_add_capability is called on devices to add new >> capability. This is ok for emulated devices which capabilities list >> is being built by QEMU.

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

2012-05-11 Thread Alexey Kardashevskiy
Added msi_set_address_data and msix_set_address_data in order to support sPAPR-specific implementation of MSI/MSIX configuration mechanism. POWER guest does not initialize these fields, it expects a supervisor to get them initialized. Required for VFIO on POWER. Signed-off-by: Alexey

[PATCH] kernel vfio: PCI ROM size calculation

2012-05-11 Thread Alexey Kardashevskiy
r solution. Signed-off-by: Alexey Kardashevskiy --- drivers/vfio/pci/vfio_pci.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index b2f1f3a..6d4a783 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/driver

[RFC PATCH] qemu spapr-pci: added IRQ list to PCIBus

2012-05-12 Thread Alexey Kardashevskiy
form would initialize in its own way. Signed-off-by: Alexey Kardashevskiy --- hw/pci.c | 18 ++ hw/pci.h |1 + hw/pci_internals.h |2 ++ 3 files changed, 21 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 1f7c924..8c2e193 10064

[RFC PATCH] kernel vfio: enabled and supported on power

2012-05-12 Thread Alexey Kardashevskiy
window starting from 0x0). As for me, it is too complicated. We do not need either - platform specific IOMMU chardev or - IOMMU API at all What do I miss? Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h |3 + arch/powerpc/kernel/iommu.c | 302

[RFC PATCH] qemu vfio-powerpc: added initial support

2012-05-12 Thread Alexey Kardashevskiy
The idea of the patch is to demonstrate what POWER needs to support VFIO. It will not compile as many other patches are needed and they are not posted anywhere yet. The patch includes: 1) sPAPR PCI bus got an additional flag "is_vfio" which defines IOMMU behavior 2) Added POWER-specific IOMMU ha

Re: [Qemu-devel] [PATCH] kernel vfio: PCI ROM size calculation

2012-05-13 Thread Alexey Kardashevskiy
On 14/05/12 12:55, Alex Williamson wrote: > On Sat, 2012-05-12 at 16:50 +1000, Alexey Kardashevskiy wrote: >> The original code calculated the real size of the ROM and passed it to >> QEMU which tried to do pci_register_bar and failed with error message >> "ERROR: PC

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-13 Thread Alexey Kardashevskiy
On 12/05/12 00:13, Alexander Graf wrote: > > On 11.05.2012, at 14:47, Alexey Kardashevskiy wrote: > >> 11.05.2012 20:52, Alexander Graf написал: >>> >>> On 11.05.2012, at 08:45, Alexey Kardashevskiy wrote: >>> >>>> Normally the pci_add_capa

Re: [RFC PATCH] qemu spapr-pci: added IRQ list to PCIBus

2012-05-13 Thread Alexey Kardashevskiy
On 14/05/12 11:58, David Gibson wrote: > On Sat, May 12, 2012 at 05:29:53PM +1000, Alexey Kardashevskiy wrote: >> There is a need for a mechanism to obtain an IRQ line number to >> initialize End-Of-Interrupt handler. >> >> There is anothe

Re: [RFC PATCH] qemu spapr-pci: added IRQ list to PCIBus

2012-05-16 Thread Alexey Kardashevskiy
On 17/05/12 06:39, Alex Williamson wrote: > On Mon, 2012-05-14 at 14:21 +1000, Alexey Kardashevskiy wrote: >> On 14/05/12 11:58, David Gibson wrote: >>> On Sat, May 12, 2012 at 05:29:53PM +1000, Alexey Kardashevskiy wrote: >>>> There is a need for a mechanism t

Re: [RFC PATCH] qemu spapr-pci: added IRQ list to PCIBus

2012-05-16 Thread Alexey Kardashevskiy
On 17/05/12 13:00, Benjamin Herrenschmidt wrote: > On Thu, 2012-05-17 at 12:16 +1000, Alexey Kardashevskiy wrote: > >>> It actually can change dynamically on x86 due to acpi interrupt links >>> which allow the guest a generic way to select from a set of possible >&

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-17 Thread Alexey Kardashevskiy
size); +return existing; +} + if (!offset) { offset = pci_find_space(pdev, size); if (!offset) { return -ENOSPC; On 14/05/12 13:49, Alexey Kardashevskiy wrote: > On 12/05/12 00:13, Alexander Graf wrote: >> >> On 11.05.2012

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexey Kardashevskiy
On 22/05/12 13:21, Alexander Graf wrote: > > > On 22.05.2012, at 04:02, Benjamin Herrenschmidt > wrote: > >> On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: >>> Alexander, >>> >>> Is that any better? :) >> >> Alex (Gr

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexey Kardashevskiy
On 22/05/12 15:52, Alexander Graf wrote: > > > On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: > >> On 22/05/12 13:21, Alexander Graf wrote: >>> >>> >>> On 22.05.2012, at 04:02, Benjamin Herrenschmidt >>> wrote: >>> >

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-22 Thread Alexey Kardashevskiy
On 22/05/12 16:31, Alexander Graf wrote: > > > On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: > >> On 22/05/12 15:52, Alexander Graf wrote: >>> >>> >>> On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: >>> >>>> On 22/

[PATCH] vfio-powerpc: enabled and supported on power

2012-05-23 Thread Alexey Kardashevskiy
patch is made on top of git://github.com/awilliam/linux-vfio.git iommu-group-vfio-20120523 (which is iommu-group-vfio-20120521 + some fixes) Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/Kconfig |6 + arch/powerpc/include/asm/iommu.h |3 + arch/powerpc/kernel/Makefile

[RFC PATCH] PCI: Introduce INTx check & mask API

2012-05-24 Thread Alexey Kardashevskiy
[Found while debugging VFIO on POWER but it is platform independent] There is a feature in PCI (>=2.3?) to mask/unmask INTx via PCI_COMMAND and PCI_STATUS registers. And there is some API to support that (commit a2e27787f893621c5a6b865acf6b7766f8671328). I have a network adapter: 0001:00:01.0 E

Re: [RFC PATCH] PCI: Introduce INTx check & mask API

2012-05-24 Thread Alexey Kardashevskiy
On 25/05/12 00:41, Alex Williamson wrote: >>> [Found while debugging VFIO on POWER but it is platform independent] >>> >>> There is a feature in PCI (>=2.3?) to mask/unmask INTx via PCI_COMMAND and >>> PCI_STATUS registers. >> >> Yes, 2.3 introduced this. Masking is done via command register, chec

Re: [RFC PATCH] PCI: Introduce INTx check & mask API

2012-05-24 Thread Alexey Kardashevskiy
On 24/05/12 22:02, Jan Kiszka wrote: > On 2012-05-24 04:44, Alexey Kardashevskiy wrote: >> [Found while debugging VFIO on POWER but it is platform independent] >> >> There is a feature in PCI (>=2.3?) to mask/unmask INTx via PCI_COMMAND and >> PCI_STATUS registers.

Re: [PATCH] vfio-powerpc: enabled and supported on power

2012-05-24 Thread Alexey Kardashevskiy
On 25/05/12 01:12, Alex Williamson wrote: > On Thu, 2012-05-24 at 13:10 +1000, Alexey Kardashevskiy wrote: >> The patch introduces support of VFIO on POWER. >> >> The patch consists of: >> >> 1. IOMMU driver for VFIO. >> It does not use IOMMU API at a

Re: [RFC PATCH] PCI: Introduce INTx check & mask API

2012-05-24 Thread Alexey Kardashevskiy
On 25/05/12 12:29, Jan Kiszka wrote: > On 2012-05-24 22:18, Alexey Kardashevskiy wrote: >> On 24/05/12 22:02, Jan Kiszka wrote: >>> On 2012-05-24 04:44, Alexey Kardashevskiy wrote: >>>> [Found while debugging VFIO on POWER but it is platform independent] >>>

[RFC PATCH] vfio: add fixup for broken PCI devices

2012-05-25 Thread Alexey Kardashevskiy
pci_enable_device() is called on that PCI function. To eliminate such effect, some quirk should be called. The proposed pci_fixup_final does its job well for mentioned NEC PCI USB but not sure if it is 100% correct. Signed-off-by: Alexey Kardashevskiy --- drivers/vfio/pci/vfio_pci.c |2 ++ 1

Re: [RFC PATCH] PCI: Introduce INTx check & mask API

2012-05-25 Thread Alexey Kardashevskiy
25.05.2012 20:43, Jan Kiszka написал: > On 2012-05-24 23:47, Alexey Kardashevskiy wrote: >> On 25/05/12 12:29, Jan Kiszka wrote: >>> On 2012-05-24 22:18, Alexey Kardashevskiy wrote: >>>> On 24/05/12 22:02, Jan Kiszka wrote: >>>>> On 2012-05-24 04:44, Al

Re: [PATCH] PCI: Mark INTx masking support of Chelsio T310 10GbE NIC as broken

2012-06-06 Thread Alexey Kardashevskiy
ter as broken so that pci_intx_mask_supported >> won't report it as compatible. >> >> Reported-by: Alexey Kardashevskiy >> Signed-off-by: Jan Kiszka >> --- >> >> Alexey, please test if this catches your case correctly. > > Alexey? Ping for testing. Sorry, was

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Alexey Kardashevskiy
: 0x34: 0xD0 0xC8: 0x01 0xD0 0xD0: 0x05 0xC8 0xE0: 0x10 0x00 As result capabilities at 0xC8 and 0xD0 point to each other. Signed-off-by: Alexey Kardashevskiy --- hw/pci.c | 25 - 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Alexey Kardashevskiy
08.06.2012 20:56, Jan Kiszka написал: > On 2012-06-08 10:47, Alexey Kardashevskiy wrote: >> Yet another try :) >> >> Normally the pci_add_capability is called on devices to add new >> capability. This is ok for emulated devices which capabilities list >> is being

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Alexey Kardashevskiy
08.06.2012 21:30, Jan Kiszka пишет: > On 2012-06-08 13:16, Alexey Kardashevskiy wrote: >> 08.06.2012 20:56, Jan Kiszka написал: >>> On 2012-06-08 10:47, Alexey Kardashevskiy wrote: >>>> Yet another try :) >>>> >>>> Normally the pci_add_capa

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

2012-06-12 Thread Alexey Kardashevskiy
Ping? On 12/05/12 16:48, Alexey Kardashevskiy wrote: > Added msi_set_address_data and msix_set_address_data in order to support > sPAPR-specific implementation of MSI/MSIX configuration mechanism. > POWER guest does not initialize these fields, it expects a supervisor to > get them

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

2012-06-12 Thread Alexey Kardashevskiy
On 13/06/12 13:22, Benjamin Herrenschmidt wrote: > On Wed, 2012-06-13 at 12:44 +1000, Alexey Kardashevskiy wrote: >> Ping? > > FYI. The way it normally works on pseries is that RTAS, which is the > part of the firmware that lives inside the partition alongside the OS, > per

Re: [RFC PATCH] vfio: add fixup for broken PCI devices

2012-06-22 Thread Alexey Kardashevskiy
On 07/06/12 09:17, Alex Williamson wrote: > On Fri, 2012-05-25 at 17:35 +1000, Alexey Kardashevskiy wrote: >> Some adapters (like NEC PCI USB controller) do not flush their config >> on a sioftware reset and remember DMA config, etc. >> >> If we use such an adapter with

Re: Request VFIO inclusion in linux-next

2012-07-01 Thread Alexey Kardashevskiy
On 27/06/12 22:37, Dan Carpenter wrote: > On Mon, Jun 25, 2012 at 10:55:52PM -0600, Alex Williamson wrote: >> Hi, >> >> VFIO has been kicking around for well over a year now and has been >> posted numerous times for review. The pre-requirements are finally >> available in linux-next (or will be in

[PATCH 0/2] vfio on power

2013-02-11 Thread Alexey Kardashevskiy
The series introduces a VFIO support on POWER. The QEMU support is required, the real mode acceleration patches are coming later. Alexey Kardashevskiy (2): vfio powerpc: enabled on powernv platform vfio powerpc: implemented IOMMU driver for VFIO arch/powerpc/include/asm/iommu.h

[PATCH 1/2] vfio powerpc: enabled on powernv platform

2013-02-11 Thread Alexey Kardashevskiy
VFIO on POWER, enable SPAPR_TCE_IOMMU config option and configure VFIO as required. Cc: David Gibson Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h| 15 ++ arch/powerpc/kernel/iommu.c | 343 +++ arch/powerpc

[PATCH 2/2] vfio powerpc: implemented IOMMU driver for VFIO

2013-02-11 Thread Alexey Kardashevskiy
mapping/unmapping pages for the guest IO and provides information about DMA window (required by a POWERPC guest). The counterpart in QEMU is required to support this functionality. Cc: David Gibson Signed-off-by: Alexey Kardashevskiy --- drivers/vfio/Kconfig|6 + drivers/vfio

Re: [PATCH 1/2] vfio powerpc: enabled on powernv platform

2013-02-11 Thread Alexey Kardashevskiy
On 12/02/13 09:16, Alex Williamson wrote: On Mon, 2013-02-11 at 22:54 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO

Re: [PATCH 2/2] vfio powerpc: implemented IOMMU driver for VFIO

2013-02-11 Thread Alexey Kardashevskiy
On 12/02/13 09:17, Alex Williamson wrote: On Mon, 2013-02-11 at 22:54 +1100, Alexey Kardashevskiy wrote: VFIO implements platform independent stuff such as a PCI driver, BAR access (via read/write on a file descriptor or direct mapping when possible) and IRQ signaling. The platform dependent

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; + str

[PATCH] vfio powerpc: implement IOMMU driver for VFIO

2013-03-19 Thread Alexey Kardashevskiy
* various locks fixed Cc: David Gibson Signed-off-by: Alexey Kardashevskiy --- Documentation/vfio.txt | 63 ++ drivers/vfio/Kconfig|6 + drivers/vfio/Makefile |1 + drivers/vfio/vfio.c |1 + drivers/vfio/vfio_iommu_spapr_tce.c

Re: [PATCH] vfio powerpc: implement IOMMU driver for VFIO

2013-03-20 Thread Alexey Kardashevskiy
On 21/03/13 07:45, Alex Williamson wrote: On Tue, 2013-03-19 at 18:08 +1100, Alexey Kardashevskiy wrote: VFIO implements platform independent stuff such as a PCI driver, BAR access (via read/write on a file descriptor or direct mapping when possible) and IRQ signaling. The platform dependent

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

2013-05-06 Thread Alexey Kardashevskiy
reference. Alexey Kardashevskiy (6): KVM: PPC: Make lookup_linux_pte public KVM: PPC: Add support for multiple-TCE hcalls powerpc: Prepare to support kernel handling of IOMMU map/unmap iommu: Add a function to find an iommu group by id KVM: PPC: Add support for IOMMU in-kernel handling KVM

[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 Cc: David Gibson Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_ppc.h |3 +++ arch/powerpc/kvm/book3s_hv_rm_mmu.c |5 +++-- 2 files changed, 6 insertions

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

2013-05-06 Thread Alexey Kardashevskiy
nvironment as things like 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 K

[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 Signed-off-by: Paul Mackerras --- drivers/iommu/iommu.c | 29 + include/linux/iommu.h

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

2013-05-06 Thread Alexey Kardashevskiy
this. This also adds the virt_only parameter to the KVM module for debug and performance check purposes. Tests show that this patch increases transmission speed from 220MB/s to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). Cc: David Gibson Signed-off-by: Alexey Kardashevskiy

[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 Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- Documentation/virtual/k

[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 Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h |2 + arch/powerpc/include/asm/kvm_ppc.h | 24 +++ arch/powerpc/kvm/book3s_64_vio.c| 79

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 >> >> The IOMMU API implements groups creating/deletion, device binding >> and IOMMU map/unmap operations. >> >> The Powe

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

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

2013-05-06 Thread Alexey Kardashevskiy
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, H_PUT_TCE_INDIRECT >> and H_STUFF_TCE requests without passing them to QEMU, which should >> save time on

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

2013-05-06 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 h

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 PC

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

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

2013-05-20 Thread Alexey Kardashevskiy
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 Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul

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

2013-05-20 Thread Alexey Kardashevskiy
nvironment as things like 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 K

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

2013-05-20 Thread Alexey Kardashevskiy
patch increases transmission speed from 220MB/s to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). Cc: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- Changes: 2013-05-20: * removed get_user() from real mode handlers * kvm_vcpu_arch::tce_tmp

[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 Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- Changes: * the real mode handler now searches for a huge page by gpa (used to be pte) * the virtual mode handler prints warning if it is called twice for the same huge page

[PATCH 2/3] powerpc/vfio: Implement IOMMU driver for VFIO

2013-05-20 Thread Alexey Kardashevskiy
/unmapping pages for the guest IO and provides information about DMA window (required by a POWER guest). Cc: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- Documentation/vfio.txt | 63 ++ drivers/vfio/Kconfig|6

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

2013-05-20 Thread Alexey Kardashevskiy
gainst v3.10-rc1. It also contains some bugfixes which are mentioned (if any) in the patch messages. Alexey Kardashevskiy (3): powerpc/vfio: Enable on POWERNV platform powerpc/vfio: Implement IOMMU driver for VFIO powerpc/vfio: Enable on pSeries platform Documentation/vfio.txt

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

2013-05-20 Thread Alexey Kardashevskiy
network. To enable VFIO on POWER, enable SPAPR_TCE_IOMMU config option and configure VFIO as required. Cc: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- Changes: * the PCI devices are added to groups from subsys_initcall_sync (used to be done via

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

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

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

2013-05-20 Thread Alexey Kardashevskiy
Oops, wrong subject (cut-n-paste) :) There are 3 patches, not 5. On 05/21/2013 01:33 PM, Alexey Kardashevskiy wrote: > The series adds support for VFIO on POWERPC in user space (such as QEMU). > The in-kernel real mode IOMMU support is added by another series posted > separately. &g

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

2013-05-23 Thread Alexey Kardashevskiy
On 05/24/2013 12:56 AM, Alex Williamson wrote: > On Tue, 2013-05-21 at 13:33 +1000, Alexey Kardashevskiy wrote: >> The series adds support for VFIO on POWERPC in user space (such as QEMU). >> The in-kernel real mode IOMMU support is added by another series posted >> separatel

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

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;

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

2013-05-27 Thread Alexey Kardashevskiy
On 05/27/2013 08:08 PM, Paolo Bonzini wrote: > Il 21/05/2013 05:06, Alexey Kardashevskiy ha scritto: >> 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. > > Do you

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 w

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

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.

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

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: >> &g

[PATCH] vfio: fix crash on rmmod

2013-06-04 Thread Alexey Kardashevskiy
devtmpfs_delete_node() calls devnode() callback with mode==NULL but vfio still tries to write there. The patch fixes this. Signed-off-by: Alexey Kardashevskiy --- Steps to reproduce on freshly booted system with no devices given to VFIO: modprobe vfio rmmod vfio_iommu_spapr_tce rmmod vfio

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

2013-06-04 Thread Alexey Kardashevskiy
Ben, ping! :) This series has tiny fixes (capability and ioctl numbers, changed documentation, compile errors in some configuration). More details are in the commit messages. Rebased on v3.10-rc4. Alexey Kardashevskiy (4): KVM: PPC: Add support for multiple-TCE hcalls powerpc: Prepare to

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

2013-06-04 Thread Alexey Kardashevskiy
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 Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul

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

2013-06-04 Thread Alexey Kardashevskiy
patch increases transmission speed from 220MB/s to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). Cc: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- Changes: 2013/06/05: * changed capability number * changed ioctl number * update the doc

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

2013-06-04 Thread Alexey Kardashevskiy
nvironment as things like 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 K

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

2013-06-04 Thread Alexey Kardashevskiy
and we may want to optimize this. Cc: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- Changes: 2013/06/05: * fixed compile error when CONFIG_IOMMU_API=n 2013/05/20: * the real mode handler now searches for a huge page by gpa (used to be pte) * the virtual

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

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

2013-06-17 Thread Alexey Kardashevskiy
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 Kardashevskiy wrote: >>> >>>> This

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

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; >> +} >>

[PATCH] kvm api doc: fix section numbers

2013-06-18 Thread Alexey Kardashevskiy
Signed-off-by: Alexey Kardashevskiy --- Documentation/virtual/kvm/api.txt |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 5f91eda..6365fef 100644 --- a/Documentation/virtual/kvm/api.txt

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

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 sti

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

[PATCH] vfio: fix documentation

2013-06-20 Thread Alexey Kardashevskiy
Signed-off-by: Alexey Kardashevskiy --- Documentation/vfio.txt |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/vfio.txt b/Documentation/vfio.txt index c55533c..d7993dc 100644 --- a/Documentation/vfio.txt +++ b/Documentation/vfio.txt @@ -172,12 +172,12

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
Cool, thanks! So we will need only this (to be called from KVM), and that will be it, right? int vfio_group_iommu_id_from_file(struct file *filep) ... On 06/22/2013 07:12 AM, Alex Williamson wrote: > vfio_group_fops_open attempts to limit concurrent sessions by > disallowing opens once group->

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
On 06/22/2013 11:26 AM, Alex Williamson wrote: > On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: >> Cool, thanks! >> >> So we will need only this (to be called from KVM), and that will be it, >> right? > > For what? This is not the external

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
On 06/22/2013 12:57 PM, Alex Williamson wrote: > On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: >> On 06/22/2013 11:26 AM, Alex Williamson wrote: >>> On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: >>>> Cool, thanks! >>>> &g

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

  1   2   3   4   5   >