Re: [PATCH v2 1/2] iommu/iova: Retry from last rb tree node if iova search fails

2020-08-28 Thread Vijayanand Jitta
On 8/20/2020 6:19 PM, vji...@codeaurora.org wrote: > From: Vijayanand Jitta > > When ever a new iova alloc request comes iova is always searched > from the cached node and the nodes which are previous to cached > node. So, even if there is free iova space available in the nodes > which are

Re: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Jean-Philippe Brucker
Hi, On Thu, Aug 27, 2020 at 09:33:51PM +1200, Barry Song wrote: > cmdq_issue_cmdlist() is the hotspot that uses a lot of time. This patch > adds tracepoints for it to help debug. > > Signed-off-by: Barry Song > --- > * can furthermore develop an eBPF program to benchmark using this trace Have

RE: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Jean-Philippe Brucker [mailto:jean-phili...@linaro.org] > Sent: Friday, August 28, 2020 7:41 PM > To: Song Bao Hua (Barry Song) > Cc: iommu@lists.linux-foundation.org; linux-arm-ker...@lists.infradead.org; > robin.mur...@arm.com; w...@kernel.org; Linuxarm

Re: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Jean-Philippe Brucker
On Fri, Aug 28, 2020 at 07:55:18AM +, Song Bao Hua (Barry Song) wrote: > > > > -Original Message- > > From: Jean-Philippe Brucker [mailto:jean-phili...@linaro.org] > > Sent: Friday, August 28, 2020 7:41 PM > > To: Song Bao Hua (Barry Song) > > Cc: iommu@lists.linux-foundation.org;

Re: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Will Deacon
On Thu, Aug 27, 2020 at 09:33:51PM +1200, Barry Song wrote: > cmdq_issue_cmdlist() is the hotspot that uses a lot of time. This patch > adds tracepoints for it to help debug. > > Signed-off-by: Barry Song > --- > * can furthermore develop an eBPF program to benchmark using this trace Hmm,

Re: [PATCH v7 18/24] iommu/arm-smmu-v3: Add support for Hardware Translation Table Update

