call trace: WARNING: ttm_bo_vm_open on qemuarm64 when starting X

From: ddu
Date: Mon Jun 17 2019 - 04:11:13 EST


Hi all

When I build linux kernel 5.2-rc5

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tag/?h=v5.2-rc5

After start the X server, a warning call trace appear:

-----------------------------------------------------------------------

[ÂÂ 61.271345] -------------ttm_bo_mmap--------------
[ÂÂ 65.717991] WARNING: CPU: 0 PID: 241 at drivers/gpu/drm/ttm/ttm_bo_vm.c:308 ttm_bo_vm_open+0x44/0x60
[ÂÂ 65.721262] Modules linked in: openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4
[ÂÂ 65.722608] CPU: 0 PID: 241 Comm: X Not tainted 5.2.0-rc4-yoctodev-standard #1
[ÂÂ 65.722902] Hardware name: linux,dummy-virt (DT)
[ÂÂ 65.723491] pstate: 80000005 (Nzcv daif -PAN -UAO)
[ÂÂ 65.723728] pc : ttm_bo_vm_open+0x44/0x60
[ÂÂ 65.723924] lr : dup_mm+0x2b4/0x468
[ÂÂ 65.724112] sp : ffffff801233bbf0
[ÂÂ 65.724301] x29: ffffff801233bbf0 x28: ffffffc0185f0760
[ÂÂ 65.724568] x27: ffffffc0185f03e0 x26: ffffffc01871acf0
[ÂÂ 65.724775] x25: ffffffc01eb67d20 x24: ffffffc01871ad18
[ÂÂ 65.724977] x23: ffffffc01871ac38 x22: 0000000000000000
[ÂÂ 65.725177] x21: ffffffc0185f0380 x20: ffffffc0184e8958
[ÂÂ 65.725412] x19: ffffffc01871acf0 x18: 0000000000000000
[ÂÂ 65.725626] x17: 0000000000000000 x16: 0000000000000000
[ÂÂ 65.725832] x15: 0000000000000000 x14: 0000000000000009
[ÂÂ 65.726040] x13: 0000000000000000 x12: 003d090000000000
[ÂÂ 65.726238] x11: 00001e8480000000 x10: 0000000000000920
[ÂÂ 65.726485] x9 : ffffff801233ba10 x8 : ffffffc018638980
[ÂÂ 65.726704] x7 : 000057e6b8304adc x6 : 0000000000000010
[ÂÂ 65.726909] x5 : 000000001852d100 x4 : ffffff8010c99000
[ÂÂ 65.727119] x3 : ffffffc0185f09d0 x2 : ffffffc01e2cfae0
[ÂÂ 65.727323] x1 : ffffffc01eb67cf0 x0 : ffffffc01dc89c00
[ÂÂ 65.727686] Call trace:
[ÂÂ 65.727972]Â ttm_bo_vm_open+0x44/0x60
[ÂÂ 65.728178]Â dup_mm+0x2b4/0x468
[ÂÂ 65.728331]Â copy_process.isra.0.part.0+0x1130/0x1540
[ÂÂ 65.728522]Â _do_fork+0xe8/0x428
[ÂÂ 65.728674]Â __arm64_sys_clone+0x2c/0x38
[ÂÂ 65.728844]Â el0_svc_common.constprop.0+0x74/0x168
[ÂÂ 65.729024]Â el0_svc_compat_handler+0x2c/0x38
[ÂÂ 65.729192]Â el0_svc_compat+0x8/0x10
[ÂÂ 65.729529] ---[ end trace df1974ac6930916f ]---

-----------------------------------------------------------------------

ttm_bo_vm_open:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/ttm/ttm_bo_vm.c?h=v5.2-rc5#n308

That is to say that:

"bo->bdev->dev_mapping" not equal to "vma->vm_file->f_mapping"

But I am sure the ttm_bo_mmap was initial the vma and bdev in ttm_do_mmap, because I add a printk after

the :

vma->vm_private_data = bo;

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/ttm/ttm_bo_vm.c?h=v5.2-rc5#n458

and it print something, this means that the bo initial correctlly.

My question:

Where maybe change the bo or the vma when starting X server?

//dengke