drm/xen: Add missing VM_DONTEXPAND flag in mmap callback
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Mon, 9 May 2022 13:51:43 +0000 (16:51 +0300)
committerJuergen Gross <jgross@suse.com>
Tue, 21 Jun 2022 14:36:13 +0000 (16:36 +0200)
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>
drivers/gpu/drm/xen/xen_drm_front_gem.c

index 5a5bf4e..e31554d 100644 (file)
@@ -71,7 +71,7 @@ static int xen_drm_front_gem_object_mmap(struct drm_gem_object *gem_obj,
         * the whole buffer.
         */
        vma->vm_flags &= ~VM_PFNMAP;
-       vma->vm_flags |= VM_MIXEDMAP;
+       vma->vm_flags |= VM_MIXEDMAP | VM_DONTEXPAND;
        vma->vm_pgoff = 0;
 
        /*