FreeBSDDesktop / kms-drm

the DRM part of the linuxkpi-based KMS
63 stars 26 forks source link

linux_wait_event_common panic with drm-next-kmod-4.11.g20180505_1 #79

Open drscream opened 6 years ago

drscream commented 6 years ago

Using vm-bhyve with SSH X forwarding and starting of an X application (in the virtual machine) result in kernel panic. If I do the same X forwarding on an machine without the kms-drm driver it works without any problem.

FreeBSD version: FreeBSD havanna 12.0-CURRENT FreeBSD 12.0-CURRENT #0 fa09e6dd120(master): Sun Jun 3 23:01:27 CEST 2018 root@havanna:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

kms-drm version: drm-next-kmod-4.11.g20180505_1

The drm-next-kmod version has been build with the ports. I'm not sure if I'm able to upgrade to the newer 4.15 version or if that would make any difference.

trace:

#0  __curthread () at ./machine/pcpu.h:231
#1  doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:366
#2  0xffffffff80b84cb2 in kern_reboot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:446
#3  0xffffffff80b85293 in vpanic (fmt=<optimized out>, ap=0xfffffe008e58bad0)
    at /usr/src/sys/kern/kern_shutdown.c:863
#4  0xffffffff80b852e3 in panic (fmt=<unavailable>) at /usr/src/sys/kern/kern_shutdown.c:790
#5  0xffffffff80b90876 in kdb_switch () at /usr/src/sys/kern/kern_synch.c:377
#6  0xffffffff80b907ad in mi_switch (flags=260, newtd=0x0) at /usr/src/sys/kern/kern_synch.c:406
#7  0xffffffff80bdcd2d in sleepq_switch (wchan=0xfffff800052a0080, pri=0)
    at /usr/src/sys/kern/subr_sleepqueue.c:613
#8  0xffffffff80bdd480 in sleepq_timedwait (wchan=0xfffff800052a0080, pri=0)
    at /usr/src/sys/kern/subr_sleepqueue.c:727
#9  0xffffffff831ea99d in linux_add_to_sleepqueue (wchan=<optimized out>, task=0xfffff800052a0080,
    wmesg=<optimized out>, timeout=50, state=<optimized out>)
    at /usr/src/sys/compat/linuxkpi/common/src/linux_schedule.c:70
#10 0xffffffff831ea769 in linux_wait_event_common (wqh=<optimized out>, wq=<optimized out>, timeout=50, state=2,
    lock=0x0) at /usr/src/sys/compat/linuxkpi/common/src/linux_schedule.c:270
#11 0xffffffff8301e395 in ?? ()
#12 0xfffff8000b7a2000 in ?? ()
#13 0xfffff8000b7a2000 in ?? ()
#14 0xfffffe008d324000 in ?? ()
#15 0xfffff80014e92000 in ?? ()
#16 0xfffffe008e58bd10 in ?? ()
#17 0x0000000283016885 in ?? ()
#18 0x0000000000000000 in ?? ()
drscream commented 6 years ago

I've also tested the latest available version.

FreeBSD version: FreeBSD havanna 12.0-CURRENT FreeBSD 12.0-CURRENT #0 ce93b4cba0b(master): Tue Jun 12 15:14:48 CEST 2018 root@havanna:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

kms-drm version: drm-next-kmod-4.15.g20180611 / 224e101

trace:

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0x528
fault code              = supervisor read data, page not present
instruction pointer     = 0x20:0xffffffff83212f02
stack pointer           = 0x28:0xfffffe009356f530
frame pointer           = 0x28:0xfffffe009356f570
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 93804 (ssh)
Uptime: 3m56s
Dumping 941 out of 16084 MB:..2%..11%..21%..31%..41%..52%..62%..72%..82%..91%

