Re: [RFC PATCH v3 7/7] arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops

2014-09-25 Thread Thierry Reding
On Wed, Sep 24, 2014 at 05:33:38PM +0100, Will Deacon wrote: On Tue, Sep 23, 2014 at 08:14:01AM +0100, Thierry Reding wrote: On Mon, Sep 22, 2014 at 06:43:37PM +0100, Will Deacon wrote: Yup. In this case, the iommu_dma_mapping passed to arch_setup_dma_ops contains a domain and an

Re: [PATCH v2 02/22] PCI/MSI: Remove useless bus-msi assignment

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:12AM +0800, Yijing Wang wrote: Currently, PCI drivers will initialize bus-msi in pcibios_add_bus(). pcibios_add_bus() will be called in every pci bus initialization. So the bus-msi assignment in pci_alloc_child_bus() is useless. I think this should be the other

Re: [PATCH v2 01/22] PCI/MSI: Clean up struct msi_chip argument

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:11AM +0800, Yijing Wang wrote: Msi_chip functions setup_irq/teardown_irq rarely use msi_chip argument. That's not true. Out of the four drivers that you modify two use the parameter. And the two that don't probably should be using it too. 50% is not rarely. =)

Re: [PATCH v2 03/22] MSI: Remove the redundant irq_set_chip_data()

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:13AM +0800, Yijing Wang wrote: Currently, pcie-designware, pcie-rcar, pci-tegra drivers use irq chip_data to save the msi_chip pointer. They already call irq_set_chip_data() in their own MSI irq map functions. So irq_set_chip_data() in arch_setup_msi_irq() is

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:16AM +0800, Yijing Wang wrote: Introduce weak arch_find_msi_chip() to find the match msi_chip. Currently, MSI chip associates pci bus to msi_chip. Because in ARM platform, there may be more than one MSI controller in system. Associate pci bus to msi_chip help pci

Re: [PATCH v2 12/22] MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:22AM +0800, Yijing Wang wrote: [...] diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c [...] @@ -132,12 +132,12 @@ msi_irq_allocated: /* Make sure the search for available interrupts didn't fail */ if (irq = 64) { if

Re: [PATCH v2 14/22] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:24AM +0800, Yijing Wang wrote: Use MSI chip framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Nit: s/irq/IRQ/ in the above. Signed-off-by: Yijing Wang wangyij...@huawei.com ---

Re: [PATCH v2 15/22] MIPS/Xlr/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:25AM +0800, Yijing Wang wrote: [...] diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c [...] @@ -214,11 +214,11 @@ static int get_irq_vector(const struct pci_dev *dev) } #ifdef CONFIG_PCI_MSI -void arch_teardown_msi_irq(unsigned int irq) +void

Re: [PATCH v2 17/22] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:27AM +0800, Yijing Wang wrote: [...] diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c [...] @@ -358,7 +358,7 @@ static void zpci_irq_handler(struct airq_struct *airq) } } -int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) +int

Re: [PATCH v2 01/22] PCI/MSI: Clean up struct msi_chip argument

2014-09-25 Thread Thomas Gleixner
On Thu, 25 Sep 2014, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:11AM +0800, Yijing Wang wrote: Msi_chip functions setup_irq/teardown_irq rarely use msi_chip argument. That's not true. Out of the four drivers that you modify two use the parameter. And the two that don't probably

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Thomas Gleixner
On Thu, 25 Sep 2014, Yijing Wang wrote: Introduce weak arch_find_msi_chip() to find the match msi_chip. Currently, MSI chip associates pci bus to msi_chip. Because in ARM platform, there may be more than one MSI controller in system. Associate pci bus to msi_chip help pci device to find the

Re: [PATCH v2 01/18] arm: dma-mapping: arm_iommu_attach_device: automatically set max_seg_size

2014-09-25 Thread Marek Szyprowski
Hello, On 2014-09-24 19:06, Will Deacon wrote: Hi Marek, On Tue, Sep 16, 2014 at 12:54:28PM +0100, Marek Szyprowski wrote: If device has no max_seg_size set, we assume that there is no limit and force it to DMA_BIT_MASK(32) to always use contiguous mappings in DMA address space.

