Re: [PATCH 0/5] iommu/vt-d: Fix crash dump failure caused by legacy DMA/IO

2014-10-27 Thread Li, ZhenHua
Hi Baoquan, I failed in testing this patchset for 3.18.0-rc1, this upstream 3.18.0-rc1 kernel cannot boot on my system, have not found out the reason. Could you please test this patchset on 3.17.0 to see whether it has these faults? Thanks Zhenhua On 10/22/2014 06:05 PM, Baoquan He wrote: Hi

[Patch Part1 v3 17/20] x86: irq_remapping: Use helpers to access irq_cfg data structure associated with IRQ

2014-10-27 Thread Jiang Liu
Use helpers to access irq_cfg data structure associated with IRQ, instead of accessing irq_data->chip_data directly. Later we could rewrite those helpers to support hierarchy irqdomain. Signed-off-by: Jiang Liu --- drivers/iommu/irq_remapping.c |6 +++--- 1 file changed, 3 insertions(+), 3 d

[Patch Part1 v3 18/20] iommu/vt-d: Use helpers to access irq_cfg data structure associated with IRQ

2014-10-27 Thread Jiang Liu
Use helpers to access irq_cfg data structure associated with IRQ, instead of accessing irq_data->chip_data directly. Later we could rewrite those helpers to support hierarchy irqdomain. Signed-off-by: Jiang Liu --- drivers/iommu/intel_irq_remapping.c | 10 +- 1 file changed, 5 insertio

[Patch Part1 v3 19/20] iommu/amd: Use helpers to access irq_cfg data structure associated with IRQ

2014-10-27 Thread Jiang Liu
Use helpers to access irq_cfg data structure associated with IRQ, instead of accessing irq_data->chip_data directly. Later we could rewrite those helpers to support hierarchy irqdomain. Signed-off-by: Jiang Liu --- drivers/iommu/amd_iommu.c | 14 +++--- 1 file changed, 7 insertions(+),

Re: [PATCH v5 1/3] iommu/rockchip: rk3288 iommu driver

