Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Marek Szyprowski
Hi Thierry, On 2019-02-05 23:29, Thierry Reding wrote: > On Tue, Feb 05, 2019 at 07:02:18PM +0100, Christoph Hellwig wrote: >> On Tue, Feb 05, 2019 at 06:56:11PM +0100, Thierry Reding wrote: >>> Sure, here you go: >>> >>> >>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

Re: [PATCH v2] dma-direct: do not allocate a single page from CMA area

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 03:05:30PM -0800, Nicolin Chen wrote: > > And my other concern is that this skips allocating from the per-device > > pool, which drivers might rely on. > > Actually Robin had the same concern at v1 and suggested that we could > always use DMA_ATTR_FORCE_CONTIGUOUS to enforc

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 11:29:12PM +0100, Thierry Reding wrote: > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/host1x/cdma.c#n106 > > > > Yes, I think we I can come up with a nicer helper for that. > > One thing I could also try is to remove di

Re: [PATCH] iommu: Allow io-pgtable to be used outside of drivers/iommu/

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 05:12:29PM +, Robin Murphy wrote: > On 05/02/2019 16:55, Christoph Hellwig wrote: > > On Tue, Feb 05, 2019 at 10:37:31AM -0600, Rob Herring wrote: > > > Move io-pgtable.h to include/linux/ and export alloc_io_pgtable_ops > > > and free_io_pgtable_ops. This enables driver

Re: [PATCH 1/9] iommu/vt-d: Allow interrupts from the entire bus for aliased devices

2019-02-05 Thread Jacob Pan
On Tue, 5 Feb 2019 13:40:36 -0700 Logan Gunthorpe wrote: > On 2019-02-05 12:19 p.m., Jacob Pan wrote: > > On Fri, 1 Feb 2019 10:27:29 -0700 > > Logan Gunthorpe wrote: > > > >> On 2019-02-01 9:44 a.m., Joerg Roedel wrote: > >>> On Thu, Jan 31, 2019 at 11:56:48AM -0700, Logan Gunthorpe > >>>

Re: [PATCH v6 06/20] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-02-05 Thread Evan Green
On Fri, Feb 1, 2019 at 1:42 AM Yong Wu wrote: > > On Thu, 2019-01-31 at 11:23 -0800, Evan Green wrote: > > On Wed, Jan 30, 2019 at 10:59 PM Yong Wu wrote: > > > > > > On Wed, 2019-01-30 at 10:28 -0800, Evan Green wrote: > > > > On Mon, Dec 31, 2018 at 7:57 PM Yong Wu wrote: > > > > > > > > > > M

Re: [PATCH v2] dma-direct: do not allocate a single page from CMA area

2019-02-05 Thread Nicolin Chen
Hi Christoph On Mon, Feb 04, 2019 at 09:23:07AM +0100, Christoph Hellwig wrote: > On Tue, Jan 15, 2019 at 01:51:40PM -0800, Nicolin Chen wrote: > > The addresses within a single page are always contiguous, so it's > > not so necessary to allocate one single page from CMA area. Since > > the CMA ar

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Thierry Reding
On Tue, Feb 05, 2019 at 07:02:18PM +0100, Christoph Hellwig wrote: > On Tue, Feb 05, 2019 at 06:56:11PM +0100, Thierry Reding wrote: > > Sure, here you go: > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/host1x/cdma.c#n106 > > Yes, I think we

Re: [PATCH 0/5 v6] Fix virtio-blk issue with SWIOTLB

2019-02-05 Thread Michael S. Tsirkin
On Fri, Feb 01, 2019 at 09:09:46AM +0100, Christoph Hellwig wrote: > For some reason patch 5 didn't make it to my inbox, but assuming > nothing has changed this whole series looks good to me now. Could you send a formal series ack pls? ___ iommu mailing

Re: [PATCH 0/5 v6] Fix virtio-blk issue with SWIOTLB

2019-02-05 Thread Michael S. Tsirkin
On Thu, Jan 31, 2019 at 05:33:58PM +0100, Joerg Roedel wrote: > Hi, > > here is the next version of this patch-set. Previous > versions can be found here: > > V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ > > V2: https://lore.kernel.org/lkml/20190115132257.

Re: [PATCH 1/9] iommu/vt-d: Allow interrupts from the entire bus for aliased devices