Re: [GIT PULL] iommu/arm-smmu: updates for 3.18

2014-09-25 Thread Joerg Roedel
On Mon, Sep 22, 2014 at 02:18:10PM +0100, Will Deacon wrote: Mitchel Humpherys (1): iommu/arm-smmu: fix bug in pmd construction Robin Murphy (2): iommu/arm-smmu: fix architecture version detection iommu/arm-smmu: support MMU-401 Will Deacon (5): iommu/arm-smmu:

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-09-25 Thread Rob Roschewsk
OK ... at first glance the system seems to be operating normally except for the errors every 4 seconds ... that is it's attached to and using the iscsi target ... Is this a problem in iommu OR the emulex driver?? On Thu, Sep 25, 2014 at 2:36 AM, Yijing Wang wangyij...@huawei.com wrote: On

Re: [PATCH 2/2] iommu/omap: Remove omap_iommu unused owner field

2014-09-25 Thread Joerg Roedel
On Tue, Sep 09, 2014 at 06:45:45PM +0300, Laurent Pinchart wrote: The owner field is never set. Remove it. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/iommu/omap-iommu.c | 11 --- drivers/iommu/omap-iommu.h | 1 - 2 files changed, 12 deletions(-)

Re: [PATCH] amd_iommu: do not dereference a NULL pointer address.

2014-09-25 Thread Joerg Roedel
On Thu, Sep 11, 2014 at 12:28:03PM +0200, Maurizio Lombardi wrote: under low memory conditions, alloc_pte() may return a NULL pointer. iommu_map_page() does not check it and will panic the system. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/iommu/amd_iommu.c | 3 +++

Re: [PATCH] iommu: Make of_device_id array const

2014-09-25 Thread Joerg Roedel
On Thu, Sep 11, 2014 at 07:07:36PM +0530, Kiran Padwal wrote: Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Kiran Padwal kiran.pad...@smartplayin.com --- drivers/iommu/arm-smmu.c |2 +- drivers/iommu/omap-iommu.c |2 +-

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-25 Thread Konrad Rzeszutek Wilk
On Thu, Sep 25, 2014 at 11:14:10AM +0800, Yijing Wang wrote: This series is based Bjorn's pci/msi branch git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/msi Is there a git tree for these patches? Currently, there are a lot of weak arch functions in MSI code. Thierry Reding

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-09-25 Thread Linda Knippers
On 9/25/2014 9:56 AM, Rob Roschewsk wrote: OK ... at first glance the system seems to be operating normally except for the errors every 4 seconds ... that is it's attached to and using the iscsi target ... Is this a problem in iommu OR the emulex driver?? Please make sure your BIOS and

Re: [PATCH v4 1/3] iommu: introduce domain attribute for nesting IOMMUs

2014-09-25 Thread Joerg Roedel
On Wed, Sep 24, 2014 at 10:21:23AM +0100, Will Deacon wrote: Some IOMMUs, such as the ARM SMMU, support two stages of translation. The idea behind such a scheme is to allow a guest operating system to use the IOMMU for DMA mappings in the first stage of translation, with the hypervisor then

Re: [PATCH v2 04/22] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()

2014-09-25 Thread Konrad Rzeszutek Wilk
On Thu, Sep 25, 2014 at 11:14:14AM +0800, Yijing Wang wrote: Commit 0e4ccb150 added two __weak arch functions arch_msix_mask_irq() and arch_msi_mask_irq() to fix a bug found when running xen in x86. Introduced these two funcntions make MSI code complex. And mask/unmask These two functions made

Re: [PATCH 0/2] iommu: Fix regression in IOMMU grouping

2014-09-25 Thread Joerg Roedel
On Fri, Sep 19, 2014 at 10:03:00AM -0600, Alex Williamson wrote: We've had surprisingly little fallout from the DMA alias changes, but unfortunately one regression has popped up. We have an AMD system that seems to use the SATA controller to master transactions for the legacy IDE controller

Re: [PATCH] iommu/core: fix bus notifier breakage

