Re: [PATCH 5/5] dma-direct: always allow dma mask <= physiscal memory size

2018-10-08 Thread Benjamin Herrenschmidt
On Wed, 2018-10-03 at 16:10 -0700, Alexander Duyck wrote: > > -* Because 32-bit DMA masks are so common we expect every > > architecture > > -* to be able to satisfy them - either by not supporting more > > physical > > -* memory, or by providing a ZONE_DMA32. If neither

Re: [PATCH] dma-direct: document the zone selection logic

2018-10-08 Thread Benjamin Herrenschmidt
On Mon, 2018-10-08 at 09:03 +0200, Christoph Hellwig wrote: > Ben, does this resolve your issues with the confusing zone selection? The comment does make things a tad clearer yes :) Thanks ! Cheers, Ben. > On Mon, Oct 01, 2018 at 01:10:16PM -0700, Christoph Hellwig wrote: > > What we are doing

[PATCH 4.18 156/168] iommu/amd: Clear memory encryption mask from physical address

2018-10-08 Thread Greg Kroah-Hartman
4.18-stable review patch. If anyone has any objections, please let me know. -- From: Singh, Brijesh commit b3e9b515b08e407ab3a026dc2e4d935c48d05f69 upstream. Boris Ostrovsky reported a memory leak with device passthrough when SME is active. The VFIO driver uses iommu_iova_to_

[PATCH 4.14 84/94] iommu/amd: Clear memory encryption mask from physical address

2018-10-08 Thread Greg Kroah-Hartman
4.14-stable review patch. If anyone has any objections, please let me know. -- From: Singh, Brijesh commit b3e9b515b08e407ab3a026dc2e4d935c48d05f69 upstream. Boris Ostrovsky reported a memory leak with device passthrough when SME is active. The VFIO driver uses iommu_iova_to_

Patch "iommu/amd: Clear memory encryption mask from physical address" has been added to the 4.18-stable tree

2018-10-08 Thread gregkh
This is a note to let you know that I've just added the patch titled iommu/amd: Clear memory encryption mask from physical address to the 4.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is

Patch "iommu/amd: Clear memory encryption mask from physical address" has been added to the 4.14-stable tree

2018-10-08 Thread gregkh
This is a note to let you know that I've just added the patch titled iommu/amd: Clear memory encryption mask from physical address to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is

Re: source-id verification failures

2018-10-08 Thread Jerry Snitselaar
On Fri Oct 05 18, Raj, Ashok wrote: On Thu, Oct 04, 2018 at 03:07:46PM -0700, Jacob Pan wrote: On Thu, 4 Oct 2018 13:57:24 -0700 Jerry Snitselaar wrote: > On Thu Oct 04 18, Joerg Roedel wrote: > >Hi Jerry, > > > >thanks for the report. > > > >On Tue, Oct 02, 2018 at 10:25:29AM -0700, Jerry Sni

Re: [PATCH 1/1] iommu/amd: Add default branch in amd_iommu_capable()

2018-10-08 Thread Joerg Roedel
On Mon, Oct 08, 2018 at 10:24:19AM +0800, Lu Baolu wrote: > Recent gcc warns about switching on an enumeration, but not having > an explicit case statement for all members of the enumeration. To > show the compiler this is intentional, we simply add a default case > with nothing more than a break s

Re: [PATCH] dt-bindings: iommu: ipmmu-vmsa: Add r8a7744 support

2018-10-08 Thread Joerg Roedel
On Thu, Oct 04, 2018 at 05:25:47PM +0100, Biju Das wrote: > Document RZ/G1N (R8A7744) SoC bindings. > > Signed-off-by: Biju Das > Reviewed-by: Chris Paterson Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxf

RE: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-10-08 Thread Liu, Yi L
Hi Jean, > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Thursday, September 27, 2018 9:38 PM > To: Liu, Yi L ; Joerg Roedel > Subject: Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces > > On 27/09/2018 04:22, Liu, Yi L wrote: > >> For the "classic" vfio

[PATCH 10/10] arm64: use the generic swiotlb_dma_ops

2018-10-08 Thread Christoph Hellwig
Now that the generic swiotlb code supports non-coherent DMA we can switch to it for arm64. For that we need to refactor the existing alloc/free/mmap/pgprot helpers to be used as the architecture hooks, and implement the standard arch_sync_dma_for_{device,cpu} hooks for cache maintaincance in the s

[PATCH 09/10] swiotlb: add support for non-coherent DMA

2018-10-08 Thread Christoph Hellwig
Handle architectures that are not cache coherent directly in the main swiotlb code by calling arch_sync_dma_for_{device,cpu} in all the right places from the various dma_map/unmap/sync methods when the device is non-coherent. Because swiotlb now uses dma_direct_alloc for the coherent allocation th

