<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/lib/dma-direct.c, branch dev-4.17</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.17</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.17'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2018-08-03T05:47:55+00:00</updated>
<entry>
<title>dma-direct: try reallocation with GFP_DMA32 if possible</title>
<updated>2018-08-03T05:47:55+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2018-04-16T15:18:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=833e3bd59dcc143c0879af3f70ca35538f1ac8a5'/>
<id>urn:sha1:833e3bd59dcc143c0879af3f70ca35538f1ac8a5</id>
<content type='text'>
[ Upstream commit de7eab301de78869322104ea13e124c936ad3e1f ]

As the recent swiotlb bug revealed, we seem to have given up the direct
DMA allocation too early and felt back to swiotlb allocation.  The reason
is that swiotlb allocator expected that dma_direct_alloc() would try
harder to get pages even below 64bit DMA mask with GFP_DMA32, but the
function doesn't do that but only deals with GFP_DMA case.

This patch adds a similar fallback reallocation with GFP_DMA32 as we've
done with GFP_DMA.  The condition is that the coherent mask is smaller
than 64bit (i.e. some address limitation), and neither GFP_DMA nor
GFP_DMA32 is set beforehand.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>dma-direct: don't retry allocation for no-op GFP_DMA</title>
<updated>2018-04-23T12:43:27+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2018-04-15T09:08:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=504a918e6714b551b7b39940dbab32610fafa1fe'/>
<id>urn:sha1:504a918e6714b551b7b39940dbab32610fafa1fe</id>
<content type='text'>
When an allocation with lower dma_coherent mask fails, dma_direct_alloc()
retries the allocation with GFP_DMA.  But, this is useless for
architectures that hav no ZONE_DMA.

Fix it by adding the check of CONFIG_ZONE_DMA before retrying the
allocation.

Fixes: 95f183916d4b ("dma-direct: retry allocations using GFP_DMA for small masks")
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: Don't clear GFP_ZERO in dma_alloc_attrs</title>
<updated>2018-03-28T15:34:23+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-03-28T13:35:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e89f5b37015309a8bdf0b21d08007580b92f92a4'/>
<id>urn:sha1:e89f5b37015309a8bdf0b21d08007580b92f92a4</id>
<content type='text'>
Revert the clearing of __GFP_ZERO in dma_alloc_attrs and move it to
dma_direct_alloc for now.  While most common architectures always zero dma
cohereny allocations (and x86 did so since day one) this is not documented
and at least arc and s390 do not zero without the explicit __GFP_ZERO
argument.

Fixes: 57bf5a8963f8 ("dma-mapping: clear harmful GFP_* flags in common code")
Reported-by: Evgeniy Didin &lt;Evgeniy.Didin@synopsys.com&gt;
Reported-by: Sebastian Ott &lt;sebott@linux.vnet.ibm.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Evgeniy Didin &lt;Evgeniy.Didin@synopsys.com&gt;
Cc: iommu@lists.linux-foundation.org
Link: https://lkml.kernel.org/r/20180328133535.17302-2-hch@lst.de

</content>
</entry>
<entry>
<title>dma/direct: Handle force decryption for DMA coherent buffers in common code</title>
<updated>2018-03-20T09:01:59+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-03-19T10:38:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c10f07aa27dadf5ab5b3d58c48c91a467f80db49'/>
<id>urn:sha1:c10f07aa27dadf5ab5b3d58c48c91a467f80db49</id>
<content type='text'>
With that in place the generic DMA-direct routines can be used to
allocate non-encrypted bounce buffers, and the x86 SEV case can use
the generic swiotlb ops including nice features such as using CMA
allocations.

Note that I'm not too happy about using sev_active() in DMA-direct, but
I couldn't come up with a good enough name for a wrapper to make it
worth adding.

Tested-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Joerg Roedel &lt;joro@8bytes.org&gt;
Cc: Jon Mason &lt;jdmason@kudzu.us&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Muli Ben-Yehuda &lt;mulix@mulix.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: iommu@lists.linux-foundation.org
Link: http://lkml.kernel.org/r/20180319103826.12853-14-hch@lst.de
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>dma-direct: comment the dma_direct_free calling convention</title>
<updated>2018-02-12T15:59:07+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-02-02T08:51:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=42ed64524d846b96afaa8b3f9ba045bcaf11ab0f'/>
<id>urn:sha1:42ed64524d846b96afaa8b3f9ba045bcaf11ab0f</id>
<content type='text'>
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-direct: mark as is_phys</title>
<updated>2018-02-12T15:59:06+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-02-02T08:21:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=f25e6f6b4eae7e25e92e91a570cae84bf83e751a'/>
<id>urn:sha1:f25e6f6b4eae7e25e92e91a570cae84bf83e751a</id>
<content type='text'>
Various PCI_DMA_BUS_IS_PHYS implementations rely on this flag to make proper
decisions for block and networking addressability.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-direct: reject too small dma masks</title>
<updated>2018-01-15T08:35:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2017-12-24T14:04:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=1a9777a8a01fb88659a3dda48080c95c34cab7d3'/>
<id>urn:sha1:1a9777a8a01fb88659a3dda48080c95c34cab7d3</id>
<content type='text'>
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 dma_direct_{alloc,free} available to other implementations</title>
<updated>2018-01-15T08:35:14+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2017-12-23T12:46:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=19dca8c0efa30e0a45e79f237060d0f307045752'/>
<id>urn:sha1:19dca8c0efa30e0a45e79f237060d0f307045752</id>
<content type='text'>
So that they don't need to indirect through the operation vector.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Vladimir Murzin &lt;vladimir.murzin@arm.com&gt;
</content>
</entry>
<entry>
<title>dma-direct: retry allocations using GFP_DMA for small masks</title>
<updated>2018-01-15T08:35:13+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-01-09T22:40:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=95f183916d4b0bc1943684948ecdd2469f1aa978'/>
<id>urn:sha1:95f183916d4b0bc1943684948ecdd2469f1aa978</id>
<content type='text'>
If an attempt to allocate memory succeeded, but isn't inside the
supported DMA mask, retry the allocation with GFP_DMA set as a
last resort.

Based on the x86 code, but an off by one error in what is now
dma_coherent_ok has been fixed vs the x86 code.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-direct: add support for allocation from ZONE_DMA and ZONE_DMA32</title>
<updated>2018-01-15T08:35:12+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-01-09T22:39:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c61e9637340e1d0672c6f0c0b11aa81d7262c49d'/>
<id>urn:sha1:c61e9637340e1d0672c6f0c0b11aa81d7262c49d</id>
<content type='text'>
This allows to dip into zones for lower memory if they are available.
If one of the zones is not available the corresponding GFP_* flag
will evaluate to 0 so they won't change anything.  We provide an
arch tunable for those architectures that do not use GFP_DMA for
the lowest 24-bits, given that there are a few.

Roughly based on the x86 code.

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