__curthread () at ./machine/pcpu.h:231
231             __asm("movq %%gs:%1,%0" : "=r" (td)
(kgdb) bt
#0  __curthread () at ./machine/pcpu.h:231
#1  doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:366
#2  0xffffffff80b84df2 in kern_reboot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:446
#3  0xffffffff80b853d3 in vpanic (fmt=<optimized out>, ap=0xfffffe009356e9a0) at /usr/src/sys/kern/kern_shutdown.c:863
#4  0xffffffff80b85423 in panic (fmt=<unavailable>) at /usr/src/sys/kern/kern_shutdown.c:790
#5  0xffffffff80b90966 in kdb_switch () at /usr/src/sys/kern/kern_synch.c:377
#6  0xffffffff80b9089d in mi_switch (flags=260, newtd=0x0) at /usr/src/sys/kern/kern_synch.c:406
#7  0xffffffff80bdce1d in sleepq_switch (wchan=0xfffff800197b3d80, pri=0) at /usr/src/sys/kern/subr_sleepqueue.c:613
#8  0xffffffff80bdd570 in sleepq_timedwait (wchan=0xfffff800197b3d80, pri=0) at /usr/src/sys/kern/subr_sleepqueue.c:727
#9  0xffffffff8321ba0d in linux_add_to_sleepqueue (wchan=<optimized out>, task=0xfffff800197b3d80, wmesg=<optimized out>, timeout=100, state
#10 0xffffffff8321b7d9 in linux_wait_event_common (wqh=<optimized out>, wq=<optimized out>, timeout=100, state=2, lock=0x0) at /usr/src/sys/
#11 0xffffffff831ce01f in ?? ()
#12 0xfffff80150699800 in ?? ()
#13 0xfffff800197ab800 in ?? ()
#14 0xfffffe009356ebd0 in ?? ()
#15 0xffffffff8314e663 in drm_ioctls () from /boot/kernel/drm.ko
#16 0xfffffe009356ebe0 in ?? ()
#17 0x0000000200000001 in ?? ()
#18 0x0000000000000000 in ?? ()
valpackett commented 6 years ago

drm_ioctls () from /boot/kernel/drm.ko

Hmmmmm. Seems like you're not actually using drm-next-kmod. drm-next-kmod installs to /boot/modules. The drm in /boot/kernel (base system) is the old one.

Make sure you follow the instructions correctly.

valpackett commented 6 years ago

(The trace in the original post was using LinuxKPI, so that one was 4.11, but the new one doesn't look like 4.15...)

drscream commented 6 years ago

Maybe I posted the wrong dump so sorry for that. Now I also see the module loaded:

10 1 0xffffffff82f3d000 201d90 i915kms.ko

Fatal trap 12: page fault while in kernel mode
cpuid = 6; apic id = 06
fault virtual address   = 0x528
fault code              = supervisor read data, page not present
instruction pointer     = 0x20:0xffffffff83212f02
stack pointer           = 0x28:0xfffffe009535b530
frame pointer           = 0x28:0xfffffe009535b570
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 31909 (ssh)
Uptime: 1m24s
Dumping 935 out of 16084 MB:..2%..11%..21%..31%..42%..52%..62%..71%..81%..91%

__curthread () at ./machine/pcpu.h:231
231             __asm("movq %%gs:%1,%0" : "=r" (td)
(kgdb) bt
#0  __curthread () at ./machine/pcpu.h:231
#1  doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:366
#2  0xffffffff80b84df2 in kern_reboot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:446
#3  0xffffffff80b853d3 in vpanic (fmt=<optimized out>, ap=0xfffffe009535abd0) at /usr/src/sys/kern/kern_shutdown.c:863
#4  0xffffffff80b85423 in panic (fmt=<unavailable>) at /usr/src/sys/kern/kern_shutdown.c:790
#5  0xffffffff80b90966 in kdb_switch () at /usr/src/sys/kern/kern_synch.c:377
#6  0xffffffff80b9089d in mi_switch (flags=260, newtd=0x0) at /usr/src/sys/kern/kern_synch.c:406
#7  0xffffffff80bdce1d in sleepq_switch (wchan=0xfffff800313c37cc, pri=0) at /usr/src/sys/kern/subr_sleepqueue.c:613
#8  0xffffffff80bdd570 in sleepq_timedwait (wchan=0xfffff800313c37cc, pri=0) at /usr/src/sys/kern/subr_sleepqueue.c:727
#9  0xffffffff8321414a in linux_wait_for_timeout_common (c=0xfffff800313c37cc, timeout=2146977404, flags=0) at /usr/src/sys/compat/linuxkpi/
#10 0xffffffff8314b91f in drm_mmap (kdev=<optimized out>, offset=-2119230152, paddr=<optimized out>, prot=<optimized out>, memattr=<optimize
#11 0xffffffff8302edd0 in ?? ()
#12 0xfffff800058d4300 in ?? ()
#13 0xfffffe00921b3ff0 in ?? ()
#14 0x000000003b8e2f90 in ?? ()
#15 0xffffffff81af1bd0 in M_VT_uninit_sys_uninit ()
#16 0xffffffff81ed4900 in kdb_jmpbufp ()
#17 0x000000000a167200 in ?? ()
#18 0x0000000000000018 in ?? ()
#19 0xffffffff81af1d38 in main_vd ()
#20 0xfffffe009535ae00 in ?? ()
#21 0xffffffff8302e629 in ?? ()
#22 0x000001000135adc0 in ?? ()
#23 0x0000000100000000 in ?? ()
#24 0xfffffe00921b3ff0 in ?? ()
#25 0xfffff8013b8e2c00 in ?? ()
#26 0xfffff8013b8e2f50 in ?? ()
#27 0xfffff8013b8e2c00 in ?? ()
#28 0x000000012893da84 in ?? ()
#29 0xfffff8013b8e2f50 in ?? ()
#30 0xfffffe009535ae30 in ?? ()
#31 0xffffffff82fcf027 in ?? ()
#32 0xffffffff8302e570 in ?? ()
#33 0xffffffff8302e570 in ?? ()
#34 0x0000000100000000 in ?? ()
#35 0xfffff8013b8e2f50 in ?? ()
#36 0xfffff8013035f000 in ?? ()
#37 0xfffff8013035f000 in ?? ()
#38 0xfffff8001d1ba800 in ?? ()
#39 0xfffff8001d1ba800 in ?? ()
#40 0xfffff8001d1ba800 in ?? ()
#41 0x0000000300000000 in ?? ()
#42 0x0000000000000000 in ?? ()
drscream commented 6 years ago

If this bug should be reported to bugs.freebsd.org let me know as well please.

kirillrdy commented 5 years ago

I have same issue

FreeBSD 12.0-RELEASE-p3 GENERIC  amd64
drm-fbsd12.0-kmod-4.16.g20190305

Although my computer resets before I get to see stacktrace, but same steps, to reproduce x forwardging from bhyved linux vm

johalun commented 5 years ago

Thanks for the report. I'll try to reproduce it on my machine.