2014-10-27 Thread Daniel Kurtz
On Mon, Oct 27, 2014 at 4:32 AM, Heiko Stübner wrote: > Hi Daniel, > > Am Freitag, 24. Oktober 2014, 15:33:47 schrieb Daniel Kurtz: > > [...] > >> +static int rk_iommu_attach_device(struct iommu_domain *domain, >> + struct device *dev) >> +{ >> + struct rk_iommu *

Re: [PATCH 0/5] iommu/vt-d: Fix crash dump failure caused by legacy DMA/IO

2014-10-27 Thread Baoquan He
On 10/27/14 at 03:29pm, Li, ZhenHua wrote: > Hi Baoquan, > I failed in testing this patchset for 3.18.0-rc1, this upstream > 3.18.0-rc1 kernel cannot boot on my system, have not found out the > reason. > > Could you please test this patchset on 3.17.0 to see whether it has > these faults? > > Tha

Re: [RFC PATCH v3 5/7] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-10-27 Thread Will Deacon
On Tue, Oct 14, 2014 at 01:53:59PM +0100, Laurent Pinchart wrote: > Hi Will, Hi Laurent, > On Monday 22 September 2014 18:50:27 Will Deacon wrote: > > On Mon, Sep 22, 2014 at 10:29:10AM +0100, Thierry Reding wrote: > > > Agreed. I wonder how useful it is to know the set of IOMMU instances > > > t

Re: [RFC PATCH v3 5/7] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-10-27 Thread Marek Szyprowski
Hello, On 2014-10-27 11:51, Will Deacon wrote: On Tue, Oct 14, 2014 at 01:53:59PM +0100, Laurent Pinchart wrote: On Monday 22 September 2014 18:50:27 Will Deacon wrote: On Mon, Sep 22, 2014 at 10:29:10AM +0100, Thierry Reding wrote: Agreed. I wonder how useful it is to know the set of IOMMU i

Re: [RFC PATCH v3 5/7] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-10-27 Thread Laurent Pinchart
Hi Will, On Monday 27 October 2014 10:51:59 Will Deacon wrote: > On Tue, Oct 14, 2014 at 01:53:59PM +0100, Laurent Pinchart wrote: > > On Monday 22 September 2014 18:50:27 Will Deacon wrote: > > > On Mon, Sep 22, 2014 at 10:29:10AM +0100, Thierry Reding wrote: > > > > Agreed. I wonder how useful i

Re: [PATCH v6 2/2] iommu/arm-smmu: add support for iova_to_phys through ATS1PR

2014-10-27 Thread Will Deacon
On Tue, Oct 14, 2014 at 10:53:30PM +0100, Mitchel Humpherys wrote: > Currently, we provide the iommu_ops.iova_to_phys service by doing a > table walk in software to translate IO virtual addresses to physical > addresses. On SMMUs that support it, it can be useful to ask the SMMU > itself to do the

Re: [PATCH] arm: dma-mapping: fix compilation error when CONFIG_MMU is not present

2014-10-27 Thread Marek Szyprowski
Hello, On 2014-10-24 15:15, Stefan Hengelein wrote: Hello, adding a dependency to CONFIG_ARM_DMA_USE_IOMMU is probably not a good idea anyways. If you read the Documentation/kbuild/kconfig-language.txt, you will see that: 1. in general, selected options should have no prompt and no dependencies

[PATCH v6 1/3] iommu/rockchip: rk3288 iommu driver

2014-10-27 Thread Daniel Kurtz
The rk3288 has several iommus. Each iommu belongs to a single master device. There is one device (ISP) that has two slave iommus, but that case is not yet supported by this driver. At subsys init, the iommu driver registers itself as the iommu driver for the platform bus. The master devices fin

[PATCH 11/16] s390/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang Acked-by: Sebastian Ott --- arch/s390/include/asm/pci.h |1 + arch/s390/pci/pci.c | 19 +-- 2 fi

[PATCH 01/16] PCI/MSI: Refactor MSI controller to make it become more common

2014-10-27 Thread Yijing Wang
Now there are a lot of weak arch MSI functions in MSI code. These functions make MSI driver complex. Because people need to know much which arch MSI function should be overrode and which is not. Thierry introduced MSI chip framework to configure MSI/MSI-X irq in arm. MSI chip framework is better th

[PATCH 13/16] IA64/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- arch/ia64/include/asm/pci.h |3 ++- arch/ia64/kernel/msi_ia64.c | 24 ++-- arch/ia64/pci/pci.c

[PATCH 07/16] MIPS/Octeon/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- arch/mips/include/asm/octeon/pci-octeon.h |4 +++ arch/mips/pci/msi-octeon.c| 31

[PATCH 10/16] Powerpc/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang Acked-by: Michael Ellerman --- arch/powerpc/include/asm/pci-bridge.h |8 arch/powerpc/kernel/msi.c |

[PATCH 16/16] PCI/MSI: Clean up unused MSI arch functions

2014-10-27 Thread Yijing Wang
Now we use MSI controller in all platforms to configure MSI/MSI-X. We can clean up the unused arch functions. Signed-off-by: Yijing Wang Reviewed-by: Lucas Stach --- drivers/pci/msi.c | 90 ++ include/linux/msi.h | 11 -- 2 files changed

[PATCH 00/16] Use MSI controller framework to configure MSI/MSI-X

2014-10-27 Thread Yijing Wang
This series is based on "[PATCH 00/10] Save MSI chip in pci_sys_data", https://lkml.org/lkml/2014/10/27/85. This series is the v4 of "Use MSI chip framework to configure MSI/MSI-X in all platforms". I split it out and post it together. v3->new: Some trivial changes in "IA64/MSI: Use MSI controll

[PATCH 04/16] Irq_remapping/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- drivers/iommu/irq_remapping.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/io

[PATCH 06/16] Mips/MSI: Save MSI controller in pci sysdata

2014-10-27 Thread Yijing Wang
Save MSI controller in pci sysdata, add arch pcibios_msi_controller() to extract out MSI controller. Signed-off-by: Yijing Wang --- arch/mips/include/asm/pci.h |3 +++ arch/mips/pci/pci.c |9 + 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/mips/incl

[PATCH 09/16] MIPS/Xlr/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- arch/mips/pci/pci-xlr.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/mips

[PATCH 08/16] MIPS/Xlp/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X IRQ. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- arch/mips/include/asm/netlogic/xlp-hal/pcibus.h |1 + arch/mips/pci/msi-xlp.c | 11 +-

[PATCH 14/16] Sparc/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang Acked-by: David S. Miller --- arch/sparc/kernel/pci.c | 20 ++-- arch/sparc/kernel/pci_impl.h |3 ++

[PATCH 05/16] x86/MSI: Remove unused MSI weak arch functions

2014-10-27 Thread Yijing Wang
Now we can clean up MSI weak arch functions in x86. Signed-off-by: Yijing Wang --- arch/x86/include/asm/pci.h |5 + arch/x86/include/asm/x86_init.h |4 arch/x86/kernel/apic/io_apic.c | 21 + arch/x86/kernel/x86_init.c | 24 -

[PATCH 15/16] tile/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- arch/tile/include/asm/pci.h |2 ++ arch/tile/kernel/pci_gx.c | 18 -- 2 files changed, 18 insertion

[PATCH 12/16] arm/iop13xx/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- arch/arm/mach-iop13xx/include/mach/pci.h |4 arch/arm/mach-iop13xx/iq81340mc.c|3 +++ arch/arm/mach-io

[PATCH 03/16] x86/xen/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang CC: David Vrabel CC: Konrad Rzeszutek Wilk --- arch/x86/pci/xen.c | 45 +++-- 1 fil

[PATCH 02/16] x86/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- arch/x86/include/asm/pci.h |4 arch/x86/kernel/apic/io_apic.c | 25 + arch/x86/pci/a

Re: [PATCH v3 16/27] Mips/MSI: Save msi chip in pci sysdata

2014-10-27 Thread Ralf Baechle
On Wed, Oct 15, 2014 at 11:07:04AM +0800, Yijing Wang wrote: > +static inline struct msi_chip *pci_msi_chip(struct pci_bus *bus) > +{ > + struct pci_controller *control = (struct pci_controller *)bus->sysdata; bus->sysdata is void * so this cast is unnecessary. Ralf ___

Re: [PATCH] arm: dma-mapping: fix compilation error when CONFIG_MMU is not present

2014-10-27 Thread Stefan Hengelein
Hello, adding a dependency to CONFIG_ARM_DMA_USE_IOMMU is probably not a good idea anyways. If you read the Documentation/kbuild/kconfig-language.txt, you will see that: 1. in general, selected options should have no prompt and no dependencies 2. giving ARM_DMA_USE_IOMMU a dependency on MMU will a

Re: [PATCH v3 18/27] MIPS/Xlp: Remove the dead function destroy_irq() to fix build error

2014-10-27 Thread Ralf Baechle
Applied, thanks. Ralf ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [RFC PATCH v3 5/7] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-10-27 Thread Will Deacon
On Mon, Oct 27, 2014 at 11:30:33AM +, Laurent Pinchart wrote: > Hi Will, Hey Laurent, > On Monday 27 October 2014 10:51:59 Will Deacon wrote: > > On Tue, Oct 14, 2014 at 01:53:59PM +0100, Laurent Pinchart wrote: > > > On Monday 22 September 2014 18:50:27 Will Deacon wrote: > > > > On Mon, Sep

Re: [PATCH linux-next] iommu: add iommu for s390 platform

2014-10-27 Thread Joerg Roedel
On Mon, Oct 27, 2014 at 03:32:01PM +0100, Gerald Schaefer wrote: > Not sure if I understood the concept of IOMMU domains right. But if this > is about having multiple devices in the same domain, so that iommu_ops->map > will establish the _same_ DMA mapping on _all_ registered devices, then > this

Re: [RFC PATCH v3 5/7] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-10-27 Thread jroe...@suse.de
On Mon, Oct 27, 2014 at 04:02:16PM +, Will Deacon wrote: > On Mon, Oct 27, 2014 at 11:30:33AM +, Laurent Pinchart wrote: > > I'm not sure to follow you here. Aren't we already exposing masters that > > master through multiple IOMMUs as single instances of struct device ? > > Hmm, yes, now

Re: [PATCH linux-next] iommu: add iommu for s390 platform

2014-10-27 Thread Gerald Schaefer
On Thu, 23 Oct 2014 16:04:37 +0200 Frank Blaschka wrote: > On Thu, Oct 23, 2014 at 02:41:15PM +0200, Joerg Roedel wrote: > > On Wed, Oct 22, 2014 at 05:43:20PM +0200, Frank Blaschka wrote: > > > Basically there are no limitations. Depending on the s390 maschine > > > generation a device starts it

Re: [PATCH linux-next] iommu: add iommu for s390 platform

2014-10-27 Thread Gerald Schaefer
On Mon, 27 Oct 2014 17:25:02 +0100 Joerg Roedel wrote: > On Mon, Oct 27, 2014 at 03:32:01PM +0100, Gerald Schaefer wrote: > > Not sure if I understood the concept of IOMMU domains right. But if > > this is about having multiple devices in the same domain, so that > > iommu_ops->map will establish

Re: [PATCH linux-next] iommu: add iommu for s390 platform

2014-10-27 Thread Joerg Roedel
On Mon, Oct 27, 2014 at 06:02:19PM +0100, Gerald Schaefer wrote: > On Mon, 27 Oct 2014 17:25:02 +0100 > Joerg Roedel wrote: > > Is there some hardware reason for this or is that just an > > implementation detail that can be changed. In other words, does the > > hardware allow to use the same DMA t

[PATCH v2 0/6] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2014-10-27 Thread Antonios Motakis
This patch series makes the VFIO_IOMMU_TYPE1 driver buildable on ARM, so it may be used with ARM SMMUs. It also adds support for the IOMMU_NOEXEC flag supported by SMMUs adhering to the ARM SMMU specification so the VFIO user can specify whether the target memory can be executed by the device behin

[PATCH v2 3/6] vfio: introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag

2014-10-27 Thread Antonios Motakis
We introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag to the VFIO dma map call, and expose its availability via the capability VFIO_DMA_NOEXEC_IOMMU. This way the user can control whether the XN flag will be set on the requested mappings. The IOMMU_NOEXEC flag needs to be available for all the IOMMUs of t

[PATCH v2 6/6] vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag

2014-10-27 Thread Antonios Motakis
Some IOMMU drivers, such as the ARM SMMU driver, make available the IOMMU_NOEXEC flag to set the page tables for a device as XN (execute never). This affects devices such as the ARM PL330 DMA Controller, which respects this flag and will refuse to fetch DMA instructions from memory where the XN fla

[PATCH v2 2/6] vfio: type1: support for platform bus devices on ARM

2014-10-27 Thread Antonios Motakis
This allows to make use of the VFIO_IOMMU_TYPE1 driver with platform devices on ARM. The driver can then be used with an Exynos SMMU, or ARM SMMU driver. Signed-off-by: Antonios Motakis --- drivers/vfio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/Kcon

[PATCH v2 1/6] vfio: implement iommu driver capabilities with an enum

2014-10-27 Thread Antonios Motakis
Currently a VFIO driver's IOMMU capabilities are encoded as a series of numerical defines. Replace this with an enum for future maintainability. Signed-off-by: Antonios Motakis --- include/uapi/linux/vfio.h | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git

[PATCH v2 5/6] vfio: type1: replace vfio_domains_have_iommu_cache with generic function

2014-10-27 Thread Antonios Motakis
Replace the function vfio_domains_have_iommu_cache() with a more generic function vfio_domains_have_iommu_cap() which allows to check all domains of an vfio_iommu structure for a given cached capability. Signed-off-by: Antonios Motakis --- drivers/vfio/vfio_iommu_type1.c | 37 +++

[PATCH v2 4/6] vfio: type1: replace domain wide protection flags with supported capabilities

2014-10-27 Thread Antonios Motakis
VFIO_IOMMU_TYPE1 keeps track for each domain it knows a list of protection flags it always applies to all mappings in the domain. This is used for domains that support IOMMU_CAP_CACHE_COHERENCY. Refactor this slightly, by keeping track instead that a given domain supports the capability, and apply

[PATCH v9 00/19] VFIO support for platform and AMBA devices on ARM

2014-10-27 Thread Antonios Motakis
This patch series aims to implement VFIO support for platform devices that reside behind an IOMMU. Examples of such devices are devices behind an ARM SMMU, or behind a Samsung Exynos System MMU. The API used is based on the existing VFIO API that is also used with PCI devices. Only devices that in

[PATCH v9 01/19] vfio/platform: initial skeleton of VFIO support for platform devices

2014-10-27 Thread Antonios Motakis
This patch forms the common skeleton code for platform devices support with VFIO. This will include the core functionality of VFIO_PLATFORM, however binding to the device and discovering the device resources will be done with the help of a separate file where any Linux platform bus specific code wi

[PATCH v9 03/19] vfio: platform: add the VFIO PLATFORM module to Kconfig

2014-10-27 Thread Antonios Motakis
Enable building the VFIO PLATFORM driver that allows to use Linux platform devices with VFIO. Signed-off-by: Antonios Motakis --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/platform/Kconfig | 9 + drivers/vfio/platform/Makefile | 4 4 f

[PATCH v9 04/19] vfio: amba: VFIO support for AMBA devices

2014-10-27 Thread Antonios Motakis
Add support for discovering AMBA devices with VFIO and handle them similarly to Linux platform devices. Signed-off-by: Antonios Motakis --- drivers/vfio/platform/vfio_amba.c | 116 ++ include/uapi/linux/vfio.h | 1 + 2 files changed, 117 insertions(+

[PATCH v9 06/19] vfio/platform: return info for bound device

2014-10-27 Thread Antonios Motakis
A VFIO userspace driver will start by opening the VFIO device that corresponds to an IOMMU group, and will use the ioctl interface to get the basic device info, such as number of memory regions and interrupts, and their properties. This patch enables the VFIO_DEVICE_GET_INFO ioctl call. Signed-off

[PATCH v9 05/19] vfio: amba: add the VFIO for AMBA devices module to Kconfig

2014-10-27 Thread Antonios Motakis
Enable building the VFIO AMBA driver. VFIO_AMBA depends on VFIO_PLATFORM, since it is sharing a portion of the code, and it is essentially implemented as a platform device whose resources are discovered via AMBA specific APIs in the kernel. Signed-off-by: Antonios Motakis --- drivers/vfio/platfo

[PATCH v9 08/19] vfio/platform: read and write support for the device fd

2014-10-27 Thread Antonios Motakis
VFIO returns a file descriptor which we can use to manipulate the memory regions of the device. Usually, the user will mmap memory regions that are addressable on page boundaries, however for memory regions where this is not the case we cannot provide mmap functionality due to security concerns. Fo

[PATCH v9 07/19] vfio/platform: return info for device memory mapped IO regions

2014-10-27 Thread Antonios Motakis
This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, which allows the user to learn about the available MMIO resources of a device. Signed-off-by: Antonios Motakis --- drivers/vfio/platform/vfio_platform_common.c | 110 +- drivers/vfio/platform/vfio_plat

[PATCH v9 10/19] vfio/platform: return IRQ info

2014-10-27 Thread Antonios Motakis
Return information for the interrupts exposed by the device. This patch extends VFIO_DEVICE_GET_INFO with the number of IRQs and enables VFIO_DEVICE_GET_IRQ_INFO. Signed-off-by: Antonios Motakis --- drivers/vfio/platform/Makefile| 2 +- drivers/vfio/platform/vfio_platform_common

[PATCH v9 12/19] vfio/platform: trigger an interrupt via eventfd

2014-10-27 Thread Antonios Motakis
This patch allows to set an eventfd for a patform device's interrupt, and also to trigger the interrupt eventfd from userspace for testing. Level sensitive interrupts are marked as maskable and are handled in a later patch. Edge triggered interrupts are not advertised as maskable and are implemente

[PATCH v9 11/19] vfio/platform: initial interrupts support code

2014-10-27 Thread Antonios Motakis
This patch is a skeleton for the VFIO_DEVICE_SET_IRQS IOCTL, around which most IRQ functionality is implemented in VFIO. Signed-off-by: Antonios Motakis --- drivers/vfio/platform/vfio_platform_common.c | 52 +++-- drivers/vfio/platform/vfio_platform_irq.c | 56 ++

[PATCH v9 09/19] vfio/platform: support MMAP of MMIO regions

2014-10-27 Thread Antonios Motakis
Allow to memory map the MMIO regions of the device so userspace can directly access them. PIO regions are not being handled at this point. Signed-off-by: Antonios Motakis --- drivers/vfio/platform/vfio_platform_common.c | 65 1 file changed, 65 insertions(+) diff --

[PATCH v9 19/19] vfio/platform: implement IRQ masking/unmasking via an eventfd

2014-10-27 Thread Antonios Motakis
With this patch the VFIO user will be able to set an eventfd that can be used in order to mask and unmask IRQs of platform devices. Signed-off-by: Antonios Motakis --- drivers/vfio/platform/vfio_platform_irq.c | 47 --- drivers/vfio/platform/vfio_platform_private.h |

[PATCH v9 14/19] vfio: move eventfd support code for VFIO_PCI to a separate file

2014-10-27 Thread Antonios Motakis
The virqfd functionality that is used by VFIO_PCI to implement interrupt masking and unmasking via an eventfd, is generic enough and can be reused by another driver. Move it to a separate file in order to allow the code to be shared. Also properly export virqfd_enable and virqfd_disable in the pro

[PATCH v9 16/19] vfio: pass an opaque pointer on virqfd initialization

2014-10-27 Thread Antonios Motakis
VFIO_PCI passes the VFIO device structure *vdev via eventfd to the handler that implements masking/unmasking of IRQs via an eventfd. We can replace it in the virqfd infrastructure with an opaque type so we can make use of the mechanism from other VFIO bus drivers. Signed-off-by: Antonios Motakis

[PATCH v9 17/19] vfio: virqfd: add vfio_ prefix to virqfd_enable and virqfd_disable

2014-10-27 Thread Antonios Motakis
The virqfd_enable and virqfd_disable functions are now global. Add the vfio_ prefix to those functions. Signed-off-by: Antonios Motakis --- drivers/vfio/pci/vfio_pci_intrs.c | 18 +- drivers/vfio/virqfd.c | 14 +++--- include/linux/vfio.h | 10 +++

[PATCH v9 13/19] vfio/platform: support for level sensitive interrupts

2014-10-27 Thread Antonios Motakis
Level sensitive interrupts are exposed as maskable and automasked interrupts and are masked and disabled automatically when they fire. Signed-off-by: Antonios Motakis --- drivers/vfio/platform/vfio_platform_irq.c | 102 +- drivers/vfio/platform/vfio_platform_private.h

[PATCH v9 02/19] vfio: platform: probe to devices on the platform bus

2014-10-27 Thread Antonios Motakis
Driver to bind to Linux platform devices, and callbacks to discover their resources to be used by the main VFIO PLATFORM code. Signed-off-by: Antonios Motakis --- drivers/vfio/platform/vfio_platform.c | 114 ++ include/uapi/linux/vfio.h | 1 + 2 file

[PATCH v9 15/19] vfio: add local lock in virqfd instead of depending on VFIO PCI

2014-10-27 Thread Antonios Motakis
Virqfd just needs to keep accesses to any struct *virqfd safe, but this comes into play only when creating or destroying eventfds, so sharing the same spinlock with the VFIO bus driver is not necessary. Signed-off-by: Antonios Motakis --- drivers/vfio/pci/vfio_pci_intrs.c | 10 +- driver

[PATCH v9 18/19] vfio: initialize the virqfd workqueue in VFIO generic code

2014-10-27 Thread Antonios Motakis
Now we have finally completely decoupled virqfd from VFIO_PCI. We can initialize it from the VFIO generic code, in order to safely use it from multiple independent VFIO bus drivers. Signed-off-by: Antonios Motakis --- drivers/vfio/pci/vfio_pci.c | 8 drivers/vfio/vfio.c | 8

Re: [PATCH linux-next] iommu: add iommu for s390 platform

2014-10-27 Thread Gerald Schaefer
On Mon, 27 Oct 2014 18:58:35 +0100 Joerg Roedel wrote: > On Mon, Oct 27, 2014 at 06:02:19PM +0100, Gerald Schaefer wrote: > > On Mon, 27 Oct 2014 17:25:02 +0100 > > Joerg Roedel wrote: > > > Is there some hardware reason for this or is that just an > > > implementation detail that can be changed

Re: [PATCH v9 14/19] vfio: move eventfd support code for VFIO_PCI to a separate file

2014-10-27 Thread Bjorn Helgaas
Hi Antonios, On Mon, Oct 27, 2014 at 12:07 PM, Antonios Motakis wrote: > The virqfd functionality that is used by VFIO_PCI to implement interrupt > masking and unmasking via an eventfd, is generic enough and can be reused > by another driver. Move it to a separate file in order to allow the code

Re: [PATCH v9 17/19] vfio: virqfd: add vfio_ prefix to virqfd_enable and virqfd_disable

2014-10-27 Thread Bjorn Helgaas
On Mon, Oct 27, 2014 at 12:08 PM, Antonios Motakis wrote: > The virqfd_enable and virqfd_disable functions are now global. Add the > vfio_ prefix to those functions. Wouldn't it be better to change the name *before* making them global? Bjorn ___ iommu