2019-02-05 Thread Logan Gunthorpe
On 2019-02-05 12:19 p.m., Jacob Pan wrote: > On Fri, 1 Feb 2019 10:27:29 -0700 > Logan Gunthorpe wrote: > >> On 2019-02-01 9:44 a.m., Joerg Roedel wrote: >>> On Thu, Jan 31, 2019 at 11:56:48AM -0700, Logan Gunthorpe wrote: @@ -394,6 +402,10 @@ static int set_msi_sid(struct irte *irte, >

Re: [PATCH 1/9] iommu/vt-d: Allow interrupts from the entire bus for aliased devices

2019-02-05 Thread Jacob Pan
On Fri, 1 Feb 2019 10:27:29 -0700 Logan Gunthorpe wrote: > On 2019-02-01 9:44 a.m., Joerg Roedel wrote: > > On Thu, Jan 31, 2019 at 11:56:48AM -0700, Logan Gunthorpe wrote: > >> @@ -394,6 +402,10 @@ static int set_msi_sid(struct irte *irte, > >> struct pci_dev *dev) set_irte_sid(irte, SVT_VERIF

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 06:56:11PM +0100, Thierry Reding wrote: > Sure, here you go: > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/host1x/cdma.c#n106 Yes, I think we I can come up with a nicer helper for that. ___

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Thierry Reding
On Tue, Feb 05, 2019 at 05:38:37PM +0100, Christoph Hellwig wrote: > On Tue, Feb 05, 2019 at 05:20:57PM +0100, Thierry Reding wrote: > > The problem is that if I use dma_alloc_coherent(), then the memory will > > already be mapped via the SMMU at that point and then the driver, not > > knowing that

Re: [PATCH] iommu: Allow io-pgtable to be used outside of drivers/iommu/

2019-02-05 Thread Rob Herring
On Tue, Feb 5, 2019 at 10:55 AM Christoph Hellwig wrote: > > On Tue, Feb 05, 2019 at 10:37:31AM -0600, Rob Herring wrote: > > Move io-pgtable.h to include/linux/ and export alloc_io_pgtable_ops > > and free_io_pgtable_ops. This enables drivers outside drivers/iommu/ to > > use the ARM page table l

Re: [PATCH] iommu: Allow io-pgtable to be used outside of drivers/iommu/

2019-02-05 Thread Robin Murphy
On 05/02/2019 16:55, Christoph Hellwig wrote: On Tue, Feb 05, 2019 at 10:37:31AM -0600, Rob Herring wrote: Move io-pgtable.h to include/linux/ and export alloc_io_pgtable_ops and free_io_pgtable_ops. This enables drivers outside drivers/iommu/ to use the ARM page table library. Specifically, som

Re: [PATCH] iommu: Allow io-pgtable to be used outside of drivers/iommu/

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 10:37:31AM -0600, Rob Herring wrote: > Move io-pgtable.h to include/linux/ and export alloc_io_pgtable_ops > and free_io_pgtable_ops. This enables drivers outside drivers/iommu/ to > use the ARM page table library. Specifically, some ARM Mali GPUs use the > ARM page table fo

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 05:20:57PM +0100, Thierry Reding wrote: > The problem is that if I use dma_alloc_coherent(), then the memory will > already be mapped via the SMMU at that point and then the driver, not > knowing that memory has already been mapped, will attempt to map an IOVA > which will c

[PATCH] iommu: Allow io-pgtable to be used outside of drivers/iommu/

2019-02-05 Thread Rob Herring
Move io-pgtable.h to include/linux/ and export alloc_io_pgtable_ops and free_io_pgtable_ops. This enables drivers outside drivers/iommu/ to use the ARM page table library. Specifically, some ARM Mali GPUs use the ARM page table formats. Cc: Will Deacon Cc: Robin Murphy Cc: Joerg Roedel Cc: Matt

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Thierry Reding
On Tue, Feb 05, 2019 at 05:10:36PM +0100, Christoph Hellwig wrote: > On Tue, Feb 05, 2019 at 12:06:02PM +0100, Thierry Reding wrote: > > From: Thierry Reding > > > > Drivers that are built as modules may want to use these functions, so > > make them available like the rest of the functions. > >

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-02-05 Thread Michael S. Tsirkin
On Tue, Feb 05, 2019 at 08:24:07AM +0100, Christoph Hellwig wrote: > On Mon, Feb 04, 2019 at 04:38:21PM -0500, Michael S. Tsirkin wrote: > > It was designed to make, when set, as many guests as we can work > > correctly, and it seems to be successful in doing exactly that. > > > > Unfortunately th

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 12:06:02PM +0100, Thierry Reding wrote: > From: Thierry Reding > > Drivers that are built as modules may want to use these functions, so > make them available like the rest of the functions. > > Signed-off-by: Thierry Reding How do they want to use these functions? The

Re: [PATCH 06/19] dma-iommu: fix and refactor iommu_dma_mmap

2019-02-05 Thread Robin Murphy
On 14/01/2019 09:41, Christoph Hellwig wrote: The current iommu_dma_mmap code does not properly handle memory from the page allocator that hasn't been remapped, which can happen in the rare case of allocations for a coherent device that aren't allowed to block. Fix this by replacing iommu_dma_mm

[PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Thierry Reding
From: Thierry Reding Drivers that are built as modules may want to use these functions, so make them available like the rest of the functions. Signed-off-by: Thierry Reding --- kernel/dma/direct.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c i