From owner-freebsd-current@freebsd.org Sat Jan 30 09:55:03 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6164E4E3E86 for ; Sat, 30 Jan 2021 09:55:03 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "anubis.delphij.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSV1f136Tz3Qs2; Sat, 30 Jan 2021 09:55:01 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from p51.home.us.delphij.net (unknown [IPv6:2601:646:8601:f4a:e670:b8ff:fe5c:4e69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 4366B3AAF0; Sat, 30 Jan 2021 01:54:56 -0800 (PST) From: Xin Li Subject: UEFI boot hangs after loading kernel with efi_max_resolution="4k" Reply-To: d@delphij.net To: freebsd-current@freebsd.org Cc: tsoome@freebsd.org Organization: The FreeBSD Project Message-ID: <8a4b2d5c-fb19-9784-b104-d725a7992041@delphij.net> Date: Sat, 30 Jan 2021 01:54:55 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DSV1f136Tz3Qs2 X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; HAS_REPLYTO(0.00)[d@delphij.net]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+a:sirius.delphij.net]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; DKIM_TRACE(0.00)[delphij.net:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[delphij.net,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:470:1:117::25:from]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[delphij.net:s=m7e2]; FREEFALL_USER(0.00)[delphij]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; SPAMHAUS_ZRD(0.00)[2001:470:1:117::25:from:127.0.2.255]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 09:55:03 -0000 Hi, It seems that some recent change after 282381aa53a would prevent my laptop (Lenovo P51, with 4k LCD) from booting. I have made some attempt to find out why, so far, it seems that setting efi_max_resolution="480p" or efi_max_resolution="720p" would allow it to boot to single user mode. Unfortunately, with KMS modules loaded, the screen would enter high resolution mode, and the screen output would be garbled. To make the situation worse, because I have the following configuration set in /etc/rc.conf: allscreens_flags="-f /usr/share/vt/fonts/terminus-b32.fnt" the kernel would panic shortly after loading the font: === Unread portion of the kernel message buffer: <118>Configuring vt: blanktime allscreens panic: free: address 0xffffffff81c6ee00(0xffffffff81c6e000) has not been allocated. cpuid = 3 time = 1611996927 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0141dbc490 vpanic() at vpanic+0x181/frame 0xfffffe0141dbc4e0 panic() at panic+0x43/frame 0xfffffe0141dbc540 free() at free+0xf8/frame 0xfffffe0141dbc570 vt_change_font() at vt_change_font+0x16f/frame 0xfffffe0141dbc5c0 vtterm_ioctl() at vtterm_ioctl+0xef6/frame 0xfffffe0141dbc610 termtty_ioctl() at termtty_ioctl+0xc3/frame 0xfffffe0141dbc660 tty_ioctl() at tty_ioctl+0x8e/frame 0xfffffe0141dbc6b0 ttydev_ioctl() at ttydev_ioctl+0x247/frame 0xfffffe0141dbc700 devfs_ioctl() at devfs_ioctl+0xcb/frame 0xfffffe0141dbc750 vn_ioctl() at vn_ioctl+0x131/frame 0xfffffe0141dbc860 devfs_ioctl_f() at devfs_ioctl_f+0x1e/frame 0xfffffe0141dbc880 kern_ioctl() at kern_ioctl+0x289/frame 0xfffffe0141dbc8f0 sys_ioctl() at sys_ioctl+0x12a/frame 0xfffffe0141dbc9c0 amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe0141dbcaf0 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe0141dbcaf0 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x80038bc9a, rsp = 0x7fffffffe938, rbp = 0x7fffffffebf0 --- Uptime: 28s Dumping 1421 out of 32433 MB:..2%..11%..21%..31%..41%..51%..61%..71%..82%..91% ==== I thought the panic was fixed (bug 252833), but it's probably a different corner case, which can happen when loader/EFI provided resolution is different from the current KMS-enabled resolution (haven't took a closer look yet). But it's still unclear to me why the screen would go blank when efi_max_resolution is set to "4k" or unset. I thought it's probably panicked somewhere, but it's hard to confirm as I don't have a serial console with this laptop. If I replace the loader taken from the 20201231 snapshot (from 282381aa53a), then the laptop would boot just fine. In summary, what I know so far was: Old loader: everything would work just fine. New loader: efi_max_resolution="4k" in /boot/loader.conf: Screen goes blank after "boot" in loader prompt No efi_max_resolution in /boot/loader.conf: 'show' gives me efi_max_resolution="1x1" and screen goes blank after "boot" in loader prompt efi_max_resolution="720p" or 480p in /boot/loader.conf: Kernel boots fine up to single user mode. Panic immediately when loading font. Any suggestion on what this could be? It's hard to debug boot loader issues on this laptop as I don't have an usable serial console and blank screen would make me blind :) Cheers,