Re: [RFC PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-08-13 Thread Kenneth Lee
On Mon, Aug 13, 2018 at 03:23:01PM -0400, Jerome Glisse wrote: > Received: from popscn.huawei.com [10.3.17.45] by Turing-Arch-b with POP3 > (fetchmail-6.3.26) for (single-drop); Tue, 14 Aug 2018 > 03:30:02 +0800 (CST) > Received: from DGGEMM401-HUB.china.huawei.com (10.3.20.209) by > DGGEML402-

[PATCH v3] iommu/iova: Optimise attempts to allocate iova from 32bit address range

2018-08-13 Thread Ganapatrao Kulkarni
As an optimisation for PCI devices, there is always first attempt been made to allocate iova from SAC address range. This will lead to unnecessary attempts, when there are no free ranges available. Adding fix to track recently failed iova address size and allow further attempts, only if requested s

Re: [PATCH v4 4/5] iommu/arm-smmu-v3: add support for non-strict mode

2018-08-13 Thread Leizhen (ThunderTown)
On 2018/8/9 19:06, Robin Murphy wrote: > On 06/08/18 13:27, Zhen Lei wrote: >> Dynamically choose strict or non-strict mode for page table config based >> on the iommu domain type. >> >> Signed-off-by: Zhen Lei >> --- >> drivers/iommu/arm-smmu-v3.c | 7 ++- >> 1 file changed, 6 insertion

Re: IOAT DMA w/IOMMU

2018-08-13 Thread Logan Gunthorpe
On 13/08/18 05:48 PM, Kit Chow wrote: > On 08/13/2018 04:39 PM, Logan Gunthorpe wrote: >> >> On 13/08/18 05:30 PM, Kit Chow wrote: >>> In arch/x86/include/asm/page.h, there is the following comment in >>> regards to validating the virtual address. >>> >>> /* >>>   * virt_to_page(kaddr) returns a

Re: IOAT DMA w/IOMMU

2018-08-13 Thread Kit Chow
On 08/13/2018 04:39 PM, Logan Gunthorpe wrote: On 13/08/18 05:30 PM, Kit Chow wrote: In arch/x86/include/asm/page.h, there is the following comment in regards to validating the virtual address. /*  * virt_to_page(kaddr) returns a valid pointer if and only if  * virt_addr_valid(kaddr) retur

Re: IOAT DMA w/IOMMU

2018-08-13 Thread Logan Gunthorpe
On 13/08/18 05:30 PM, Kit Chow wrote: > In arch/x86/include/asm/page.h, there is the following comment in > regards to validating the virtual address. > > /* >  * virt_to_page(kaddr) returns a valid pointer if and only if >  * virt_addr_valid(kaddr) returns true. >  */ > #define virt_to_page(kad

Re: IOAT DMA w/IOMMU

2018-08-13 Thread Kit Chow
Taking a step back, I was a little surprised that dma_map_single successfully returned an iommu address for the pci bar address passed into it during my initial experiment... Internally, dma_map_single calls virt_to_page() to translate the "virtual address" into a page and intel_map page the

Re: IOAT DMA w/IOMMU

2018-08-13 Thread Kit Chow
Taking a step back, I was a little surprised that dma_map_single successfully returned an iommu address for the pci bar address passed into it during my initial experiment... Internally, dma_map_single calls virt_to_page() to translate the "virtual address" into a page and intel_map page then

Re: [RFC PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-08-13 Thread Jerome Glisse
On Mon, Aug 13, 2018 at 05:29:31PM +0800, Kenneth Lee wrote: > > I made a quick change basing on the RFCv1 here: > > https://github.com/Kenneth-Lee/linux-kernel-warpdrive/commits/warpdrive-v0.6 > > I just made it compilable and not test it yet. But it shows how the idea is > going to be. > > T

Re: IOAT DMA w/IOMMU

2018-08-13 Thread Kit Chow
On 08/13/2018 07:59 AM, Robin Murphy wrote: On 13/08/18 15:23, Kit Chow wrote: On 08/10/2018 07:10 PM, Logan Gunthorpe wrote: On 10/08/18 06:53 PM, Kit Chow wrote: I was able to finally succeed in doing the dma transfers over ioat only when prot has DMA_PTE_WRITE set by setting the directi

Re: IOAT DMA w/IOMMU

2018-08-13 Thread Robin Murphy
On 13/08/18 15:23, Kit Chow wrote: On 08/10/2018 07:10 PM, Logan Gunthorpe wrote: On 10/08/18 06:53 PM, Kit Chow wrote: I was able to finally succeed in doing the dma transfers over ioat only when prot has DMA_PTE_WRITE set by setting the direction to either DMA_FROM_DEVICE or DMA_BIDIRECTIONA

Re: IOAT DMA w/IOMMU

2018-08-13 Thread Kit Chow
On 08/10/2018 07:10 PM, Logan Gunthorpe wrote: On 10/08/18 06:53 PM, Kit Chow wrote: I was able to finally succeed in doing the dma transfers over ioat only when prot has DMA_PTE_WRITE set by setting the direction to either DMA_FROM_DEVICE or DMA_BIDIRECTIONAL. Any ideas if the prot settings

Re: [PATCH v2] iommu/iova: Optimise attempts to allocate iova from 32bit address range

2018-08-13 Thread Robin Murphy
On 13/08/18 09:00, Ganapatrao Kulkarni wrote: As an optimisation for PCI devices, there is always first attempt been made to allocate iova from SAC address range. This will lead to unnecessary attempts, when there are no free ranges available. Adding fix to track recently failed iova address size

Re: [RFC PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-08-13 Thread Kenneth Lee
On Sat, Aug 11, 2018 at 11:26:48PM +0800, Kenneth Lee wrote: > Date: Sat, 11 Aug 2018 23:26:48 +0800 > From: Kenneth Lee > To: Jean-Philippe Brucker , Kenneth Lee > , Jerome Glisse > CC: Herbert Xu , "k...@vger.kernel.org" > , Jonathan Corbet , Greg > Kroah-Hartman , Zaibo Xu , > "linux-...@v

[PATCH v2] iommu/iova: Optimise attempts to allocate iova from 32bit address range

2018-08-13 Thread Ganapatrao Kulkarni
As an optimisation for PCI devices, there is always first attempt been made to allocate iova from SAC address range. This will lead to unnecessary attempts, when there are no free ranges available. Adding fix to track recently failed iova address size and allow further attempts, only if requested s

Re: [PATCH v4 5/5] iommu/arm-smmu-v3: add bootup option "arm_iommu"

2018-08-13 Thread Leizhen (ThunderTown)
On 2018/8/9 19:08, Robin Murphy wrote: > On 06/08/18 13:27, Zhen Lei wrote: >> Add a bootup option to make the system manager can choose which mode to >> be used. The default mode is strict. >> >> Signed-off-by: Zhen Lei >> --- >> Documentation/admin-guide/kernel-parameters.txt | 9 +

[GIT PULL] dma mapping updates for 4.19

2018-08-13 Thread Christoph Hellwig
The following changes since commit d72e90f33aa4709ebecc5005562f52335e106a60: Linux 4.18-rc6 (2018-07-22 14:12:20 -0700) are available in the Git repository at: git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-4.19 for you to fetch changes up to 6fa1d28e38cfa0c90f8d64c0cab3