Re: [RFC v2 2/4] iommu/arm-smmu-v3: Add tlbi_on_map option

2017-08-17 Thread Auger Eric
Hi Michael, On 18/08/2017 04:54, Michael S. Tsirkin wrote: > On Thu, Aug 17, 2017 at 07:47:04PM +0200, Auger Eric wrote: >> I will see with Peter and other potential users in the community whether >> it is worth to pursue the efforts on upstreaming the QEMU vSMMUv3 >> device, considering the VFIO/V

Re: [PATCH 0/5] arm-smmu: performance optimization

2017-08-17 Thread Leizhen (ThunderTown)
On 2017/8/17 22:36, Will Deacon wrote: > Thunder, Nate, Robin, > > On Mon, Jun 26, 2017 at 09:38:45PM +0800, Zhen Lei wrote: >> I described the optimization more detail in patch 1 and 2, and patch 3-5 are >> the implementation on arm-smmu/arm-smmu-v3 of patch 2. >> >> Patch 1 is v2. In v1, I dir

Re: [RFC v2 2/4] iommu/arm-smmu-v3: Add tlbi_on_map option

2017-08-17 Thread Michael S. Tsirkin
On Thu, Aug 17, 2017 at 07:47:04PM +0200, Auger Eric wrote: > I will see with Peter and other potential users in the community whether > it is worth to pursue the efforts on upstreaming the QEMU vSMMUv3 > device, considering the VFIO/VHOST integration is made impossible. I posted more ideas on fin

Re: [RFC v2 2/4] iommu/arm-smmu-v3: Add tlbi_on_map option

2017-08-17 Thread Michael S. Tsirkin
On Thu, Aug 17, 2017 at 05:34:25PM +0100, Will Deacon wrote: > On Fri, Aug 11, 2017 at 03:45:28PM +0200, Eric Auger wrote: > > When running a virtual SMMU on a guest we sometimes need to trap > > all changes to the translation structures. This is especially useful > > to integrate with VFIO. This p

Re: [PATCH] iommu: Avoid NULL group dereference

2017-08-17 Thread Shawn Lin
Hi On 2017/8/17 18:40, Robin Murphy wrote: The recently-removed FIXME in iommu_get_domain_for_dev() turns out to have been a little misleading, since that check is still worthwhile even when groups *are* universal. We have a few IOMMU-aware drivers which only care whether their device is already

Re: [PATCH 02/13] iommu: Introduce Interface for IOMMU TLB Flushing

2017-08-17 Thread Joerg Roedel
Hi Will, On Thu, Aug 17, 2017 at 06:17:05PM +0100, Will Deacon wrote: > On Thu, Aug 17, 2017 at 06:50:40PM +0200, Joerg Roedel wrote: > > Problem currently is how to get this information from > > 'struct iommu_device' to 'struct iommu_domain'. As a workaround I > > consider a per-domain flag in th

Re: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table

2017-08-17 Thread Alex Williamson
On Thu, 17 Aug 2017 10:56:35 + David Laight wrote: > From: Alex Williamson > > Sent: 16 August 2017 17:56 > ... > > Firmware pissing match... Processors running with 8k or less page size > > fall within the recommendations of the PCI spec for register alignment > > of MMIO regions of the d

[PATCH v2 4/4] iommu: Prevent VMD child devices from being remapping targets

2017-08-17 Thread Jon Derrick
VMD child devices must use the VMD endpoint's ID as the requester. Because of this, there needs to be a way to link the parent VMD endpoint's iommu group and associated mappings to the VMD child devices such that attaching and detaching child devices modify the endpoint's mappings, while preventing

[PATCH v2 0/4] VMD fixups

2017-08-17 Thread Jon Derrick
Mostly just cleanup in this revision, eg, trying to limit scope of vmd code to x86 Previous: https://patchwork.kernel.org/patch/9886095/ https://patchwork.kernel.org/patch/9886097/ https://patchwork.kernel.org/patch/9886101/ Jon Derrick (4): MAINTAINERS: Add Jonathan Derrick as VMD maintainer

