[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] drm/xen: Add missing VM_DONTEXPAND flag in mmap callback


  • To: Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "dri-devel@xxxxxxxxxxxxxxxxxxxxx" <dri-devel@xxxxxxxxxxxxxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Sun, 19 Jun 2022 10:15:05 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hGplq3oWsFAAVCxUacIORBzHw9VJIgU9kEPa/BQeFh0=; b=keU4dGhDX9/MM+WISXLck9f7/OPDUf4bhS2WXHtArRhT/qmpnNstCFXHFle3VQc+2cxtq/AE6qV7Ld4WFTbQNkwHG9xlpdUW02kBPQg7rmYGNYQI5BtiHrGWNBprC2emj3Uvnt1Z+GS01eAnVx+f+y4UmNTHj8luFSbyPWLHKCIK1fG1nGl5XcaaH/v8UL0PG2wjXxM8+d4NYoq8DYOAq/8WPucaRlUkwqWWrKoHrisdMQvZhHdXmhu6GwFJSx6sdVrXcMgYr7ZlbbSgh/vCVC7uYKdVp54WKWjztLnUpsNIPNBjTcuaiI+2f4rnS+pc1sGj7CQ9Y4kle98PuqLKDA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J/zMXplcHDNiIX8lvGo4dzWeCGOXD7Ngd7AJbOSTF1mvmMeRb8UbzkSOeSwA5xOIOSh7+NO06oy8RpODq6h6H6UFqTVQsyE88XWlRntieQ6p5Y7MV9dhV4hwCjVv9rnENdsjYde9BK5fJymbwY3BDIVVCflvixnFPaKv9QlsejSG9HShPcYMxwhLOwSE6XRhYYsoYWseHSZSMKnrAccLvZZwQznVJdVhwwzyk9wO6WXnTln9J5sUb6xl5FplnjVySquE9WlOKo6TzHc+35+oDxt3jm6ny5RuEHUvd0zkSs8zCTqVEq5xqYfDQfcf6VsTHxBXf5kIkhFcL5jdaYYC/A==
  • Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, David Airlie <airlied@xxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Sun, 19 Jun 2022 10:15:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYY6v/wU3gEIzWM0yI8demCauBeq1Ww4oA
  • Thread-topic: [PATCH] drm/xen: Add missing VM_DONTEXPAND flag in mmap callback

Hi, Oleksandr!

On 09.05.22 16:51, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
>
> 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@xxxxxxxx>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>

> ---
> This patch eliminates a WARNING which occurs during running any user space
> application over drm (weston, modetest, etc) using PV Display frontend
> in Xen guest (it worth mentioning the frontend still works despite the 
> WARNING):
>
> root@salvator-x-h3-4x2g-xt-domu:~# modetest -M xendrm-du -s 31:1920x1080
> (XEN) common/grant_table.c:1882:d2v0 Expanding d2 grant table from 5 to 9 
> frames
> [   31.566759] ------------[ cut here ]------------
> [   31.566811] WARNING: CPU: 0 PID: 235 at drivers/gpu/drm/drm_gem.c:1055 
> drm_gem_mmap_obj+0x16c/0x180
> [   31.566864] Modules linked in:
> [   31.566886] CPU: 0 PID: 235 Comm: modetest Not tainted 
> 5.18.0-rc4-yocto-standard-00009-gabe87d78bbc9 #1
> [   31.566922] Hardware name: XENVM-4.17 (DT)
> [   31.566940] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [   31.566973] pc : drm_gem_mmap_obj+0x16c/0x180
> [   31.567001] lr : drm_gem_mmap_obj+0x78/0x180
> [   31.567026] sp : ffff800009d03bb0
> [   31.567044] x29: ffff800009d03bb0 x28: 0000000000000008 x27: 
> ffff0001c42d43c0
> [   31.567080] x26: ffff0001c42d4cc0 x25: 00000000000007e9 x24: 
> ffff0001c0136000
> [   31.567116] x23: ffff0001c0310000 x22: ffff0001c4002b80 x21: 
> 0000000000000000
> [   31.567150] x20: ffff0001c42d43c0 x19: ffff0001c0137600 x18: 
> 0000000000000001
> [   31.567186] x17: 0000000000000000 x16: 0000000000000000 x15: 
> 0000000000035c81
> [   31.567220] x14: 0000000000000000 x13: 0000000000000000 x12: 
> 0000000000000000
> [   31.567258] x11: 0000000000100000 x10: 0000ffff95d69000 x9 : 
> ffff0001c435ac30
> [   31.567294] x8 : ffff8001f65ce000 x7 : 0000000000000001 x6 : 
> ffff0001c24de000
> [   31.567329] x5 : ffff800009d03a10 x4 : 0000000000000090 x3 : 
> 0000000010046400
> [   31.567365] x2 : 00000000000007e9 x1 : 9dd8cb7c02b1bd00 x0 : 
> 00000000100000fb
> [   31.567401] Call trace:
> [   31.567415]  drm_gem_mmap_obj+0x16c/0x180
> [   31.567439]  drm_gem_mmap+0x128/0x228
> [   31.567460]  mmap_region+0x384/0x5a0
> [   31.567484]  do_mmap+0x354/0x4f0
> [   31.567505]  vm_mmap_pgoff+0xdc/0x108
> [   31.567529]  ksys_mmap_pgoff+0x1b8/0x208
> [   31.567550]  __arm64_sys_mmap+0x30/0x48
> [   31.567576]  invoke_syscall+0x44/0x108
> [   31.567599]  el0_svc_common.constprop.0+0xcc/0xf0
> [   31.567629]  do_el0_svc+0x24/0x88
> [   31.567649]  el0_svc+0x2c/0x88
> [   31.567686]  el0t_64_sync_handler+0xb0/0xb8
> [   31.567708]  el0t_64_sync+0x18c/0x190
> [   31.567731] ---[ end trace 0000000000000000 ]---
> setting mode 1920x1080-60.00Hz@XR24 on connectors 31, crtc 34
> ---
>   drivers/gpu/drm/xen/xen_drm_front_gem.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c 
> b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> index 5a5bf4e..e31554d 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c
> +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> @@ -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;
>   
>       /*

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.