From owner-dev-commits-src-branches@freebsd.org Thu Feb 25 16:05:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 C971C567D0A; Thu, 25 Feb 2021 16:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dmd1G5PDNz4wDv; Thu, 25 Feb 2021 16:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC6591A53A; Thu, 25 Feb 2021 16:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11PG5cUO094927; Thu, 25 Feb 2021 16:05:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PG5cGZ094926; Thu, 25 Feb 2021 16:05:38 GMT (envelope-from git) Date: Thu, 25 Feb 2021 16:05:38 GMT Message-Id: <202102251605.11PG5cGZ094926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: e680f3c0bd2b - releng/13.0 - loader: autoload_font will hung loader when there is no local console MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: e680f3c0bd2b6c6d3c76588c7693294d49fa965b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2021 16:05:38 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=e680f3c0bd2b6c6d3c76588c7693294d49fa965b commit e680f3c0bd2b6c6d3c76588c7693294d49fa965b Author: Toomas Soome AuthorDate: 2021-02-21 10:32:18 +0000 Commit: Toomas Soome CommitDate: 2021-02-25 16:05:24 +0000 loader: autoload_font will hung loader when there is no local console If we start with console set to comconsole, the local console (vidconsole, efi) is never initialized and attempt to use the data can render the loader hung. (cherry picked from commit 61c50cbc096d28e44cb8b627e524ae58158c423a) Reported by: Kamigishi Rei Approved by: re (gjb) --- stand/efi/libefi/efi_console.c | 3 +++ stand/i386/libi386/vidconsole.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 7024f9c8b2f2..3cbd121c41da 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -886,6 +886,9 @@ cons_update_mode(bool use_gfx_mode) EFI_STATUS status; char env[10], *ptr; + if (!efi_started) + return (false); + /* * Despite the use_gfx_mode, we want to make sure we call * efi_find_framebuffer(). This will populate the fb data, diff --git a/stand/i386/libi386/vidconsole.c b/stand/i386/libi386/vidconsole.c index f94ed2d26712..b933a7807687 100644 --- a/stand/i386/libi386/vidconsole.c +++ b/stand/i386/libi386/vidconsole.c @@ -53,7 +53,7 @@ static int vidc_getchar(void); static int vidc_ischar(void); static void cons_draw_frame(teken_attr_t *); -static int vidc_started; +static bool vidc_started; static uint16_t *vgatext; static tf_bell_t vidc_cons_bell; @@ -877,6 +877,10 @@ cons_update_mode(bool use_gfx_mode) char env[10], *ptr; int format, roff, goff, boff; + /* vidc_init() is not called yet. */ + if (!vidc_started) + return (false); + gfx_state.tg_tp.tp_row = TEXT_ROWS; gfx_state.tg_tp.tp_col = TEXT_COLS; @@ -996,7 +1000,7 @@ vidc_init(int arg) if (vidc_started && arg == 0) return (0); - vidc_started = 1; + vidc_started = true; vbe_init(); /*