[PATCH] x86: irq_remapping: Make functions static

2014-09-12 Thread Yijing Wang
Change local functions to static. Signed-off-by: Yijing Wang wangyij...@huawei.com --- arch/x86/include/asm/irq_remapping.h | 27 +-- drivers/iommu/irq_remapping.c| 34 +- 2 files changed, 18 insertions(+), 43 deletions(-) diff

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

2014-09-12 Thread Yijing Wang
Commit 71054d8841b4 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 before commit 71054d8841b4: hpet_setup_msi_irq() arch_setup_hpet_msi()

Re: [PATCH] x86: irq_remapping: Make functions static

2014-09-12 Thread Jiang Liu
Hi Yijing, There's an effort to refine the remapping interface by using hierarchy irqdomain, which plans to kill all these interfaces. Please refer to https://lkml.org/lkml/2014/9/11/101 https://lkml.org/lkml/2014/9/11/554 Regards! Gerry On 2014/9/12 17:05, Yijing Wang wrote: Change

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

2014-09-12 Thread Jiang Liu
On 2014/9/12 17:05, Yijing Wang wrote: Commit 71054d8841b4 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 before commit 71054d8841b4: hpet_setup_msi_irq()

Re: [PATCH] x86: irq_remapping: Make functions static

2014-09-12 Thread Yijing Wang
On 2014/9/12 16:49, Jiang Liu wrote: Hi Yijing, There's an effort to refine the remapping interface by using hierarchy irqdomain, which plans to kill all these interfaces. Please refer to https://lkml.org/lkml/2014/9/11/101 https://lkml.org/lkml/2014/9/11/554 That's nice, I'm

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

2014-09-12 Thread Yijing Wang
On 2014/9/12 17:02, Jiang Liu wrote: On 2014/9/12 17:05, Yijing Wang wrote: Commit 71054d8841b4 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 before commit 71054d8841b4:

Re: [Patch Part3 V5 2/8] iommu/vt-d: Dynamically allocate and free seq_id for DMAR units

2014-09-12 Thread Yijing Wang
On 2014/9/12 10:10, Jiang Liu wrote: Introduce functions to support dynamic IOMMU seq_id allocating and releasing, which will be used to support DMAR hotplug. Also rename IOMMU_UNITS_SUPPORTED as DMAR_UNITS_SUPPORTED. Reviewed-by: Yijing Wang wangyij...@huawei.com Signed-off-by: Jiang

Re: [Patch Part3 V5 1/8] iommu/vt-d: Introduce helper function dmar_walk_resources()

2014-09-12 Thread Yijing Wang
On 2014/9/12 10:10, Jiang Liu wrote: Introduce helper function dmar_walk_resources to walk resource entries in DMAR table and ACPI buffer object returned by ACPI _DSM method for IOMMU hot-plug. Signed-off-by: Jiang Liu jiang@linux.intel.com Hi Gerry. some comments below. ---

Re: [PATCH] iommu: Make of_device_id array const

2014-09-12 Thread kiran . padwal
On Thursday, September 11, 2014 9:51am, Will Deacon will.dea...@arm.com said: On Thu, Sep 11, 2014 at 02:37:36PM +0100, 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 ---

[git pull] IOMMU Fixes for Linux v3.17-rc4

