[Patch v2] iommu/vt-d: Adjsut the return value of the parse_ioapics_under_ir

2015-10-21 Thread Baoquan He
Adjust the return value of parse_ioapics_under_ir as negative value representing failure and "0" representing succcess. Just make it consistent with other function implementation, and we can judge if calling is successfull by if (!parse_ioapics_under_ir()) style. Signed-off-by: Baoquan He --- v1-

Re: [PATCH v5 0/6] MT8173 IOMMU SUPPORT

2015-10-21 Thread Yong Wu
On Wed, 2015-10-14 at 14:56 +0200, Joerg Roedel wrote: > On Fri, Oct 09, 2015 at 10:23:02AM +0800, Yong Wu wrote: > > Yong Wu (6): > > dt-bindings: iommu: Add binding for mediatek IOMMU > > dt-bindings: mediatek: Add smi dts binding > > iommu: add ARM short descriptor page table allocator > >

[PATCH 7/8] iommu: Remove is_pci_dev() fall-back from iommu_group_get_for_dev

2015-10-21 Thread Joerg Roedel
From: Joerg Roedel All callers of iommu_group_get_for_dev() provide a device_group call-back now, so this fall-back is no longer needed. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c inde

[PATCH 3/8] iommu: Add generic_device_group() function

2015-10-21 Thread Joerg Roedel
From: Joerg Roedel This function can be used as a device_group call-back and just allocates one iommu-group per device. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 15 +++ include/linux/iommu.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/iommu/iommu

[PATCH 4/8] iommu: Add device_group call-back to x86 iommu drivers

2015-10-21 Thread Joerg Roedel
From: Joerg Roedel Set the device_group call-back to pci_device_group() for the Intel VT-d and the AMD IOMMU driver. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 1 + drivers/iommu/intel-iommu.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/

[PATCH 8/8] iommu: Move default domain allocation to iommu_group_get_for_dev()

2015-10-21 Thread Joerg Roedel
From: Joerg Roedel Now that the iommu core support for iommu groups is not pci-centric anymore, we can move default domain allocation to the bus independent iommu_group_get_for_dev() function. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 18 ++ 1 file changed, 10 ins

[PATCH 1/8] iommu: Revive device_group iommu-ops call-back

2015-10-21 Thread Joerg Roedel
From: Joerg Roedel That call-back is currently unused, change it into a call-back function for finding the right IOMMU group for a device. This is a first step to remove the hard-coded PCI dependency in the iommu-group code. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 9 ++---

[PATCH 6/8] iommu/arm-smmu: Switch to device_group call-back

2015-10-21 Thread Joerg Roedel
From: Joerg Roedel This converts the ARM SMMU and the SMMUv3 driver to use the new device_group call-back. Cc: Will Deacon Signed-off-by: Joerg Roedel --- drivers/iommu/arm-smmu-v3.c | 1 + drivers/iommu/arm-smmu.c| 77 +++-- 2 files changed, 47 in

[PATCH 5/8] iommu/fsl: Convert to device_group call-back

2015-10-21 Thread Joerg Roedel
From: Joerg Roedel Convert the fsl pamu driver to make use of the new device_group call-back. Cc: Varun Sethi Signed-off-by: Joerg Roedel --- drivers/iommu/fsl_pamu_domain.c | 41 - 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/drivers

[PATCH 2/8] iommu: Export and rename iommu_group_get_for_pci_dev()

2015-10-21 Thread Joerg Roedel
From: Joerg Roedel Rename that function to pci_device_group() and export it, so that IOMMU drivers can use it as their device_group call-back. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 8 ++-- include/linux/iommu.h | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) di

[PATCH 0/8] iommu: Make core iommu-groups code more generic

2015-10-21 Thread Joerg Roedel
Hi, this patch-set makes the core code for managing iommu-groups more generic by lifting its dependencies on PCI. The core function iommu_group_get_for_dev() had a hard dev_is_pci() check in it, followed by PCI specific handling. This check is removed in favour of the the revived device_group() i

Re: [PATCH] iommu-common: fix return type of iommu_tbl_range_alloc()

2015-10-21 Thread Geert Uytterhoeven
Hi Andre, Jörg, On Fri, Sep 18, 2015 at 11:09 AM, Andre Przywara wrote: > Though iommu_tbl_range_alloc() is only used by Sparc code, the > function itself lives in lib/iommu-common.c and is thus included in > other architecture's code as well. > When compiled on a 32-bit architecture using 64-bit

Re: [PATCH 09/22] PCI: Add pci_peer_traffic_supported()

2015-10-21 Thread Benjamin Herrenschmidt
On Tue, 2015-09-15 at 12:10 -0500, Will Davis wrote: > +bool pci_peer_traffic_supported(struct pci_dev *dev, struct pci_dev > *peer) > +{ > +>> struct pci_host_bridge *dev_host_bridge; > +>> struct pci_host_bridge *peer_host_bridge; > + > +>> /* > +>> * Disallow the peer-to-peer t

Re: [PATCH v4 3/6] iommu: add ARM short descriptor page table allocator.

2015-10-21 Thread Yong Wu
On Fri, 2015-10-09 at 19:19 +0100, Will Deacon wrote: > On Fri, Oct 09, 2015 at 06:41:51PM +0100, Robin Murphy wrote: > > On 09/10/15 16:57, Will Deacon wrote: > > >On Tue, Sep 22, 2015 at 03:12:47PM +0100, Yong Wu wrote: > > >> I would like to show you a problem I met, The recursion here may

[GIT PULL] Minor intel-iommu fix for 4.3

2015-10-21 Thread David Woodhouse
Linus, please pull from git://git.infradead.org/intel-iommu.git for-linus-20151021 This contains a single fix, for when the IOMMU API is used to overlay an existing mapping comprised of 4KiB pages, with a mapping that can use superpages. For the *first* superpage in the new mapping, we