[PATCH 07/10] swiotlb: refactor swiotlb_map_page

2018-10-08 Thread Christoph Hellwig
Remove the somewhat useless map_single function, and replace it with a swiotlb_bounce_page handler that handles everything related to actually bouncing a page. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 77 +--- 1 file changed, 36 insertio

[PATCH 08/10] swiotlb: don't dip into swiotlb pool for coherent allocations

2018-10-08 Thread Christoph Hellwig
All architectures that support swiotlb also have a zone that backs up these less than full addressing allocations (usually ZONE_DMA32). Because of that it is rather pointless to fall back to the global swiotlb buffer if the normal dma direct allocation failed - the only thing this will do is to ea

[PATCH 05/10] swiotlb: merge swiotlb_unmap_page and unmap_single

2018-10-08 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 11dbcd80b4a6..15335f3a1bf3 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -765,9 +765,9

[PATCH 06/10] swiotlb: use swiotlb_map_page in swiotlb_map_sg_attrs

2018-10-08 Thread Christoph Hellwig
No need to duplicate the code - map_sg is equivalent to map_page for each page in the scatterlist. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/

[PATCH 04/10] swiotlb: remove the overflow buffer

2018-10-08 Thread Christoph Hellwig
Like all other dma mapping drivers just return an error code instead of an actual memory buffer. The reason for the overflow buffer was that at the time swiotlb was invented there was no way to check for dma mapping errors, but this has long been fixed. Signed-off-by: Christoph Hellwig --- arch

[PATCH 02/10] swiotlb: mark is_swiotlb_buffer static

2018-10-08 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/swiotlb.h | 1 - kernel/dma/swiotlb.c| 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 965be92c33b5..7ef541ce8f34 100644 --- a/include/linux/swiotlb.h +++ b/include/l

[PATCH 03/10] swiotlb: do not panic on mapping failures

2018-10-08 Thread Christoph Hellwig
All properly written drivers now have error handling in the dma_map_single / dma_map_page callers. As swiotlb_tbl_map_single already prints a useful warning when running out of swiotlb pool swace we can also remove swiotlb_full entirely as it serves no purpose now. Signed-off-by: Christoph Hellwi

move swiotlb noncoherent dma support from arm64 to generic code V2

2018-10-08 Thread Christoph Hellwig
Hi all, this series starts with various swiotlb cleanups, then adds support for non-cache coherent devices to the generic swiotlb support, and finally switches arm64 to use the generic code. Given that this series depends on patches in the dma-mapping tree, or pending for it I've also published a

[PATCH 01/10] swiotlb: remove a pointless comment

2018-10-08 Thread Christoph Hellwig
This comments describes an aspect of the map_sg interface that isn't even exploited by swiotlb. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 4f8a6dbf0b60..9062b14bc7f4 100644 -

Re: [PATCH v3] dma-debug: Check for drivers mapping invalid addresses in dma_map_single()

2018-10-08 Thread Christoph Hellwig
Thanks, applied to the dma-mapping tree for 4.20. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH] dt-bindings: iommu: ipmmu-vmsa: Add r8a7744 support

2018-10-08 Thread Simon Horman
On Thu, Oct 04, 2018 at 05:25:47PM +0100, Biju Das wrote: > Document RZ/G1N (R8A7744) SoC bindings. > > Signed-off-by: Biju Das > Reviewed-by: Chris Paterson Reviewed-by: Simon Horman ___ iommu mailing list iommu@lists.linux-foundation.org https://l

[PATCH v3] dma-debug: Check for drivers mapping invalid addresses in dma_map_single()

2018-10-08 Thread Stephen Boyd
I recently debugged a DMA mapping oops where a driver was trying to map a buffer returned from request_firmware() with dma_map_single(). Memory returned from request_firmware() is mapped into the vmalloc region and this isn't a valid region to map with dma_map_single() per the DMA documentation's "

Re: [PATCH] dma-direct: document the zone selection logic

2018-10-08 Thread Christoph Hellwig
Ben, does this resolve your issues with the confusing zone selection? On Mon, Oct 01, 2018 at 01:10:16PM -0700, Christoph Hellwig wrote: > What we are doing here isn't quite obvious, so add a comment explaining > it. > > Signed-off-by: Christoph Hellwig > --- > kernel/dma/direct.c | 9 -

Re: fix up nowarn confusion in the dma mapping layer

2018-10-08 Thread Christoph Hellwig
Any comments on these rather trivial patches? On Mon, Oct 01, 2018 at 01:12:55PM -0700, Christoph Hellwig wrote: > Hi all, > > this series sorts out how we deal with the nowarn flags in the dma > mapping code. We still support __GFP_NOWARN for the legacy APIs that > don't support passing the dma