[PATCH] vfio powerpc: enabled and supported on powernv platform

2012-11-19 Thread Alexey Kardashevskiy
tree for a guest OS properly. Although this driver has been tested only on POWERNV, it should work on any platform supporting TCE tables. To enable VFIO on POWER, enable SPAPR_TCE_IOMMU config option. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru

Re: [PATCH] vfio powerpc: enabled and supported on powernv platform

2012-11-22 Thread Alexey Kardashevskiy
On 22/11/12 22:56, Sethi Varun-B16395 wrote: -Original Message- From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- ow...@vger.kernel.org] On Behalf Of Alex Williamson Sent: Tuesday, November 20, 2012 11:50 PM To: Alexey Kardashevskiy Cc: Benjamin Herrenschmidt; Paul

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

2012-11-23 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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- drivers/vfio

[PATCH 0/2] vfio powerpc: implemented and enabled

2012-11-23 Thread Alexey Kardashevskiy
The series includes IOMMU implementation and necessary IOMMU groups initialization. Alexey Kardashevskiy (2): vfio powerpc: implemented IOMMU driver for VFIO vfio powerpc: enabled on powernv platform arch/powerpc/include/asm/iommu.h |6 + arch/powerpc/kernel/iommu.c | 141

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

2012-11-23 Thread Alexey Kardashevskiy
SPAPR_TCE_IOMMU config option and configure VFIO as required. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/iommu.h |6 ++ arch/powerpc/kernel/iommu.c | 141 ++ arch/powerpc

Re: [PATCH] vfio powerpc: enabled and supported on powernv platform

2012-11-26 Thread Alexey Kardashevskiy
On 27/11/12 05:04, Alex Williamson wrote: On Mon, 2012-11-26 at 08:18 -0700, Alex Williamson wrote: On Fri, 2012-11-23 at 13:02 +1100, Alexey Kardashevskiy wrote: On 22/11/12 22:56, Sethi Varun-B16395 wrote: -Original Message- From: linux-kernel-ow...@vger.kernel.org [mailto:linux

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

2012-11-26 Thread Alexey Kardashevskiy
On 27/11/12 05:20, Alex Williamson wrote: On Fri, 2012-11-23 at 20:03 +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 1/2] vfio powerpc: implemented IOMMU driver for VFIO

2012-11-26 Thread Alexey Kardashevskiy
On 27/11/12 15:29, Alex Williamson wrote: On Tue, 2012-11-27 at 15:06 +1100, Alexey Kardashevskiy wrote: On 27/11/12 05:20, Alex Williamson wrote: On Fri, 2012-11-23 at 20:03 +1100, Alexey Kardashevskiy wrote: VFIO implements platform independent stuff such as a PCI driver, BAR access (via

[PATCH] vfio powerpc: implemented IOMMU driver for VFIO

2012-11-27 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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- drivers/vfio

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

2012-11-28 Thread Alexey Kardashevskiy
On 29/11/12 08:01, Alex Williamson wrote: On Wed, 2012-11-28 at 18:21 +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 1/2] vfio powerpc: enabled on powernv platform

2012-12-02 Thread Alexey Kardashevskiy
SPAPR_TCE_IOMMU config option and configure VFIO as required. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/iommu.h |9 ++ arch/powerpc/kernel/iommu.c | 186 ++ arch/powerpc

[PATCH 0/2] vfio on power: yet another try

2012-12-02 Thread Alexey Kardashevskiy
) but have not decided about its actual design yet. Alexey Kardashevskiy (2): vfio powerpc: enabled on powernv platform vfio powerpc: implemented IOMMU driver for VFIO arch/powerpc/include/asm/iommu.h |9 + arch/powerpc/kernel/iommu.c | 186 ++ arch/powerpc

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

2012-12-02 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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- drivers/vfio

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

2012-12-04 Thread Alexey Kardashevskiy
On 04/12/12 04:35, Alex Williamson wrote: On Mon, 2012-12-03 at 13:52 +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

[PATCH] vfio powerpc: implemented IOMMU driver for VFIO

2012-12-06 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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- drivers/vfio

[PATCH] vfio powerpc: enabled on powernv platform

2012-12-06 Thread Alexey Kardashevskiy
SPAPR_TCE_IOMMU config option and configure VFIO as required. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/iommu.h | 10 ++ arch/powerpc/kernel/iommu.c | 214 ++ arch/powerpc

[PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alexey Kardashevskiy
SPAPR_TCE_IOMMU config option and configure VFIO as required. Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/iommu.h | 10 ++ arch/powerpc/kernel/iommu.c | 329 ++ arch/powerpc

[PATCH] vfio powerpc: implemented IOMMU driver for VFIO

2012-12-12 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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- drivers/vfio

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alexey Kardashevskiy
On 13/12/12 10:30, Alex Williamson wrote: On Wed, 2012-12-12 at 23:34 +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] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alexey Kardashevskiy
On 13/12/12 13:29, Benjamin Herrenschmidt wrote: On Wed, 2012-12-12 at 07:34 -0700, Alex Williamson wrote: But what would I put there?... IOMMU ID is more than enough at the moment and struct iommu_table does not have anything what would have made sense to show in the sysfs... I believe David

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

