<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/dma/direct.c, branch v5.17</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.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-12-08T15:46:35Z</updated>
<entry>
<title>dma-direct: add a dma_direct_use_pool helper</title>
<updated>2021-12-08T15:46:35Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-11-09T14:50:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28e4576d556bca543b0996e9edd4b767397e24c6'/>
<id>urn:sha1:28e4576d556bca543b0996e9edd4b767397e24c6</id>
<content type='text'>
Add a helper to check if a potentially blocking operation should
dip into the atomic pools.

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: factor the swiotlb code out of __dma_direct_alloc_pages</title>
<updated>2021-12-07T11:50:10Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-10-21T07:39:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aea7e2a86a94b2583e1e812c596140034398a169'/>
<id>urn:sha1:aea7e2a86a94b2583e1e812c596140034398a169</id>
<content type='text'>
Add a new helper to deal with the swiotlb case.  This keeps the code
nicely boundled and removes the not required call to
dma_direct_optimal_gfp_mask for the swiotlb case.

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: drop two CONFIG_DMA_RESTRICTED_POOL conditionals</title>
<updated>2021-12-07T11:50:10Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-10-21T07:34:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5d3939a5916c0a8a0b47dcbc33963dbffe74f90'/>
<id>urn:sha1:f5d3939a5916c0a8a0b47dcbc33963dbffe74f90</id>
<content type='text'>
swiotlb_alloc and swiotlb_free are properly stubbed out if
CONFIG_DMA_RESTRICTED_POOL is not set, so skip the extra checks.

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: warn if there is no pool for force unencrypted allocations</title>
<updated>2021-12-07T11:50:10Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-10-21T08:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=78bc72787ab9e638173aeb1f589578105d3a43c9'/>
<id>urn:sha1:78bc72787ab9e638173aeb1f589578105d3a43c9</id>
<content type='text'>
Instead of blindly running into a blocking operation for a non-blocking gfp,
return NULL and spew an error.  Note that Kconfig prevents this for all
currently relevant platforms, and this is just a debug check.

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: fail allocations that can't be made coherent</title>
<updated>2021-12-07T11:50:06Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-11-09T14:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=955f58f7406ad912825fc344c7825fd904b124a0'/>
<id>urn:sha1:955f58f7406ad912825fc344c7825fd904b124a0</id>
<content type='text'>
If the architecture can't remap or set an address uncached there is no way
to fullfill a request for a coherent allocation.  Return NULL in that case.
Note that this case currently does not happen, so this is a theoretical
fixup and/or a preparation for eventually supporting platforms that
can't support coherent allocations with the generic code.

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: refactor the !coherent checks in dma_direct_alloc</title>
<updated>2021-12-07T11:49:57Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-10-21T07:47:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a86d10942db2e0099a369b367fe62898f95987a8'/>
<id>urn:sha1:a86d10942db2e0099a369b367fe62898f95987a8</id>
<content type='text'>
Add a big central !dev_is_dma_coherent(dev) block to deal with as much
as of the uncached allocation schemes and document the schemes a bit
better.

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: factor out a helper for DMA_ATTR_NO_KERNEL_MAPPING allocations</title>
<updated>2021-12-07T11:49:50Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-10-18T11:08:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d541ae55d538265861ef729a64d2d816d34ef1e2'/>
<id>urn:sha1:d541ae55d538265861ef729a64d2d816d34ef1e2</id>
<content type='text'>
Split the code for DMA_ATTR_NO_KERNEL_MAPPING allocations into a separate
helper to make dma_direct_alloc a little more readable.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
</content>
</entry>
<entry>
<title>dma-direct: clean up the remapping checks in dma_direct_alloc</title>
<updated>2021-12-07T11:48:09Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-11-09T14:20:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f3c962226dbec7a611ddd4eb7af7f4e19f4790ea'/>
<id>urn:sha1:f3c962226dbec7a611ddd4eb7af7f4e19f4790ea</id>
<content type='text'>
Add two local variables to track if we want to remap the returned
address using vmap or call dma_set_uncached and use that to simplify
the code flow.

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: always leak memory that can't be re-encrypted</title>
<updated>2021-12-07T11:47:38Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-11-09T14:41:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a90cf30437489343b8386ae87b4827b6d6c3ed50'/>
<id>urn:sha1:a90cf30437489343b8386ae87b4827b6d6c3ed50</id>
<content type='text'>
We must never let unencrypted memory go back into the general page pool.
So if we fail to set it back to encrypted when freeing DMA memory, leak
the memory instead and warn the user.

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: don't call dma_set_decrypted for remapped allocations</title>
<updated>2021-12-07T11:47:06Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-10-21T07:20:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5570449b6876f215d49ac4db9ccce6ff7aa1e20a'/>
<id>urn:sha1:5570449b6876f215d49ac4db9ccce6ff7aa1e20a</id>
<content type='text'>
Remapped allocations handle the encrypted bit through the pgprot passed
to vmap, so there is no call dma_set_decrypted.  Note that this case is
currently entirely theoretical as no valid kernel configuration supports
remapped allocations and memory encryption currently.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
