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

drm/xen: Add missing VM_DONTEXPAND flag in mmap callback

With Xen PV Display driver in use the "expected" VM_DONTEXPAND flag
is not set (neither explicitly nor implicitly), so the driver hits
the code path in drm_gem_mmap_obj() which triggers the WARNING.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Link: https://lore.kernel.org/r/1652104303-5098-1-git-send-email-olekstysh@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Oleksandr Tyshchenko and committed by
Juergen Gross
ca696901 ecb6237f

+1 -1
+1 -1
drivers/gpu/drm/xen/xen_drm_front_gem.c
··· 71 71 * the whole buffer. 72 72 */ 73 73 vma->vm_flags &= ~VM_PFNMAP; 74 - vma->vm_flags |= VM_MIXEDMAP; 74 + vma->vm_flags |= VM_MIXEDMAP | VM_DONTEXPAND; 75 75 vma->vm_pgoff = 0; 76 76 77 77 /*