2014-09-12 Thread Joerg Roedel
Hi Linus, The following changes since commit 69e273c0b0a3c337a521d083374c918dc52c666f: Linux 3.17-rc3 (2014-08-31 18:23:04 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v3.17-rc4 for you to fetch changes up to

Re: ath9k and AMD IOMMU alias breakage on 3.16?

2014-09-12 Thread Joerg Roedel
Hi Jason, On Fri, Sep 05, 2014 at 10:28:01PM -0700, Jason Newton wrote: [0.021820] AMD-Vi: device: 00:00.2 cap: 0040 seg: 0 flags: b8 info [0.021827] AMD-Vi:mmio-addr: feb8 [0.021844] AMD-Vi: DEV_SELECT_RANGE_STARTdevid: 00:01.0 flags: 00 [

[RFC PATCH v3 6/7] arm: call iommu_init before of_platform_populate

2014-09-12 Thread Will Deacon
We need to ensure that the IOMMUs in the system have a chance to perform some basic initialisation before we start adding masters to them. This patch adds a call to of_iommu_init before of_platform_populate. Signed-off-by: Will Deacon will.dea...@arm.com --- arch/arm/kernel/setup.c | 2 ++ 1

[RFC PATCH v3 1/7] iommu: provide early initialisation hook for IOMMU drivers

2014-09-12 Thread Will Deacon
IOMMU drivers must be initialised before any of their upstream devices, otherwise the relevant iommu_ops won't be configured for the bus in question. To solve this, a number of IOMMU drivers use initcalls to initialise the driver before anything has a chance to be probed. Whilst this solves the

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

2014-09-12 Thread Will Deacon
This patch extends of_dma_configure so that it sets up the IOMMU for a device, as well as the coherent/non-coherent DMA mapping ops. Signed-off-by: Will Deacon will.dea...@arm.com --- arch/arm/include/asm/dma-mapping.h | 4 +++- drivers/of/platform.c | 24 +---

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

2014-09-12 Thread Will Deacon
This patch plumbs the existing ARM IOMMU DMA infrastructure (which isn't actually called outside of a few drivers) into arch_setup_dma_ops, so that we can use IOMMUs for DMA transfers in a more generic fashion. Since this significantly complicates the arch_setup_dma_ops function, it is moved out

[RFC PATCH v3 0/7] Introduce automatic DMA configuration for IOMMU masters

2014-09-12 Thread Will Deacon
Hi all, Here is version three of the RFC I've previously posted here: RFCv1: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-August/283023.html RFCv2: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-September/283752.html Changes since RFCv2 include: - Put the

[RFC PATCH v3 3/7] iommu: add new iommu_ops callback for adding an OF device

2014-09-12 Thread Will Deacon
This patch adds a new function to the iommu_ops structure to allow an OF device to be added to a specific IOMMU instance using the recently merged generic devicetree binding for IOMMUs. The callback (of_xlate) takes a struct device representing the master and an of_phandle_args representing the

[RFC PATCH v3 2/7] dma-mapping: replace set_arch_dma_coherent_ops with arch_setup_dma_ops

2014-09-12 Thread Will Deacon
set_arch_dma_coherent_ops is called from of_dma_configure in order to swizzle the architectural dma-mapping functions over to a cache-coherent implementation. This is currently implemented only for ARM. In anticipation of re-using this mechanism for IOMMU-backed dma-mapping ops too, this patch

[RFC PATCH v3 4/7] iommu: provide helper function to configure an IOMMU for an of master

2014-09-12 Thread Will Deacon
The generic IOMMU device-tree bindings can be used to add arbitrary OF masters to an IOMMU with a compliant binding. This patch introduces of_iommu_configure, which does exactly that. A list of iommu_dma_mapping structures are created for each device, which represent the set of IOMMU instances

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

2014-09-12 Thread Alex Williamson
On Fri, 2014-09-12 at 17:55 +0100, Will Deacon wrote: Hi Alex, Thanks for taking a look. On Thu, Sep 11, 2014 at 08:12:28PM +0100, Alex Williamson wrote: On Tue, 2014-09-02 at 10:53 +0100, Will Deacon wrote: diff --git a/drivers/vfio/vfio_iommu_type1.c

Re: [PATCH 0/3 v3] mmu_notifier: Allow to manage CPU external TLBs

2014-09-12 Thread Jerome Glisse
On Wed, Sep 10, 2014 at 08:02:12PM -0400, Jerome Glisse wrote: On Wed, Sep 10, 2014 at 03:01:25PM -0700, Andrew Morton wrote: On Tue, 9 Sep 2014 17:43:51 +0200 Joerg Roedel j...@8bytes.org wrote: here is a patch-set to extend the mmu_notifiers in the Linux kernel to allow managing CPU