[PATCH v2 3/4] x86/PCI: Use is_vmd rather than relying on the domain number

2017-08-17 Thread Jon Derrick
Signed-off-by: Jon Derrick --- arch/x86/pci/fixup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index ca4b02e5..1ed2fbf 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -628,7 +628,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI

[PATCH v2 2/4] pci/x86: Move VMD quirks to x86 fixups

2017-08-17 Thread Jon Derrick
VMD currently only exists for Intel x86 products Signed-off-by: Jon Derrick --- arch/x86/pci/fixup.c | 18 ++ drivers/pci/quirks.c | 17 - 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 11e4074..c

[PATCH v2 1/4] MAINTAINERS: Add Jonathan Derrick as VMD maintainer

2017-08-17 Thread Jon Derrick
Add myself as VMD maintainer Signed-off-by: Jon Derrick Acked-by: Keith Busch --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index f66488d..3ec39df 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10090,6 +10090,7 @@ F: drivers/pci/dwc/*imx6*

Re: [RFC v2 2/4] iommu/arm-smmu-v3: Add tlbi_on_map option

2017-08-17 Thread Auger Eric
Hi Will, On 17/08/2017 18:34, Will Deacon wrote: > On Fri, Aug 11, 2017 at 03:45:28PM +0200, Eric Auger wrote: >> When running a virtual SMMU on a guest we sometimes need to trap >> all changes to the translation structures. This is especially useful >> to integrate with VFIO. This patch adds a ne

Re: [PATCH 2/2] iommu/tegra-gart: Add support for struct iommu_device

2017-08-17 Thread Dmitry Osipenko
On 17.08.2017 16:52, Thierry Reding wrote: > On Thu, Aug 17, 2017 at 01:21:52AM +0300, Dmitry Osipenko wrote: >> Hello Joerg, >> >> On 10.08.2017 01:29, Joerg Roedel wrote: >>> From: Joerg Roedel >>> >>> Add a struct iommu_device to each tegra-gart and register it >>> with the iommu-core. Also lin

Re: [PATCH 02/13] iommu: Introduce Interface for IOMMU TLB Flushing

2017-08-17 Thread Will Deacon
Hi Joerg, On Thu, Aug 17, 2017 at 06:50:40PM +0200, Joerg Roedel wrote: > On Thu, Aug 17, 2017 at 05:32:35PM +0100, Will Deacon wrote: > > I really like the idea of this, but I have a couple of questions and > > comments below. > > Great, this together with the common iova-flush it should make it

Re: [PATCH] iommu: Avoid NULL group dereference

2017-08-17 Thread Robin Murphy
On 17/08/17 16:41, Joerg Roedel wrote: > On Thu, Aug 17, 2017 at 11:40:08AM +0100, Robin Murphy wrote: >> The recently-removed FIXME in iommu_get_domain_for_dev() turns out to >> have been a little misleading, since that check is still worthwhile even >> when groups *are* universal. We have a few I

Re: [PATCH 02/13] iommu: Introduce Interface for IOMMU TLB Flushing

2017-08-17 Thread Joerg Roedel
Hi Will, On Thu, Aug 17, 2017 at 05:32:35PM +0100, Will Deacon wrote: > I really like the idea of this, but I have a couple of questions and > comments below. Great, this together with the common iova-flush it should make it possible to solve the performance problems of the dma-iommu code. > > +

Re: [RFC v2 2/4] iommu/arm-smmu-v3: Add tlbi_on_map option

2017-08-17 Thread Will Deacon
On Fri, Aug 11, 2017 at 03:45:28PM +0200, Eric Auger wrote: > When running a virtual SMMU on a guest we sometimes need to trap > all changes to the translation structures. This is especially useful > to integrate with VFIO. This patch adds a new option that forces > the IO_PGTABLE_QUIRK_TLBI_ON_MAP

Re: [PATCH 02/13] iommu: Introduce Interface for IOMMU TLB Flushing

2017-08-17 Thread Will Deacon
Hi Joerg, I really like the idea of this, but I have a couple of questions and comments below. On Thu, Aug 17, 2017 at 02:56:25PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > With the current IOMMU-API the hardware TLBs have to be > flushed in every iommu_map(), iommu_map_sg(), and > iom

Re: [PATCH] iommu: Avoid NULL group dereference

2017-08-17 Thread Joerg Roedel
On Thu, Aug 17, 2017 at 11:40:08AM +0100, Robin Murphy wrote: > The recently-removed FIXME in iommu_get_domain_for_dev() turns out to > have been a little misleading, since that check is still worthwhile even > when groups *are* universal. We have a few IOMMU-aware drivers which > only care whether

Re: [PATCH 1/8] dt-bindings: mediatek: Add binding for mt2712 IOMMU and SMI

2017-08-17 Thread Rob Herring
On Fri, Aug 11, 2017 at 05:56:10PM +0800, Yong Wu wrote: > This patch adds decriptions for mt2712 IOMMU and SMI. > > In order to balance the bandwidth, mt2712 has two M4Us, two > smi-commons, 8 smi-larbs. and mt2712 is also MTK IOMMU gen2 which > use Short-Descriptor translation table format. s/u

Re: [PATCH 00/13] Introduce IOMMU-API TLB Flushing Interface

2017-08-17 Thread Joerg Roedel
On Thu, Aug 17, 2017 at 08:54:07AM -0600, Alex Williamson wrote: > So _sync() does imply that they're slower, but iommu_map() does not > imply that a _flush() is required. One is a performance issue, the > other is an API usability issue. If the sync version is used > sub-optimally, it's a perfor

Re: [PATCH 00/13] Introduce IOMMU-API TLB Flushing Interface

2017-08-17 Thread Alex Williamson
On Thu, 17 Aug 2017 16:43:08 +0200 Joerg Roedel wrote: > Hi Alex, > > On Thu, Aug 17, 2017 at 08:35:20AM -0600, Alex Williamson wrote: > > Wouldn't it be much more friendly to downstreams and out-of-tree > > drivers to introduce new functions for the async semantics? ie. > > iommu_map_async(),

Re: [PATCH 00/13] Introduce IOMMU-API TLB Flushing Interface

2017-08-17 Thread Joerg Roedel
Hi Alex, On Thu, Aug 17, 2017 at 08:35:20AM -0600, Alex Williamson wrote: > Wouldn't it be much more friendly to downstreams and out-of-tree > drivers to introduce new functions for the async semantics? ie. > iommu_map_async(), etc. The API also seems a little cleaner that > iommu_map() stands a

Re: [PATCH 0/5] arm-smmu: performance optimization

2017-08-17 Thread Will Deacon
Thunder, Nate, Robin, On Mon, Jun 26, 2017 at 09:38:45PM +0800, Zhen Lei wrote: > I described the optimization more detail in patch 1 and 2, and patch 3-5 are > the implementation on arm-smmu/arm-smmu-v3 of patch 2. > > Patch 1 is v2. In v1, I directly replaced writel with writel_relaxed in > que

Re: [PATCH 00/13] Introduce IOMMU-API TLB Flushing Interface

2017-08-17 Thread Alex Williamson
On Thu, 17 Aug 2017 14:56:23 +0200 Joerg Roedel wrote: > Hi, > > here is a patch-set to introduce an explicit interface to > the IOMMU-API to flush IOMMU and device IO/TLBs. Currently > the iommu_map(), iommu_map_sg(), and iommu_unmap() functions > have to make sure all IO/TLBs in the system are

Re: [PATCH 06/13] drm/etnaviv: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
On Thu, Aug 17, 2017 at 04:30:48PM +0200, Lucas Stach wrote: > Yeah, the IOMMU API being used internally is a historical accident, that > we didn't get around to rectify yet. It's on my things-we-need-to-do > list to prune the usage of the IOMMU API in etnaviv. Okay, so for the time being, I drop

Re: [PATCH 06/13] drm/etnaviv: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Lucas Stach
Am Donnerstag, den 17.08.2017, 16:18 +0200 schrieb Joerg Roedel: > On Thu, Aug 17, 2017 at 04:03:54PM +0200, Lucas Stach wrote: > > There is no IOMMU driver in use. Etnaviv just uses part of the IOMMU API > > to manage the GPU internal MMU, see > > drivers/gpu/drm/etnaviv/etnaviv_iommu.c > > That

Re: [PATCH 06/13] drm/etnaviv: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
On Thu, Aug 17, 2017 at 04:03:54PM +0200, Lucas Stach wrote: > There is no IOMMU driver in use. Etnaviv just uses part of the IOMMU API > to manage the GPU internal MMU, see > drivers/gpu/drm/etnaviv/etnaviv_iommu.c That looks like a very fragile construct, because it relies on internal behavior o

Re: [PATCH 06/13] drm/etnaviv: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Lucas Stach
Am Donnerstag, den 17.08.2017, 15:45 +0200 schrieb Joerg Roedel: > Hi Lucas, > > On Thu, Aug 17, 2017 at 03:32:38PM +0200, Lucas Stach wrote: > > I don't think this is necessary. Etnaviv has managed and batched up TLB > > flushes from day 1, as they don't happen through the MMU MMIO interface, > >

Re: [PATCH 0/2] iommu/tegra*: Add support for struct iommu_device

2017-08-17 Thread Thierry Reding
On Thu, Aug 10, 2017 at 12:29:10AM +0200, Joerg Roedel wrote: > Hi, > > here are two patches to add support for 'struct iommu_device' > to the tegra iommu-drivers. This will make the iommu-core > code aware of the hardware iommus that a driver manages. > > It will also add the iommus to sysfs and

Re: [PATCH 2/2] iommu/tegra-gart: Add support for struct iommu_device

2017-08-17 Thread Thierry Reding
On Thu, Aug 17, 2017 at 01:21:52AM +0300, Dmitry Osipenko wrote: > Hello Joerg, > > On 10.08.2017 01:29, Joerg Roedel wrote: > > From: Joerg Roedel > > > > Add a struct iommu_device to each tegra-gart and register it > > with the iommu-core. Also link devices added to the driver > > to their res

Re: [PATCH 06/13] drm/etnaviv: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
Hi Lucas, On Thu, Aug 17, 2017 at 03:32:38PM +0200, Lucas Stach wrote: > I don't think this is necessary. Etnaviv has managed and batched up TLB > flushes from day 1, as they don't happen through the MMU MMIO interface, > but through the GPU command stream. > > So if my understanding of this seri

Re: [PATCH 06/13] drm/etnaviv: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Lucas Stach
Hi Joerg, Am Donnerstag, den 17.08.2017, 14:56 +0200 schrieb Joerg Roedel: > From: Joerg Roedel > > The map and unmap functions of the IOMMU-API changed their > semantics: They do no longer guarantee that the hardware > TLBs are synchronized with the page-table updates they made. > > To make co

Re: [PATCH 11/13] gpu: host1x: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Thierry Reding
On Thu, Aug 17, 2017 at 02:56:34PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > The map and unmap functions of the IOMMU-API changed their > semantics: They do no longer guarantee that the hardware > TLBs are synchronized with the page-table updates they made. > > To make conversion easie

Re: [PATCH 10/13] drm/tegra: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Thierry Reding
On Thu, Aug 17, 2017 at 02:56:33PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > The map and unmap functions of the IOMMU-API changed their > semantics: They do no longer guarantee that the hardware > TLBs are synchronized with the page-table updates they made. > > To make conversion easie

[PATCH 12/13] IB/usnic: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 05/13] arm: dma-mapping: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 13/13] remoteproc: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 11/13] gpu: host1x: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 10/13] drm/tegra: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 06/13] drm/etnaviv: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 08/13] drm/nouveau/imem/gk20a: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 07/13] drm/msm: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 09/13] drm/rockchip: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 02/13] iommu: Introduce Interface for IOMMU TLB Flushing

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel With the current IOMMU-API the hardware TLBs have to be flushed in every iommu_map(), iommu_map_sg(), and iommu_unmap() call. For unmapping large amounts of address space, like it happens when a KVM domain with assigned devices is destroyed, this causes thousands of unnecessar

[PATCH 03/13] vfio/type1: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 04/13] iommu/dma: Use sychronized interface of the IOMMU-API

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarante

[PATCH 00/13] Introduce IOMMU-API TLB Flushing Interface

2017-08-17 Thread Joerg Roedel
Hi, here is a patch-set to introduce an explicit interface to the IOMMU-API to flush IOMMU and device IO/TLBs. Currently the iommu_map(), iommu_map_sg(), and iommu_unmap() functions have to make sure all IO/TLBs in the system are synchronized with the page-table updates they made. This is very in

[PATCH 01/13] iommu/amd: Rename a few flush functions

2017-08-17 Thread Joerg Roedel
From: Joerg Roedel Rename a few iommu cache-flush functions that start with iommu_ to start with amd_iommu now. This is to prevent name collisions with generic iommu code later on. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 16 1 file changed, 8 insertions(+),

RE: [virtio-dev] [RFC] virtio-iommu version 0.4

2017-08-17 Thread Bharat Bhushan
Hi, > -Original Message- > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Thursday, August 17, 2017 3:42 PM > To: Adam Tao > Cc: iommu@lists.linux-foundation.org; k...@vger.kernel.org; > virtualizat...@lists.linux-foundation.org; virtio-...@lists.oasis-open.org

RE: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table

2017-08-17 Thread David Laight
From: Alex Williamson > Sent: 16 August 2017 17:56 ... > Firmware pissing match... Processors running with 8k or less page size > fall within the recommendations of the PCI spec for register alignment > of MMIO regions of the device and this whole problem becomes less of an > issue. Actually if q

Re: [PATCH] iommu: Avoid NULL group dereference

2017-08-17 Thread Marc Zyngier
On 17/08/17 11:40, Robin Murphy wrote: > The recently-removed FIXME in iommu_get_domain_for_dev() turns out to > have been a little misleading, since that check is still worthwhile even > when groups *are* universal. We have a few IOMMU-aware drivers which > only care whether their device is alread

[PATCH] iommu: Avoid NULL group dereference

2017-08-17 Thread Robin Murphy
The recently-removed FIXME in iommu_get_domain_for_dev() turns out to have been a little misleading, since that check is still worthwhile even when groups *are* universal. We have a few IOMMU-aware drivers which only care whether their device is already attached to an existing domain or not, for wh

Re: [virtio-dev] [RFC] virtio-iommu version 0.4

2017-08-17 Thread Jean-Philippe Brucker
Hi Adam, On 16/08/17 05:08, Adam Tao wrote: >> * There is a working Qemu prototype [3], thanks to Eric Auger and Bharat >> Bhushan. > Hi, Brucker > I read the related spec for virtio IOMMU, > I am wondering if we support both the virtual and physical devices in > the guest to use the virtio IOMM

Re: [PATCH] irqchip/gic-{v2m, v3-its}: check iommu capable before doing iommu map

2017-08-17 Thread Robin Murphy
On 17/08/17 10:22, Marc Zyngier wrote: > On 17/08/17 10:01, Shawn Lin wrote: >> Hi Marc >> >> On 2017/8/17 16:52, Marc Zyngier wrote: >>> On 17/08/17 09:28, Shawn Lin wrote: If a PCIe RC use gic-v2m or gic-v3-its as a msi domain but doesn't have iommu support, we don't need to do iommu_dm

Re: [PATCH] irqchip/gic-{v2m, v3-its}: check iommu capable before doing iommu map

2017-08-17 Thread Marc Zyngier
On 17/08/17 10:01, Shawn Lin wrote: > Hi Marc > > On 2017/8/17 16:52, Marc Zyngier wrote: >> On 17/08/17 09:28, Shawn Lin wrote: >>> If a PCIe RC use gic-v2m or gic-v3-its as a msi domain but doesn't >>> have iommu support, we don't need to do iommu_dma_map_msi_msg to >>> get mapped iommu address

Re: [PATCH] irqchip/gic-{v2m, v3-its}: check iommu capable before doing iommu map

2017-08-17 Thread Shawn Lin
Hi Marc On 2017/8/17 16:52, Marc Zyngier wrote: On 17/08/17 09:28, Shawn Lin wrote: If a PCIe RC use gic-v2m or gic-v3-its as a msi domain but doesn't have iommu support, we don't need to do iommu_dma_map_msi_msg to get mapped iommu address as all we need is the physical address. Otherwise we s

Re: [PATCH] irqchip/gic-{v2m, v3-its}: check iommu capable before doing iommu map

2017-08-17 Thread Marc Zyngier
On 17/08/17 09:28, Shawn Lin wrote: > If a PCIe RC use gic-v2m or gic-v3-its as a msi domain but doesn't > have iommu support, we don't need to do iommu_dma_map_msi_msg to > get mapped iommu address as all we need is the physical address. > Otherwise we see the oops shown below as we can't get a io

Re: PCIe oops for NULL pointer dereference during next-20170807 and next-20170815

2017-08-17 Thread Shawn Lin
On 2017/8/17 15:58, Joerg Roedel wrote: On Thu, Aug 17, 2017 at 03:02:31PM +0800, Shawn Lin wrote: So should we revert this commit or maybe we could add some checking into gic-v2m and gic-v3-its to see if the dev is iommu-capable? If not, we should create another routine to map MSI msg. Yes, f

[PATCH] irqchip/gic-{v2m, v3-its}: check iommu capable before doing iommu map

2017-08-17 Thread Shawn Lin
If a PCIe RC use gic-v2m or gic-v3-its as a msi domain but doesn't have iommu support, we don't need to do iommu_dma_map_msi_msg to get mapped iommu address as all we need is the physical address. Otherwise we see the oops shown below as we can't get a iommu_group for a device without iommu capable

Re: PCIe oops for NULL pointer dereference during next-20170807 and next-20170815

2017-08-17 Thread Marc Zyngier
On 17/08/17 08:58, Joerg Roedel wrote: > On Thu, Aug 17, 2017 at 03:02:31PM +0800, Shawn Lin wrote: >> So should we revert this commit or maybe we could add some checking >> into gic-v2m and gic-v3-its to see if the dev is iommu-capable? If not, >> we should create another routine to map MSI msg. >

Re: PCIe oops for NULL pointer dereference during next-20170807 and next-20170815

2017-08-17 Thread Joerg Roedel
On Thu, Aug 17, 2017 at 03:02:31PM +0800, Shawn Lin wrote: > So should we revert this commit or maybe we could add some checking > into gic-v2m and gic-v3-its to see if the dev is iommu-capable? If not, > we should create another routine to map MSI msg. Yes, fixing this in gic code is the right ap

Re: PCIe oops for NULL pointer dereference during next-20170807 and next-20170815

2017-08-17 Thread Shawn Lin
+ Marc On 2017/8/17 11:34, Shawn Lin wrote: Hi all, I see this NULL pointer dereference into linux-next these day which break PCIe for my system, but not for linux-next-20170807. Is it that commit causing this problem? 05f80300dc8bc ("iommu: Finish making iommu_group support mandatory") The