2014-09-25 Thread Joerg Roedel
On Sun, Sep 21, 2014 at 01:58:24PM -0400, Mark Salter wrote: iommu_bus_init() registers a bus notifier on the given bus by using a statically defined notifier block: static struct notifier_block iommu_bus_nb = { .notifier_call = iommu_bus_notifier, }; This same notifier

Re: [PATCH v4 1/3] iommu: introduce domain attribute for nesting IOMMUs

2014-09-25 Thread Will Deacon
On Thu, Sep 25, 2014 at 03:32:33PM +0100, Joerg Roedel wrote: On Wed, Sep 24, 2014 at 10:21:23AM +0100, Will Deacon wrote: Some IOMMUs, such as the ARM SMMU, support two stages of translation. The idea behind such a scheme is to allow a guest operating system to use the IOMMU for DMA

Re: [PATCH v4 2/3] vfio/iommu_type1: add new VFIO_TYPE1_NESTING_IOMMU IOMMU type

2014-09-25 Thread Will Deacon
Hi Alex, On Wed, Sep 24, 2014 at 07:23:19PM +0100, Alex Williamson wrote: On Wed, 2014-09-24 at 10:21 +0100, Will Deacon wrote: VFIO allows devices to be safely handed off to userspace by putting them behind an IOMMU configured to ensure DMA and interrupt isolation. This enables userspace

Re: [PATCH] iommu/core: fix bus notifier breakage

