Re: IOAT DMA w/IOMMU

2018-08-10 Thread Kit Chow
There is an internal routine (__intel_map_single) inside the intel iommu code that does the actual mapping using a phys_addr_t. Think I'll try to implement a intel_map_resource routine that calls that routine directly without all of the conversions done for dma_map_{single,page} (pci bar addr

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Logan Gunthorpe
On 10/08/18 10:02 AM, Kit Chow wrote: > Turns out there is no dma_map_resource routine on x86. get_dma_ops > returns intel_dma_ops which has map_resource pointing to NULL. Oh, yup. I wasn't aware of that. From a cursory view, it looks like it shouldn't be too hard to implement though. > Will

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Logan Gunthorpe
On 10/08/18 10:23 AM, Kit Chow wrote: > There is an internal routine (__intel_map_single) inside the intel iommu > code that does the actual mapping using a phys_addr_t. Think I'll try to > implement a intel_map_resource routine that calls that routine directly > without all of the

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Logan Gunthorpe
On 10/08/18 10:31 AM, Dave Jiang wrote: > > > On 08/10/2018 09:24 AM, Logan Gunthorpe wrote: >> >> >> On 10/08/18 10:02 AM, Kit Chow wrote: >>> Turns out there is no dma_map_resource routine on x86. get_dma_ops >>> returns intel_dma_ops which has map_resource pointing to NULL. >> >> Oh, yup.

Re: [PATCH 1/3] dts: arm64/sdm845: Add node for arm,mmu-500

2018-08-10 Thread Doug Anderson via iommu
Hi, On Thu, Jul 19, 2018 at 10:53 AM, Vivek Gautam wrote: > Add device node for arm,mmu-500 available on sdm845. > This MMU-500 with single TCU and multiple TBU architecture > is shared among all the peripherals except gpu on sdm845. > > Signed-off-by: Vivek Gautam > --- >

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Dave Jiang
On 08/10/2018 09:24 AM, Logan Gunthorpe wrote: > > > On 10/08/18 10:02 AM, Kit Chow wrote: >> Turns out there is no dma_map_resource routine on x86. get_dma_ops >> returns intel_dma_ops which has map_resource pointing to NULL. > > Oh, yup. I wasn't aware of that. From a cursory view, it

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Dave Jiang
On 08/10/2018 09:33 AM, Logan Gunthorpe wrote: > > > On 10/08/18 10:31 AM, Dave Jiang wrote: >> >> >> On 08/10/2018 09:24 AM, Logan Gunthorpe wrote: >>> >>> >>> On 10/08/18 10:02 AM, Kit Chow wrote: Turns out there is no dma_map_resource routine on x86. get_dma_ops returns

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Dave Jiang
On 08/10/2018 10:15 AM, Logan Gunthorpe wrote: > > > On 10/08/18 11:01 AM, Dave Jiang wrote: >> Or if the BIOS has provided mapping for the Intel NTB device >> specifically? Is that a possibility? NTB does go through the IOMMU. > > I don't know but if the BIOS is doing it, but that would

Re: [PATCH] vfio/pci: Some buggy virtual functions incorrectly report 1 for intx.

2018-08-10 Thread Alan Cox
> The hardware isn't public yet, so can't talk about it :-(. Once this patch > gets > merged, will let the OSV engagement folks drive it for inclusions. We > could mark this for stable, but i would rather wait until we know the > timeline when they are expecting it to be in. It shouldn't break

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Kit Chow
Turns out there is no dma_map_resource routine on x86. get_dma_ops returns intel_dma_ops which has map_resource pointing to NULL. (gdb) p intel_dma_ops $7 = {alloc = 0x8150f310 ,   free = 0x8150ec20 ,   mmap = 0x0 , get_sgtable = 0x0 ,   map_page = 0x8150f2d0 ,  

Re: [PATCH] vfio/pci: Some buggy virtual functions incorrectly report 1 for intx.

2018-08-10 Thread Raj, Ashok
On Fri, Aug 10, 2018 at 05:48:36PM +0100, Alan Cox wrote: > > The hardware isn't public yet, so can't talk about it :-(. Once this patch > > gets > > merged, will let the OSV engagement folks drive it for inclusions. We > > could mark this for stable, but i would rather wait until we know the

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

2018-08-10 Thread Jerome Glisse
On Fri, Aug 10, 2018 at 11:39:13AM +0800, Kenneth Lee wrote: > On Thu, Aug 09, 2018 at 10:46:13AM -0400, Jerome Glisse wrote: > > Date: Thu, 9 Aug 2018 10:46:13 -0400 > > From: Jerome Glisse > > To: Kenneth Lee > > CC: Kenneth Lee , "Tian, Kevin" > > , Alex Williamson , > > Herbert Xu ,

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Logan Gunthorpe
On 10/08/18 11:01 AM, Dave Jiang wrote: > Or if the BIOS has provided mapping for the Intel NTB device > specifically? Is that a possibility? NTB does go through the IOMMU. I don't know but if the BIOS is doing it, but that would only at best work for Intel NTB I see no hope in getting the

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Logan Gunthorpe
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 > need to be changed? Are there any bad

Re: IOAT DMA w/IOMMU

2018-08-10 Thread Kit Chow
Success! I've implemented a new intel_map_resource (and intel_unmap_resource) routine which is called by dma_map_resource. As mentioned previously, the primary job of dma_map_resource/intel_map_resource is to call the intel iommu internal mapping routine (__intel_map_single) without

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

2018-08-10 Thread Ganapatrao Kulkarni
Hi Robin, On Fri, Aug 10, 2018 at 2:13 AM, Robin Murphy wrote: > On 2018-08-09 6:49 PM, Ganapatrao Kulkarni wrote: >> >> Hi Robin, >> >> On Thu, Aug 9, 2018 at 9:54 PM, Robin Murphy wrote: >>> >>> On 07/08/18 09:54, Ganapatrao Kulkarni wrote: As an optimisation for PCI devices,

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

2018-08-10 Thread Jean-Philippe Brucker
Hi Kenneth, On 10/08/18 04:39, Kenneth Lee wrote: >> You can achieve everything you want to achieve with existing upstream >> solution. Re-inventing a whole new driver infrastructure should really >> be motivated with strong and obvious reasons. > > I want to understand better of your idea. If I

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

2018-08-10 Thread Robin Murphy
On 10/08/18 10:24, Ganapatrao Kulkarni wrote: Hi Robin, On Fri, Aug 10, 2018 at 2:13 AM, Robin Murphy wrote: On 2018-08-09 6:49 PM, Ganapatrao Kulkarni wrote: Hi Robin, On Thu, Aug 9, 2018 at 9:54 PM, Robin Murphy wrote: On 07/08/18 09:54, Ganapatrao Kulkarni wrote: As an

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

2018-08-10 Thread Ganapatrao Kulkarni
On Fri, Aug 10, 2018 at 3:19 PM, Robin Murphy wrote: > On 10/08/18 10:24, Ganapatrao Kulkarni wrote: >> >> Hi Robin, >> >> On Fri, Aug 10, 2018 at 2:13 AM, Robin Murphy >> wrote: >>> >>> On 2018-08-09 6:49 PM, Ganapatrao Kulkarni wrote: Hi Robin, On Thu, Aug 9, 2018 at