[PATCH v8 0/2] Base enablement of IOMMU debugfs support

2018-05-29 Thread Gary R Hook
These patches create a top-level function, called at IOMMU initialization, to create a debugfs directory for the IOMMU. Under this directory drivers may create and populate vendor-specific directories for their device internals. Patch 1: general IOMMU enablement Patch 2: basic AMD enablement to

Re: [PATCH v8 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-29 Thread Greg KH
On Tue, May 29, 2018 at 01:23:14PM -0500, Gary R Hook wrote: > Provide base enablement for using debugfs to expose internal data of an > IOMMU driver. When called, create the /sys/kernel/debug/iommu directory. > > Emit a strong warning at boot time to indicate that this feature is > enabled. > >

Re: [PATCH v8 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-29 Thread Greg KH
On Tue, May 29, 2018 at 01:23:23PM -0500, Gary R Hook wrote: > Implement a skeleton framework for debugfs support in the > AMD IOMMU. Add a hidden boolean to Kconfig that is defined > for the AMD IOMMU when general IOMMY DebugFS support is > enabled. > > Signed-off-by: Gary R Hook > --- >

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-29 Thread Alex Williamson
On Fri, 20 Apr 2018 16:42:51 -0700 Jacob Pan wrote: > On Fri, 20 Apr 2018 19:25:34 +0100 > Jean-Philippe Brucker wrote: > > > On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex Williamson wrote: > > [...] > > > > + /* Assign guest PASID table pointer and size order */ > > > > +

Re: [PATCH v5 17/23] iommu/vt-d: report non-recoverable faults to device

2018-05-29 Thread Jacob Pan
On Mon, 14 May 2018 16:17:28 +0800 Lu Baolu wrote: > Hi, > > On 05/12/2018 04:54 AM, Jacob Pan wrote: > > Currently, dmar fault IRQ handler does nothing more than rate > > limited printk, no critical hardware handling need to be done > > in IRQ context. > > Not exactly. dmar_fault() needs to

[PATCH v8 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-29 Thread Gary R Hook
Provide base enablement for using debugfs to expose internal data of an IOMMU driver. When called, create the /sys/kernel/debug/iommu directory. Emit a strong warning at boot time to indicate that this feature is enabled. This function is called from iommu_init, and creates the initial DebugFS

[PATCH v8 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-29 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Add a hidden boolean to Kconfig that is defined for the AMD IOMMU when general IOMMY DebugFS support is enabled. Signed-off-by: Gary R Hook --- drivers/iommu/Kconfig |4 drivers/iommu/Makefile|

Re: [PATCH v2 0/9] iommu/vt-d: Improve PASID id and table management

2018-05-29 Thread Lu Baolu
Hi, On 05/29/2018 07:56 PM, Joerg Roedel wrote: > On Wed, May 16, 2018 at 04:01:00PM +0800, Lu Baolu wrote: >> You are right. System-wide pasid space is necessary, hence PATCH >> 1~3 implement it. But PATCH 4~9 don't go into the opposite direction, >> it's designed to address another potential

Re: [PATCH] iommu/amd - Optimize PPR log handling

2018-05-29 Thread Joerg Roedel
On Tue, May 29, 2018 at 12:28:54PM -0500, Gary R Hook wrote: > No, no numbers. We're still working out how best to test this, and > suggestions/strategies are welcome. Maybe run a simple kernel on the CPU that does a memcpy on a larger portion of mmapped (but yet unmapped) process address space

RE: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-29 Thread Tian, Kevin
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Wednesday, May 30, 2018 4:09 AM > > On Fri, 20 Apr 2018 16:42:51 -0700 > Jacob Pan wrote: > > > On Fri, 20 Apr 2018 19:25:34 +0100 > > Jean-Philippe Brucker wrote: > > > > > On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-29 Thread Alex Williamson
On Wed, 30 May 2018 01:41:43 + "Tian, Kevin" wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Wednesday, May 30, 2018 4:09 AM > > > > On Fri, 20 Apr 2018 16:42:51 -0700 > > Jacob Pan wrote: > > > > > On Fri, 20 Apr 2018 19:25:34 +0100 > > > Jean-Philippe

Re: [PATCH] dma-direct: don't crash on device without dma_mask

2018-05-29 Thread Finn Thain
On Tue, 29 May 2018, Christoph Hellwig wrote: > Print a useful warning instead. > > Reported-by: Finn Thain > Signed-off-by: Christoph Hellwig Tested-by: Finn Thain Thanks. -- > --- > lib/dma-direct.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/dma-direct.c

RE: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-29 Thread Tian, Kevin
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Wednesday, May 30, 2018 11:18 AM > > On Wed, 30 May 2018 01:41:43 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > > Sent: Wednesday, May 30, 2018 4:09 AM > > > > > > On Fri, 20

Re: [PATCH v2 39/40] iommu/arm-smmu-v3: Add support for PRI

2018-05-29 Thread Jean-Philippe Brucker
On 25/05/18 15:08, Bharat Kumar Gogada wrote: >> +master->can_fault = true; >> +master->ste.prg_resp_needs_ssid = >> pci_prg_resp_requires_prefix(pdev); > > Any reason why this is not cleared in arm_smmu_disable_pri ? Actually, setting it here is wrong. Since we now call enable_pri()

[PATCH 3/3] nds32: use generic dma_noncoherent_ops

2018-05-29 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/nds32/Kconfig | 3 + arch/nds32/include/asm/Kbuild| 1 + arch/nds32/include/asm/dma-mapping.h | 14 arch/nds32/kernel/dma.c | 113

[PATCH 1/3] nds32: consolidate DMA cache maintainance routines

2018-05-29 Thread Christoph Hellwig
Make sure all other DMA methods call nds32_dma_sync_single_for_{device,cpu} to perform cache maintaince, and remove the consisteny_sync helper that implemented both with entirely separate code based off an argument. Also make sure these helpers handled highmem properly, for which code is copy and

switch nds32 to use dma_noncoherent_ops

2018-05-29 Thread Christoph Hellwig
This series switcheѕ the nds32 architecture to use the dma_noncoherent_ops, and while doing so implements full blown highmem support based on the mips code. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH v2 13/40] vfio: Add support for Shared Virtual Addressing

2018-05-29 Thread Xu Zaibo
Hi, On 2018/5/29 19:55, Jean-Philippe Brucker wrote: (If possible, please reply in plain text to the list. Reading this in a text-only reader is confusing, because all quotes have the same level) Sorry for that, I have reset the thunderbird, :) thanks. On 26/05/18 04:53, Xu Zaibo wrote: I

Re: [PATCH 1/3] nds32: consolidate DMA cache maintainance routines

2018-05-29 Thread Greentime Hu
2018-05-29 17:48 GMT+08:00 Christoph Hellwig : > Make sure all other DMA methods call nds32_dma_sync_single_for_{device,cpu} > to perform cache maintaince, and remove the consisteny_sync helper that > implemented both with entirely separate code based off an argument. > > Also make sure these

Re: [PATCH 3/3] nds32: use generic dma_noncoherent_ops

2018-05-29 Thread Greentime Hu
2018-05-29 17:48 GMT+08:00 Christoph Hellwig : > Switch to the generic noncoherent direct mapping implementation. > > Signed-off-by: Christoph Hellwig > --- > arch/nds32/Kconfig | 3 + > arch/nds32/include/asm/Kbuild| 1 + > arch/nds32/include/asm/dma-mapping.h |

Re: [PATCH v2 0/9] iommu/vt-d: Improve PASID id and table management

2018-05-29 Thread Joerg Roedel
On Wed, May 16, 2018 at 04:01:00PM +0800, Lu Baolu wrote: > You are right. System-wide pasid space is necessary, hence PATCH > 1~3 implement it. But PATCH 4~9 don't go into the opposite direction, > it's designed to address another potential issue. Okay, thanks for the clarification. Please send

Re: [PATCH v2 13/40] vfio: Add support for Shared Virtual Addressing

2018-05-29 Thread Jean-Philippe Brucker
(If possible, please reply in plain text to the list. Reading this in a text-only reader is confusing, because all quotes have the same level) On 26/05/18 04:53, Xu Zaibo wrote: > I guess there may be some misunderstandings :). > > From the current patches, 'iommu_sva_device_shutdown' is called

Re: [PATCH 2/3] nds32: implement the unmap_sg DMA operation

2018-05-29 Thread Greentime Hu
2018-05-29 17:48 GMT+08:00 Christoph Hellwig : > This matches the implementation of the more commonly used unmap_single > routines and the sync_sg_for_cpu method which should provide equivalent > cache maintainance. > > Signed-off-by: Christoph Hellwig > --- > arch/nds32/kernel/dma.c | 6 ++

Re: [PATCH v7 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-29 Thread Joerg Roedel
On Fri, May 18, 2018 at 04:02:46PM -0500, Gary R Hook wrote: > "Preferred", perhaps. Neither is incorrect. And really, the Makefile/Kconfig > choice is somewhat separate from the organization issue. > > So I've made the changes for this. Now I'm waiting on Joerg to make a > decision on the

[PATCH] dma-direct: don't crash on device without dma_mask

2018-05-29 Thread Christoph Hellwig
Print a useful warning instead. Reported-by: Finn Thain Signed-off-by: Christoph Hellwig --- lib/dma-direct.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/dma-direct.c b/lib/dma-direct.c index a48f94eff62e..8be8106270c2 100644 --- a/lib/dma-direct.c +++ b/lib/dma-direct.c @@

Re: [PATCH] iommu/amd - Optimize PPR log handling

2018-05-29 Thread Joerg Roedel
Hey Gary, On Fri, May 18, 2018 at 04:51:56PM -0500, Gary R Hook wrote: > Improve the performance of the PPR log polling function (i.e. the > task of emptying the log) by minimizing MMIO operations and more > efficiently processing groups of log entries. Cache the head > pointer, as there's never

Re: [PATCH v5 14/23] iommu: introduce page response function

2018-05-29 Thread Jacob Pan
On Mon, 14 May 2018 14:39:51 +0800 Lu Baolu wrote: > Hi, > > On 05/12/2018 04:54 AM, Jacob Pan wrote: > > IO page faults can be handled outside IOMMU subsystem. For an > > example, when nested translation is turned on and guest owns the > > first level page tables, device page request can be

Re: [PATCH v5 15/23] iommu: handle page response timeout

2018-05-29 Thread Jacob Pan
On Mon, 14 May 2018 15:43:54 +0800 Lu Baolu wrote: > Hi, > > On 05/12/2018 04:54 AM, Jacob Pan wrote: > > When IO page faults are reported outside IOMMU subsystem, the page > > request handler may fail for various reasons. E.g. a guest received > > page requests but did not have a chance to run

Re: [PATCH v5 00/23] IOMMU and VT-d driver support for Shared Virtual Address (SVA)

2018-05-29 Thread Jacob Pan
Hi Joerg, Just wondering if you had a chance to review this version before I spin another one mostly based on Baolu's comments. I have incorporated feedbacks from your review on the previous version, but it was a while ago. Thanks, Jacob On Fri, 11 May 2018 13:53:52 -0700 Jacob Pan wrote: >

Re: [PATCH v2] iommu/io-pgtable-arm: Make allocations NUMA-aware

2018-05-29 Thread Joerg Roedel
On Tue, May 22, 2018 at 12:50:09PM +0100, Robin Murphy wrote: > Acked-by: Will Deacon > Signed-off-by: Robin Murphy > --- > > v2: Retain equivalent highmem check > > drivers/iommu/io-pgtable-arm.c | 13 + > 1 file changed, 9 insertions(+), 4 deletions(-) Applied, thanks.

Re: [PATCH] iommu/amd - Optimize PPR log handling

2018-05-29 Thread Gary R Hook
On 05/29/2018 09:54 AM, Joerg Roedel wrote: Hey Gary, On Fri, May 18, 2018 at 04:51:56PM -0500, Gary R Hook wrote: Improve the performance of the PPR log polling function (i.e. the task of emptying the log) by minimizing MMIO operations and more efficiently processing groups of log entries.