2020-08-28 Thread Zenghui Yu
On 2020/5/20 1:54, Jean-Philippe Brucker wrote: @@ -4454,6 +4470,12 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) smmu->features |= ARM_SMMU_FEAT_E2H; } + if (reg & (IDR0_HA | IDR0_HD)) { + smmu->features |=

[PATCH v1] iommu/dma: Use DMA ops setter instead of direct assignment

2020-08-28 Thread Andy Shevchenko
Use DMA ops setter instead of direct assignment. Even we know that this module doesn't perform access to the dma_ops member of struct device, it's better to use setter to avoid potential problems in the future. Signed-off-by: Andy Shevchenko --- drivers/iommu/dma-iommu.c | 2 +- 1 file changed,

Re: [patch V2 00/46] x86, PCI, XEN, genirq ...: Prepare for device MSI

2020-08-28 Thread Joerg Roedel
On Wed, Aug 26, 2020 at 01:16:28PM +0200, Thomas Gleixner wrote: > This is the second version of providing a base to support device MSI (non > PCI based) and on top of that support for IMS (Interrupt Message Storm) > based devices in a halfways architecture independent way. > > The first version

Re: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Robin Murphy
On 2020-08-28 12:02, Song Bao Hua (Barry Song) wrote: -Original Message- From: Will Deacon [mailto:w...@kernel.org] Sent: Friday, August 28, 2020 10:29 PM To: Song Bao Hua (Barry Song) Cc: iommu@lists.linux-foundation.org; linux-arm-ker...@lists.infradead.org; robin.mur...@arm.com;

Re: [patch V2 34/46] PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable

2020-08-28 Thread Jason Gunthorpe
On Fri, Aug 28, 2020 at 12:21:42PM +0100, Lorenzo Pieralisi wrote: > On Thu, Aug 27, 2020 at 01:20:40PM -0500, Bjorn Helgaas wrote: > > [...] > > > And I can't figure out what's special about tegra, rcar, and xilinx > > that makes them need it as well. Is there something I could grep for > > to

Re: [PATCH 0/2] iommu/amd: Fix IOMMUv2 devices when SME is active

2020-08-28 Thread Felix Kuehling
Am 2020-08-28 um 9:46 a.m. schrieb jroe...@suse.de: > On Wed, Aug 26, 2020 at 03:25:58PM +, Deucher, Alexander wrote: >>> Alex, do you know if anyone has tested amdgpu on an APU with SME >>> enabled? Is this considered something we support? >> It's not something we've tested. I'm not even

RE: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Friday, August 28, 2020 11:18 PM > To: Song Bao Hua (Barry Song) ; Will Deacon > > Cc: iommu@lists.linux-foundation.org; linux-arm-ker...@lists.infradead.org; > j...@8bytes.org; Linuxarm > Subject: Re:

Re: [patch V2 34/46] PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable

2020-08-28 Thread Marc Zyngier
Hi Jason, On 2020-08-28 13:19, Jason Gunthorpe wrote: On Fri, Aug 28, 2020 at 12:21:42PM +0100, Lorenzo Pieralisi wrote: On Thu, Aug 27, 2020 at 01:20:40PM -0500, Bjorn Helgaas wrote: [...] > And I can't figure out what's special about tegra, rcar, and xilinx > that makes them need it as

Re: [patch V2 34/46] PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable

2020-08-28 Thread Marc Zyngier
On 2020-08-28 13:54, Jason Gunthorpe wrote: On Fri, Aug 28, 2020 at 01:47:59PM +0100, Marc Zyngier wrote: > So the arch_setup_msi_irq/etc is not really an arch hook, but some > infrastructure to support those 4 PCI root port drivers. I happen to have a *really old* patch addressing Tegra [1],

Re: [PATCH 0/2] iommu/amd: Fix IOMMUv2 devices when SME is active

2020-08-28 Thread jroe...@suse.de
On Wed, Aug 26, 2020 at 03:25:58PM +, Deucher, Alexander wrote: > > Alex, do you know if anyone has tested amdgpu on an APU with SME > > enabled? Is this considered something we support? > > It's not something we've tested. I'm not even sure the GPU portion of > APUs will work properly

RE: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Will Deacon [mailto:w...@kernel.org] > Sent: Friday, August 28, 2020 10:29 PM > To: Song Bao Hua (Barry Song) > Cc: iommu@lists.linux-foundation.org; linux-arm-ker...@lists.infradead.org; > robin.mur...@arm.com; j...@8bytes.org; Linuxarm > Subject: Re:

Re: [patch V2 34/46] PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable

2020-08-28 Thread Lorenzo Pieralisi
On Thu, Aug 27, 2020 at 01:20:40PM -0500, Bjorn Helgaas wrote: [...] > And I can't figure out what's special about tegra, rcar, and xilinx > that makes them need it as well. Is there something I could grep for > to identify them? Is there a way to convert them so they don't need > it? I think

Re: [patch V2 34/46] PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable

2020-08-28 Thread Jason Gunthorpe
On Fri, Aug 28, 2020 at 01:47:59PM +0100, Marc Zyngier wrote: > > So the arch_setup_msi_irq/etc is not really an arch hook, but some > > infrastructure to support those 4 PCI root port drivers. > > I happen to have a *really old* patch addressing Tegra [1], which > I was never able to test (no

[PATCH v1] iommu/vt-d: Move intel_iommu_gfx_mapped to Intel IOMMU header

2020-08-28 Thread Andy Shevchenko
Static analyzer is not happy about intel_iommu_gfx_mapped declaration: .../drivers/iommu/intel/iommu.c:364:5: warning: symbol 'intel_iommu_gfx_mapped' was not declared. Should it be static? Move its declaration to Intel IOMMU header file. Signed-off-by: Andy Shevchenko ---

Re: [PATCH 0/2] iommu/amd: Fix IOMMUv2 devices when SME is active

2020-08-28 Thread jroe...@suse.de
Hi Felix, On Fri, Aug 28, 2020 at 09:54:59AM -0400, Felix Kuehling wrote: > Yes, we're working on this. IOMMUv2 is only needed for KFD. It's not > needed for graphics. And we're making it optional for KFD as well. Okay, KFD should fail gracefully because it can't initialize the device's iommuv2

Re: [PATCH v2 1/9] docs: Document IO Address Space ID (IOASID) APIs

2020-08-28 Thread Jacob Pan
Hi Baolu, Thanks for the review! On Sun, 23 Aug 2020 15:05:08 +0800 Lu Baolu wrote: > Hi Jacob, > > On 2020/8/22 12:35, Jacob Pan wrote: > > IOASID is used to identify address spaces that can be targeted by > > device DMA. It is a system-wide resource that is essential to its > > many users.

Re: [patch V2 43/46] genirq/msi: Provide and use msi_domain_set_default_info_flags()

2020-08-28 Thread Thomas Gleixner
On Thu, Aug 27 2020 at 09:17, Marc Zyngier wrote: > On 2020-08-26 12:17, Thomas Gleixner wrote: >> #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN >> +void msi_domain_set_default_info_flags(struct msi_domain_info *info) >> +{ >> +/* Required so that a device latches a valid MSI message on startup >> */

Re: [patch V2 34/46] PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable

2020-08-28 Thread Thomas Gleixner
On Thu, Aug 27 2020 at 13:20, Bjorn Helgaas wrote: > On Wed, Aug 26, 2020 at 01:17:02PM +0200, Thomas Gleixner wrote: >> Make the architectures and drivers which rely on them select them in Kconfig >> and if not selected replace them by stub functions which emit a warning and >> fail the PCI/MSI

Re: [PATCH 0/2] iommu/amd: Fix IOMMUv2 devices when SME is active

2020-08-28 Thread jroe...@suse.de
On Fri, Aug 28, 2020 at 03:11:32PM +, Deucher, Alexander wrote: > There are hw bugs on Raven and probably Carrizo/Stoney where they need > 1:1 mapping to avoid bugs in some corner cases with the displays. > Other GPUs should be fine. The VIDs is 0x1002 and the DIDs are 0x15dd > and 0x15d8 for

RE: [PATCH 0/2] iommu/amd: Fix IOMMUv2 devices when SME is active

2020-08-28 Thread Deucher, Alexander
[AMD Public Use] > -Original Message- > From: Kuehling, Felix > Sent: Friday, August 28, 2020 9:55 AM > To: jroe...@suse.de; Deucher, Alexander > Cc: Joerg Roedel ; iommu@lists.linux-foundation.org; > Huang, Ray ; Koenig, Christian > ; Lendacky, Thomas > ; Suthikulpanit, Suravee > ;

RE: [PATCH 0/2] iommu/amd: Fix IOMMUv2 devices when SME is active

2020-08-28 Thread Deucher, Alexander
[AMD Public Use] > -Original Message- > From: jroe...@suse.de > Sent: Friday, August 28, 2020 11:30 AM > To: Deucher, Alexander > Cc: Kuehling, Felix ; Joerg Roedel > ; iommu@lists.linux-foundation.org; Huang, Ray > ; Koenig, Christian ; > Lendacky, Thomas ; Suthikulpanit, Suravee > ;

[PATCH v1] iommu/vt-d: Move intel_iommu_ops to header file

2020-08-28 Thread Andy Shevchenko
Compiler is not happy about hidden declaration of intel_iommu_ops. .../drivers/iommu/intel/iommu.c:414:24: warning: symbol 'intel_iommu_ops' was not declared. Should it be static? Move declaration to header file to make compiler happy. Signed-off-by: Andy Shevchenko ---

Re: [PATCH v2 1/9] docs: Document IO Address Space ID (IOASID) APIs

2020-08-28 Thread Jacob Pan
Hi Jean, Thanks for the review! On Mon, 24 Aug 2020 12:32:39 +0200 Jean-Philippe Brucker wrote: > On Fri, Aug 21, 2020 at 09:35:10PM -0700, Jacob Pan wrote: > > IOASID is used to identify address spaces that can be targeted by > > device DMA. It is a system-wide resource that is essential to