Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/gem-dma: set VM_DONTDUMP for mmap

When the mmap function was converted from a file op to a GEM object
function in commit f5ca8eb6f9bd ("drm/cma-helper: Implement mmap as GEM
CMA object functions") some VM flags were not lifted from drm_gem_mmap():

- VM_IO
- VM_DONTEXPAND
- VM_DONTDUMP

VM_DONTEXPAND was added back in commit 59f39bfa6553 ("drm/cma-helper:
Set VM_DONTEXPAND for mmap"). VM_IO doesn't make sense since these are
memory buffers, while "IO tells people not to look at these pages
(accesses can have side effects)".

Add back VM_DONTDUMP. This matches the behavior of most other GEM
implementations.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260317040034.617585-1-wenst@chromium.org
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

+1 -1
+1 -1
drivers/gpu/drm/drm_gem_dma_helper.c
··· 537 537 * the whole buffer. 538 538 */ 539 539 vma->vm_pgoff -= drm_vma_node_start(&obj->vma_node); 540 - vm_flags_mod(vma, VM_DONTEXPAND, VM_PFNMAP); 540 + vm_flags_mod(vma, VM_DONTDUMP | VM_DONTEXPAND, VM_PFNMAP); 541 541 542 542 if (dma_obj->map_noncoherent) { 543 543 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);