2014-09-25 Thread Mark Salter
On Thu, 2014-09-25 at 16:47 +0200, Joerg Roedel wrote: On Sun, Sep 21, 2014 at 01:58:24PM -0400, Mark Salter wrote: iommu_bus_init() registers a bus notifier on the given bus by using a statically defined notifier block: static struct notifier_block iommu_bus_nb = {

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 03:48:55PM +0100, Liviu Dudau wrote: On Thu, Sep 25, 2014 at 09:42:36AM +0200, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:10AM +0800, Yijing Wang wrote: This series is based Bjorn's pci/msi branch

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-09-25 Thread Joerg Roedel
On Mon, Aug 11, 2014 at 03:45:50PM -0700, Olav Haugan wrote: +static inline int iommu_map_sg(struct iommu_domain *domain, unsigned long iova, +struct scatterlist *sg, unsigned int nents, +int prot, unsigned long flags) +{ + return

Re: [PATCH v2] x86: irq_remapping: Fix the regression of hpet irq remapping

2014-09-25 Thread Joerg Roedel
On Wed, Sep 17, 2014 at 05:32:19PM +0800, Yijing Wang wrote: Commit 71054d8841b4 (x86, hpet: Introduce x86_msi_ops.setup_hpet_msi) introduced x86_msi_ops.setup_hpet_msi to setup hpet MSI irq when irq remapping enabled. This caused a regression of hpet MSI irq remapping. Original code flow

Re: [PATCH v2 1/1] iommu/amd: set iommu for early mapped ioapic/hpet

2014-09-25 Thread Joerg Roedel
Hi, On Tue, Sep 09, 2014 at 04:34:52PM +0800, Su, Friendy wrote: The problem you describe here should also be fixed by this (simpler) patch. Can you test this please? The running result of this patch is correct. Okay, fine, thanks for testing. I queued this patch up for the next merge

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-25 Thread Liviu Dudau
On Thu, Sep 25, 2014 at 09:42:36AM +0200, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:10AM +0800, Yijing Wang wrote: This series is based Bjorn's pci/msi branch git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/msi Currently, there are a lot of weak arch functions

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-25 Thread Liviu Dudau
On Thu, Sep 25, 2014 at 06:49:38PM +0200, Thierry Reding wrote: On Thu, Sep 25, 2014 at 03:48:55PM +0100, Liviu Dudau wrote: On Thu, Sep 25, 2014 at 09:42:36AM +0200, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:10AM +0800, Yijing Wang wrote: This series is based Bjorn's pci/msi

[PATCH v5 0/2] Support for nesting IOMMUs in VFIO

2014-09-25 Thread Will Deacon
Hello, This is version five of the patches I previously posted here: RFCv1: http://permalink.gmane.org/gmane.linux.kernel.iommu/5552 RFCv2: http://permalink.gmane.org/gmane.linux.kernel.iommu/5700 v3: http://permalink.gmane.org/gmane.linux.kernel.iommu/6230 v4:

Re: [PATCH v2 01/18] arm: dma-mapping: arm_iommu_attach_device: automatically set max_seg_size

2014-09-25 Thread Will Deacon
On Thu, Sep 25, 2014 at 11:43:35AM +0100, Marek Szyprowski wrote: On 2014-09-24 19:06, Will Deacon wrote: On Tue, Sep 16, 2014 at 12:54:28PM +0100, Marek Szyprowski wrote: If device has no max_seg_size set, we assume that there is no limit and force it to DMA_BIT_MASK(32) to always use

Re: [PATCH v2 02/22] PCI/MSI: Remove useless bus-msi assignment

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:06, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:12AM +0800, Yijing Wang wrote: Currently, PCI drivers will initialize bus-msi in pcibios_add_bus(). pcibios_add_bus() will be called in every pci bus initialization. So the bus-msi assignment in pci_alloc_child_bus() is

Re: [PATCH v2 01/22] PCI/MSI: Clean up struct msi_chip argument

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:15, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:11AM +0800, Yijing Wang wrote: Msi_chip functions setup_irq/teardown_irq rarely use msi_chip argument. That's not true. Out of the four drivers that you modify two use the parameter. And the two that don't probably

Re: [PATCH v2 03/22] MSI: Remove the redundant irq_set_chip_data()

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:19, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:13AM +0800, Yijing Wang wrote: Currently, pcie-designware, pcie-rcar, pci-tegra drivers use irq chip_data to save the msi_chip pointer. They already call irq_set_chip_data() in their own MSI irq map functions. So

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:26, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:16AM +0800, Yijing Wang wrote: Introduce weak arch_find_msi_chip() to find the match msi_chip. Currently, MSI chip associates pci bus to msi_chip. Because in ARM platform, there may be more than one MSI controller in

Re: [PATCH v2 17/22] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:38, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:27AM +0800, Yijing Wang wrote: [...] diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c [...] @@ -358,7 +358,7 @@ static void zpci_irq_handler(struct airq_struct *airq) } } -int arch_setup_msi_irqs(struct

Re: [PATCH v2 14/22] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:36, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:24AM +0800, Yijing Wang wrote: Use MSI chip framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Nit: s/irq/IRQ/ in the above. Signed-off-by:

Re: [PATCH v2 01/22] PCI/MSI: Clean up struct msi_chip argument

2014-09-25 Thread Yijing Wang
On 2014/9/25 18:20, Thomas Gleixner wrote: On Thu, 25 Sep 2014, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:11AM +0800, Yijing Wang wrote: Msi_chip functions setup_irq/teardown_irq rarely use msi_chip argument. That's not true. Out of the four drivers that you modify two use the

Re: [PATCH v2 15/22] MIPS/Xlr/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:37, Thierry Reding wrote: On Thu, Sep 25, 2014 at 11:14:25AM +0800, Yijing Wang wrote: [...] diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c [...] @@ -214,11 +214,11 @@ static int get_irq_vector(const struct pci_dev *dev) } #ifdef CONFIG_PCI_MSI -void

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 18:38, Thomas Gleixner wrote: On Thu, 25 Sep 2014, Yijing Wang wrote: Introduce weak arch_find_msi_chip() to find the match msi_chip. Currently, MSI chip associates pci bus to msi_chip. Because in ARM platform, there may be more than one MSI controller in system. Associate pci

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 18:38, Thomas Gleixner wrote: On Thu, 25 Sep 2014, Yijing Wang wrote: Introduce weak arch_find_msi_chip() to find the match msi_chip. Currently, MSI chip associates pci bus to msi_chip. Because in ARM platform, there may be more than one MSI controller in system. Associate pci

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-25 Thread Yijing Wang
On 2014/9/25 22:23, Konrad Rzeszutek Wilk wrote: On Thu, Sep 25, 2014 at 11:14:10AM +0800, Yijing Wang wrote: This series is based Bjorn's pci/msi branch git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/msi Is there a git tree for these patches? Hi Konrad, my git tree in