2012-06-06 Thread Alexey Kardashevskiy
won't report it as compatible. Reported-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Jan Kiszka jan.kis...@web.de --- Alexey, please test if this catches your case correctly. Alexey? Ping for testing. Sorry, was in vacation and then a bit busy. Yes, that works, thanks. It just

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 a...@ozlabs.ru --- hw/pci.c | 25 - 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/hw/pci.c b/hw

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 built by QEMU. In the case of VFIO

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_capability is called on devices to add new capability. This is ok for emulated

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 initialized

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, performs the accesses

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 QEMU, then crash QEMU (stop

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 the

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.

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

2012-01-31 Thread Alexey Kardashevskiy
: Signed-off-by: David Gibson da...@gibson.dropbear.id.au For the bits derived from my code: Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru -- Alexey -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info

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

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

2011-11-28 Thread Alexey Kardashevskiy
it. Appreciate any feedback or suggestions. Thanks, Alex -- Alexey Kardashevskiy IBM OzLabs, LTC Team e-mail: a...@au1.ibm.com notes: Alexey Kardashevskiy/Australia/IBM -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo

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

2011-11-28 Thread Alexey Kardashevskiy
) qemu_free(vdev-msi_vectors); vdev-nr_vectors = 0; return; +} else if (0 ret) { +vdev-nr_vectors = ret; } vdev-interrupt = msix ? INT_MSIX : INT_MSI; === end === On 29/11/11 12:52, Alexey Kardashevskiy wrote: Hi! I tried (successfully) to run

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

2011-11-28 Thread Alexey Kardashevskiy
); === end === On 29/11/11 13:01, Alexey Kardashevskiy wrote: Hi all, Another problem I hit on POWER - MSI interrupts allocation. The existing VFIO does not expect a PBH to support less interrupts that a device might request. In my case, PHB's limit is 8 interrupts while my test card

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. Great! IOMMU domain setup. On POWER

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! I tried (successfully) to run it on POWER and while doing that I found

[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 a...@ozlabs.ru --- 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

[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 a...@ozlabs.ru --- 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

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. In the case of VFIO the capability

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. In the case of VFIO

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

2012-05-12 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-12 Thread Alexey Kardashevskiy
. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- 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/drivers/vfio

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

2012-05-12 Thread Alexey Kardashevskiy
initialize in its own way. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- 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 100644

[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 a...@ozlabs.ru --- 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

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: PCI region size must be pow2

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_capability is called on devices to add new capability. This is ok

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 another proposed solution (commit

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 to obtain an IRQ line number to initialize End

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 interrupt routing schemes. And of course

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

2012-05-17 Thread Alexey Kardashevskiy
; +} + 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, at 14:47, Alexey Kardashevskiy wrote: 11.05.2012 20:52

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 b...@kernel.crashing.org wrote: On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: Alexander, Is that any better? :) Alex (Graf that is), ping ? The original patch from Alexey

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

2012-05-22 Thread Alexey Kardashevskiy
On 22/05/12 15:52, Alexander Graf wrote: On 22.05.2012, at 05:44, Alexey Kardashevskiy a...@ozlabs.ru wrote: On 22/05/12 13:21, Alexander Graf wrote: On 22.05.2012, at 04:02, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Fri, 2012-05-18 at 15:12 +1000, Alexey

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 a...@ozlabs.ru wrote: On 22/05/12 15:52, Alexander Graf wrote: On 22.05.2012, at 05:44, Alexey Kardashevskiy a...@ozlabs.ru wrote: On 22/05/12 13:21, Alexander Graf wrote: On 22.05.2012, at 04:02

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

2012-05-23 Thread Alexey Kardashevskiy
for it? The 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 a...@ozlabs.ru --- arch/powerpc/Kconfig |6 + arch/powerpc/include/asm/iommu.h |3 + arch/powerpc

[RFC PATCH] PCI: Introduce INTx check mask API

2012-05-24 Thread Alexey Kardashevskiy
to set Status bit if it supports INTx masking? 2 Alex: if it is mandatory, then we need to be able to disable pci_2_3 in VFIO-PCI somehow. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- drivers/pci/pci.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

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, checking if the

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. Yes, 2.3 introduced this. Masking

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 all, instead it calls POWER IOMMU API directly (ppc_md

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] There is a feature in PCI (=2.3?) to mask/unmask

[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 a...@ozlabs.ru --- drivers/vfio/pci/vfio_pci.c

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, Alexey Kardashevskiy wrote: [Found while debugging VFIO

[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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- arch/powerpc/include/asm/iommu.h| 15 ++ arch/powerpc/kernel/iommu.c | 343

[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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- 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; +

[PATCH] vfio powerpc: implement IOMMU driver for VFIO

2013-03-19 Thread Alexey Kardashevskiy
* various locks fixed Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- Documentation/vfio.txt | 63 ++ drivers/vfio/Kconfig|6 + drivers/vfio/Makefile |1 + drivers/vfio/vfio.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
. 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 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

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

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-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 switching to QEMU and back

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

[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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- Documentation/vfio.txt | 63

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

2013-05-20 Thread Alexey Kardashevskiy
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 | 63

[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 da...@gibson.dropbear.id.au Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Paul Mackerras pau...@samba.org --- Changes: * the PCI devices are added to groups

[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 a...@ozlabs.ru Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Paul Mackerras pau...@samba.org --- arch/powerpc/platforms/pseries/iommu.c |4

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. As the first

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 separately. As the first and main

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 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 mean vio? virtio (without getting

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

  1   2   3   4   5   6   >