<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/dma-buf/heaps, branch v6.18.21</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-07-09T10:21:40+00:00</updated>
<entry>
<title>dma-buf: heaps: Give default CMA heap a fixed name</title>
<updated>2025-07-09T10:21:40+00:00</updated>
<author>
<name>Jared Kangas</name>
<email>jkangas@redhat.com</email>
</author>
<published>2025-06-10T13:12:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=854acbe75ff406ea2c72ef3048578dfd99425ba9'/>
<id>urn:sha1:854acbe75ff406ea2c72ef3048578dfd99425ba9</id>
<content type='text'>
The CMA heap's name in devtmpfs can vary depending on how the heap is
defined. Its name defaults to "reserved", but if a CMA area is defined
in the devicetree, the heap takes on the devicetree node's name, such as
"default-pool" or "linux,cma". To simplify naming, unconditionally name
it "default_cma_region", but keep a legacy node in place backed by the
same underlying allocator for backwards compatibility.

Reviewed-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Jared Kangas &lt;jkangas@redhat.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://lore.kernel.org/r/20250610131231.1724627-4-jkangas@redhat.com
</content>
</entry>
<entry>
<title>dma-buf: heaps: Parameterize heap name in __add_cma_heap()</title>
<updated>2025-07-09T10:21:39+00:00</updated>
<author>
<name>Jared Kangas</name>
<email>jkangas@redhat.com</email>
</author>
<published>2025-06-10T13:12:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=86e59cc5069700361041aa5bf536a8a66be6b9ec'/>
<id>urn:sha1:86e59cc5069700361041aa5bf536a8a66be6b9ec</id>
<content type='text'>
Prepare for the introduction of a fixed-name CMA heap by replacing the
unused void pointer parameter in __add_cma_heap() with the heap name.

Reviewed-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Acked-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Jared Kangas &lt;jkangas@redhat.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://lore.kernel.org/r/20250610131231.1724627-3-jkangas@redhat.com
</content>
</entry>
<entry>
<title>dma-buf: system_heap: No separate allocation for attachment sg_tables</title>
<updated>2025-07-09T10:21:39+00:00</updated>
<author>
<name>T.J. Mercier</name>
<email>tjmercier@google.com</email>
</author>
<published>2025-04-17T18:09:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a951020202b88cee91feab00b36946c62e5a71d3'/>
<id>urn:sha1:a951020202b88cee91feab00b36946c62e5a71d3</id>
<content type='text'>
struct dma_heap_attachment is a separate allocation from the struct
sg_table it contains, but there is no reason for this. Let's use the
slab allocator just once instead of twice for dma_heap_attachment.

Signed-off-by: T.J. Mercier &lt;tjmercier@google.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://lore.kernel.org/r/20250417180943.1559755-1-tjmercier@google.com
</content>
</entry>
<entry>
<title>dma-buf: heaps: system: Remove global variable</title>
<updated>2025-04-08T09:48:39+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2025-04-07T16:29:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=92a2bf257ec4729d13ed17f5b04192ad8e3b7024'/>
<id>urn:sha1:92a2bf257ec4729d13ed17f5b04192ad8e3b7024</id>
<content type='text'>
The system heap is storing its struct dma_heap pointer in a global
variable but isn't using it anywhere.

Let's move the global variable into system_heap_create() to make it
local.

Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250407-dma-buf-ecc-heap-v3-1-97cdd36a5f29@kernel.org
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-buf/heaps: replace kmap_atomic with kmap_local_page</title>
<updated>2024-10-14T14:46:03+00:00</updated>
<author>
<name>Pintu Kumar</name>
<email>quic_pintu@quicinc.com</email>
</author>
<published>2024-10-01T17:50:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a1cb63bf321c1e498d3f19a6049e56838b18f82'/>
<id>urn:sha1:4a1cb63bf321c1e498d3f19a6049e56838b18f82</id>
<content type='text'>
Use of kmap_atomic/kunmap_atomic is deprecated, use
kmap_local_page/kunmap_local instead.

This is reported by checkpatch.
Also fix repeated word issue.

WARNING: Deprecated use of 'kmap_atomic', prefer 'kmap_local_page' instead
+                       void *vaddr = kmap_atomic(page);

WARNING: Deprecated use of 'kunmap_atomic', prefer 'kunmap_local' instead
+                       kunmap_atomic(vaddr);

WARNING: Possible repeated word: 'by'
+                        * has been killed by by SIGKILL

total: 0 errors, 3 warnings, 405 lines checked

