vtterm_cngrab + kms does too much to be useful

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Mon, 15 Aug 2016 16:54:33 +0300
Here is an example:

NMI ISA 2c, EISA ff
NMI ... going to debugger

panic: malloc: called with spinlock or critical section held

(kgdb) bt
#0  doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:297
#1  0xffffffff8063c33f in kern_reboot (howto=<optimized out>) at
/usr/src/sys/kern/kern_shutdown.c:365
#2  0xffffffff8063c988 in vpanic (fmt=<optimized out>, ap=0xfffffe03e218cac0) at
/usr/src/sys/kern/kern_shutdown.c:641
#3  0xffffffff8063c693 in panic (fmt=<unavailable>) at
/usr/src/sys/kern/kern_shutdown.c:574
#4  0xffffffff8061abaa in malloc (size=5136, mtp=0xffffffff821b2810
<DRM_MEM_KMS>, flags=257) at /usr/src/sys/kern/kern_malloc.c:475
#5  0xffffffff821849ea in drm_crtc_helper_set_config (set=0xfffff800282b4a00) at
/usr/src/sys/modules/drm2/drm2/../../../dev/drm2/drm_crtc_helper.c:596
#6  0xffffffff8218a03e in drm_fb_helper_restore_fbdev_mode (fb_helper=<optimized
out>) at /usr/src/sys/modules/drm2/drm2/../../../dev/drm2/drm_fb_helper.c:344
#7  0xffffffff82189efc in vt_kms_postswitch (arg=<unavailable>) at
/usr/src/sys/modules/drm2/drm2/../../../dev/drm2/drm_fb_helper.c:80
#8  0xffffffff805237ba in vt_fb_postswitch (vd=<optimized out>) at
/usr/src/sys/dev/vt/hw/fb/vt_fb.c:385
#9  0xffffffff805290fd in vt_window_switch (vw=0xffffffff80c4e4c0
<vt_conswindow>) at /usr/src/sys/dev/vt/vt_core.c:540
#10 0xffffffff80527410 in vtterm_cngrab (tm=<optimized out>) at
/usr/src/sys/dev/vt/vt_core.c:1465
#11 0xffffffff806868fe in termcn_cngrab (cp=<optimized out>) at
/usr/src/sys/kern/subr_terminal.c:488
#12 0xffffffff805e8ef2 in cngrab () at /usr/src/sys/kern/kern_cons.c:368
#13 0xffffffff8067399e in kdb_trap (type=19, code=0, tf=0xfffffe03e218cf30) at
/usr/src/sys/kern/subr_kdb.c:650
#14 0xffffffff8083e2bc in trap (frame=0xfffffe03e218cf30) at
/usr/src/sys/amd64/amd64/trap.c:389

I do not have any solution for this.
It's certainly nice to be able to switch to console when kdb becomes active.
But the code that does switching should be prepared to work in the rather
restrictive context.  Which the kms code is not.

P.S. It seems that the latest version of drm_fb_helper.c in Linux is quite
different from what we have.

-- 
Andriy Gapon
Received on Mon Aug 15 2016 - 11:55:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:07 UTC