<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/dma, branch v5.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-04-08T19:46:57Z</updated>
<entry>
<title>dma-debug: fix displaying of dma allocation type</title>
<updated>2020-04-08T19:46:57Z</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2020-04-08T19:43:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9bb50ed7470944238ec8e30a94ef096caf9056ee'/>
<id>urn:sha1:9bb50ed7470944238ec8e30a94ef096caf9056ee</id>
<content type='text'>
The commit 2e05ea5cdc1a ("dma-mapping: implement dma_map_single_attrs using
dma_map_page_attrs") removed "dma_debug_page" enum, but missed to update
type2name string table. This causes incorrect displaying of dma allocation
type.
Fix it by removing "page" string from type2name string table and switch to
use named initializers.

Before (dma_alloc_coherent()):
k3-ringacc 4b800000.ringacc: scather-gather idx 2208 P=d1140000 N=d114 D=d1140000 L=40 DMA_BIDIRECTIONAL dma map error check not applicable
k3-ringacc 4b800000.ringacc: scather-gather idx 2216 P=d1150000 N=d115 D=d1150000 L=40 DMA_BIDIRECTIONAL dma map error check not applicable

After:
k3-ringacc 4b800000.ringacc: coherent idx 2208 P=d1140000 N=d114 D=d1140000 L=40 DMA_BIDIRECTIONAL dma map error check not applicable
k3-ringacc 4b800000.ringacc: coherent idx 2216 P=d1150000 N=d115 D=d1150000 L=40 DMA_BIDIRECTIONAL dma map error check not applicable

Fixes: 2e05ea5cdc1a ("dma-mapping: implement dma_map_single_attrs using dma_map_page_attrs")
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-direct: fix data truncation in dma_direct_get_required_mask()</title>
<updated>2020-04-08T18:52:24Z</updated>
<author>
<name>Kishon Vijay Abraham I</name>
<email>kishon@ti.com</email>
</author>
<published>2020-04-06T05:28:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdcda0d1f8f4ab84efe7cd9921c98364398aefd7'/>
<id>urn:sha1:cdcda0d1f8f4ab84efe7cd9921c98364398aefd7</id>
<content type='text'>
The upper 32-bit physical address gets truncated inadvertently
when dma_direct_get_required_mask() invokes phys_to_dma_direct().
This results in dma_addressing_limited() return incorrect value
when used in platforms with LPAE enabled.
Fix it here by explicitly type casting 'max_pfn' to phys_addr_t
in order to prevent overflow of intermediate value while evaluating
'(max_pfn - 1) &lt;&lt; PAGE_SHIFT'.

Signed-off-by: Kishon Vijay Abraham I &lt;kishon@ti.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>Merge tag 'dma-mapping-5.7' of git://git.infradead.org/users/hch/dma-mapping</title>
<updated>2020-04-04T17:12:47Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-04-04T17:12:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6f43bae38269a55534e1f86a9917318167de6639'/>
<id>urn:sha1:6f43bae38269a55534e1f86a9917318167de6639</id>
<content type='text'>
Pull dma-mapping updates from Christoph Hellwig:

 - fix an integer overflow in the coherent pool (Kevin Grandemange)

 - provide support for in-place uncached remapping and use that for
   openrisc

 - fix the arm coherent allocator to take the bus limit into account

* tag 'dma-mapping-5.7' of git://git.infradead.org/users/hch/dma-mapping:
  ARM/dma-mapping: merge __dma_supported into arm_dma_supported
  ARM/dma-mapping: take the bus limit into account in __dma_alloc
  ARM/dma-mapping: remove get_coherent_dma_mask
  openrisc: use the generic in-place uncached DMA allocator
  dma-direct: provide a arch_dma_clear_uncached hook
  dma-direct: make uncached_kernel_address more general
  dma-direct: consolidate the error handling in dma_direct_alloc_pages
  dma-direct: remove the cached_kernel_address hook
  dma-coherent: fix integer overflow in the reserved-memory dma allocation
</content>
</entry>
<entry>
<title>dma-mapping: Fix dma_pgprot() for unencrypted coherent pages</title>
<updated>2020-03-17T10:52:58Z</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thellstrom@vmware.com</email>
</author>
<published>2020-03-04T11:45:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=17c4a2ae15a7aaefe84bdb271952678c5c9cd8e1'/>
<id>urn:sha1:17c4a2ae15a7aaefe84bdb271952678c5c9cd8e1</id>
<content type='text'>
When dma_mmap_coherent() sets up a mapping to unencrypted coherent memory
under SEV encryption and sometimes under SME encryption, it will actually
set up an encrypted mapping rather than an unencrypted, causing devices
that DMAs from that memory to read encrypted contents. Fix this.

When force_dma_unencrypted() returns true, the linear kernel map of the
coherent pages have had the encryption bit explicitly cleared and the
page content is unencrypted. Make sure that any additional PTEs we set
up to these pages also have the encryption bit cleared by having
dma_pgprot() return a protection with the encryption bit cleared in this
case.

Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Link: https://lkml.kernel.org/r/20200304114527.3636-3-thomas_os@shipmail.org
</content>
</entry>
<entry>
<title>dma-direct: provide a arch_dma_clear_uncached hook</title>
<updated>2020-03-16T09:48:12Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-02-21T20:35:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=999a5d1203baa7cff00586361feae263ee3f23a5'/>
<id>urn:sha1:999a5d1203baa7cff00586361feae263ee3f23a5</id>
<content type='text'>
This allows the arch code to reset the page tables to cached access when
freeing a dma coherent allocation that was set to uncached using
arch_dma_set_uncached.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
</content>
</entry>
<entry>
<title>dma-direct: make uncached_kernel_address more general</title>
<updated>2020-03-16T09:48:09Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-02-21T23:55:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fa7e2247c5729f990c7456fe09f3af99c8f2571b'/>
<id>urn:sha1:fa7e2247c5729f990c7456fe09f3af99c8f2571b</id>
<content type='text'>
Rename the symbol to arch_dma_set_uncached, and pass a size to it as
well as allow an error return.  That will allow reusing this hook for
in-place pagetable remapping.

As the in-place remap doesn't always require an explicit cache flush,
also detangle ARCH_HAS_DMA_PREP_COHERENT from ARCH_HAS_DMA_SET_UNCACHED.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
</content>
</entry>
<entry>
<title>dma-direct: consolidate the error handling in dma_direct_alloc_pages</title>
<updated>2020-03-16T09:48:06Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-02-21T20:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3d0fc341c4bb66b2c41c0d1ec954a6d300e100b7'/>
<id>urn:sha1:3d0fc341c4bb66b2c41c0d1ec954a6d300e100b7</id>
<content type='text'>
Use a goto label to merge two error return cases.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
</content>
</entry>
<entry>
<title>dma-coherent: fix integer overflow in the reserved-memory dma allocation</title>
<updated>2020-03-16T09:43:02Z</updated>
<author>
<name>Kevin Grandemange</name>
<email>kevin.grandemange@allegrodvt.com</email>
</author>
<published>2020-03-12T15:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=286c21de32b904131f8cf6a36ce40b8b0c9c5da3'/>
<id>urn:sha1:286c21de32b904131f8cf6a36ce40b8b0c9c5da3</id>
<content type='text'>
pageno is an int and the PAGE_SHIFT shift is done on an int,
overflowing if the memory is bigger than 2G

This can be reproduced using for example a reserved-memory of 4G

reserved-memory {
		    #address-cells = &lt;2&gt;;
		    #size-cells = &lt;2&gt;;
		    ranges;

		    reserved_dma: buffer@0 {
		        compatible = "shared-dma-pool";
		        no-map;
		        reg = &lt;0x5 0x00000000 0x1 0x0&gt;;
        };
};

Signed-off-by: Kevin Grandemange &lt;kevin.grandemange@allegrodvt.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-direct: improve DMA mask overflow reporting</title>
<updated>2020-02-05T17:53:41Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-02-03T13:54:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=75467ee48a5e04cf3ae3cb39aea6adee73aeff91'/>
<id>urn:sha1:75467ee48a5e04cf3ae3cb39aea6adee73aeff91</id>
<content type='text'>
Remove the unset dma_mask case as that won't get into mapping calls
anymore, and also report the other errors unconditonally and with a
slightly improved message.  Remove the now pointless report_addr helper.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad@darnok.org&gt;
</content>
</entry>
<entry>
<title>dma-direct: improve swiotlb error reporting</title>
<updated>2020-02-05T17:53:05Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-02-03T13:44:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4a47cbae04844f0c5e2365aa6c217b61850bb832'/>
<id>urn:sha1:4a47cbae04844f0c5e2365aa6c217b61850bb832</id>
<content type='text'>
Untangle the way how dma_direct_map_page calls into swiotlb to be able
to properly report errors where the swiotlb DMA address overflows the
mask separately from overflows in the !swiotlb case.  This means that
siotlb_map now has to do a little more work that duplicates
dma_direct_map_page, but doing so greatly simplifies the calling
convention.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
</feed>