Signed-off-by: Pintu Kumar &lt;quic_pintu@quicinc.com&gt;
Reviewed-by: T.J. Mercier &lt;tjmercier@google.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241001175057.27172-1-quic_pintu@quicinc.com
</content>
</entry>
<entry>
<title>Merge drm/drm-next into drm-misc-next</title>
<updated>2024-09-30T08:50:54+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2024-09-30T08:50:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2dd0ef5d951e9b565ddb324fe26c531b6a40bf82'/>
<id>urn:sha1:2dd0ef5d951e9b565ddb324fe26c531b6a40bf82</id>
<content type='text'>
Get drm-misc-next to up v6.12-rc1.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
</content>
</entry>
<entry>
<title>dma-buf: heaps: Add __init to CMA and system heap module_init functions</title>
<updated>2024-09-09T10:21:54+00:00</updated>
<author>
<name>T.J. Mercier</name>
<email>tjmercier@google.com</email>
</author>
<published>2024-09-06T00:03:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7a4fe6525450eb950de040336de996775e40176e'/>
<id>urn:sha1:7a4fe6525450eb950de040336de996775e40176e</id>
<content type='text'>
Shrink the kernel .text a bit after successful initialization of the
heaps.

Signed-off-by: T.J. Mercier &lt;tjmercier@google.com&gt;
Acked-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240906000314.2368749-1-tjmercier@google.com
</content>
</entry>
<entry>
<title>dma-buf: heaps: Fix off-by-one in CMA heap fault handler</title>
<updated>2024-09-09T10:07:20+00:00</updated>
<author>
<name>T.J. Mercier</name>
<email>tjmercier@google.com</email>
</author>
<published>2024-08-30T19:26:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ea5ff5d351b520524019f7ff7f9ce418de2dad87'/>
<id>urn:sha1:ea5ff5d351b520524019f7ff7f9ce418de2dad87</id>
<content type='text'>
Until VM_DONTEXPAND was added in commit 1c1914d6e8c6 ("dma-buf: heaps:
Don't track CMA dma-buf pages under RssFile") it was possible to obtain
a mapping larger than the buffer size via mremap and bypass the overflow
check in dma_buf_mmap_internal. When using such a mapping to attempt to
fault past the end of the buffer, the CMA heap fault handler also checks
the fault offset against the buffer size, but gets the boundary wrong by
1. Fix the boundary check so that we don't read off the end of the pages
array and insert an arbitrary page in the mapping.

Reported-by: Xingyu Jin &lt;xingyuj@google.com&gt;
Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementation")
Cc: stable@vger.kernel.org # Applicable &gt;= 5.10. Needs adjustments only for 5.10.
Signed-off-by: T.J. Mercier &lt;tjmercier@google.com&gt;
Acked-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240830192627.2546033-1-tjmercier@google.com
</content>
</entry>
<entry>
<title>dma-buf/heaps: Correct the types of fd_flags and heap_flags</title>
<updated>2024-06-19T14:35:34+00:00</updated>
<author>
<name>Barry Song</name>
<email>v-songbaohua@oppo.com</email>
</author>
<published>2024-06-06T02:02:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b9578c49456340ca4d3c7ddbaca054ffc2b51bc1'/>
<id>urn:sha1:b9578c49456340ca4d3c7ddbaca054ffc2b51bc1</id>
<content type='text'>
dma_heap_allocation_data defines the UAPI as follows:

 struct dma_heap_allocation_data {
        __u64 len;
        __u32 fd;
        __u32 fd_flags;
        __u64 heap_flags;
 };

But dma heaps are casting both fd_flags and heap_flags into
unsigned long. This patch makes dma heaps - cma heap and
system heap have consistent types with UAPI.

Signed-off-by: Barry Song &lt;v-songbaohua@oppo.com&gt;
Acked-by: John Stultz &lt;jstultz@google.com&gt;
Reviewed-by: Carlos Llamas &lt;cmllamas@google.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240606020213.49854-1-21cnbao@gmail.com
</content>
</entry>
<entry>
<title>dma-buf: heaps: Don't track CMA dma-buf pages under RssFile</title>
<updated>2024-01-31T14:24:58+00:00</updated>
<author>
<name>T.J. Mercier</name>
<email>tjmercier@google.com</email>
</author>
<published>2024-01-17T18:11:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1c1914d6e8c6edbf5b45047419ff51abdb1dce96'/>
<id>urn:sha1:1c1914d6e8c6edbf5b45047419ff51abdb1dce96</id>
<content type='text'>
DMA buffers allocated from the CMA dma-buf heap get counted under
RssFile for processes that map them and trigger page faults. In
addition to the incorrect accounting reported to userspace, reclaim
behavior was influenced by the MM_FILEPAGES counter until linux 6.8, but
this memory is not reclaimable. [1] Change the CMA dma-buf heap to set
VM_PFNMAP on the VMA so MM does not poke at the memory managed by this
dma-buf heap, and use vmf_insert_pfn to correct the RSS accounting.

The system dma-buf heap does not suffer from this issue since
remap_pfn_range is used during the mmap of the buffer, which also sets
VM_PFNMAP on the VMA.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/mm/vmscan.c?id=fb46e22a9e3863e08aef8815df9f17d0f4b9aede

Fixes: b61614ec318a ("dma-buf: heaps: Add CMA heap to dmabuf heaps")
Signed-off-by: T.J. Mercier &lt;tjmercier@google.com&gt;
Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240117181141.286383-1-tjmercier@google.com
</content>
</entry>
</feed>
