From nobody Wed May 17 02:19:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QLcHw26XHz4Bl5l for ; Wed, 17 May 2023 02:19:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QLcHv3XNWz3FFk for ; Wed, 17 May 2023 02:19:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-50bc22805d3so308906a12.1 for ; Tue, 16 May 2023 19:19:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1684289976; x=1686881976; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oE0dlyP9R7sepyE/wilkY/wqYrVOawrLdN4ZiJH31Gc=; b=PC1eIcrHCgvEtEGNLiuHjMKks9jNLM6DjljM/5mzBEHn4ENogSWaaQgVnGTxObA/Cf p6t8hY4vpTGTOjKg6hyJc1T6HAef4lW8Vhocbi4V27oiWFLYLAjIxNPoRWw51HZtyHWY Ari+2HivJX8G6YreSZj17n28QqPRSdwLViyAlc3uNlwQiDKp89XSGxso394e454QLZ+s +7OTcawswRd9hanXYe7z7e1e7arEYxOpUMVudKgGW5y1Q8wxCgzD0p65uB7m33NOwTZw JeP7G1d3lilwYXixRb5wt0HPEIk7/U7hivLVL3Uf/njqBUf7M8d/GWJr3Z3uNkDZOf15 GMbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684289976; x=1686881976; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oE0dlyP9R7sepyE/wilkY/wqYrVOawrLdN4ZiJH31Gc=; b=aB4HINuaqASy/Zeoz7ck6dN2s76mQJC5O3IB+tYx3r/TbCnl08o2E0UUbd9xJPl2T9 ILWYsWtDLuXbPq05l44K64YSpLYeiataEQf/1zZqBfMZYDnD5geCJ/YIBz4noixw1QiW 2K7RHtCVgG3pC97V4taLU2Cmx3QgwcQ7YnitSW9Zh/GxqDiJDQQvef5ASgyJThP3/ozu fXPqg0XwFeOcxwHh+KBDnFhH5Gspv40LNQm1r7F3xZYrE7nkJiQ7YMcJIiggP1Bpbs+t SuwfiTs+cFxxjX/6cp6ZwjdrNeIrtkCFQyZfvKfipCortifsYnL1XvpGQxIFXVXTjTLL Xpcw== X-Gm-Message-State: AC+VfDwKH2D9L7Sey+gowjvshFrf1BJCXmDfcDB6A25P5FW3uUFf7ASH 5DQNQENv1D8s7ulOAXZ8MN7i7A2Tidg+eIhPtlqHow== X-Google-Smtp-Source: ACHHUZ5rw/PtnQWSKyXokblvIkpZv82bJWbQzhCUv7m7jantv86DcCZlko1EYBehGRZqXFFOBGmBVi+DQVTxieJHSqk= X-Received: by 2002:a17:906:7949:b0:969:ffcb:1eb4 with SMTP id l9-20020a170906794900b00969ffcb1eb4mr25049988ejo.2.1684289976260; Tue, 16 May 2023 19:19:36 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202305112006.34BK6kPw019492@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 16 May 2023 20:19:25 -0600 Message-ID: Subject: Re: HEADS UP: broken boot! Was: git: 2f131435bc22 - main - stand: efi create eficom console device. To: Gleb Smirnoff Cc: src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000bbea4f05fbda5104" X-Rspamd-Queue-Id: 4QLcHv3XNWz3FFk X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000bbea4f05fbda5104 Content-Type: text/plain; charset="UTF-8" On Tue, May 16, 2023, 10:12 PM Gleb Smirnoff wrote: > Hi, > > this commit breaks boot on some machines with EFI. Warner already knows > and he > provided a quick hack to make it bootable. The proper fix will be > available later. > > Meanwhile you are advised to not update your loader past 2f131435bc22, or > use the patch (attached). > It breaks dual console loaders. I should have a fix in the morning. Too much bsdcan cheer tonight to think straight. Warner On Thu, May 11, 2023 at 08:06:46PM +0000, Warner Losh wrote: > W> The branch main has been updated by imp: > W> > W> URL: > https://cgit.FreeBSD.org/src/commit/?id=2f131435bc22540db2d3f6bf97e5f9fe7039f889 > W> > W> commit 2f131435bc22540db2d3f6bf97e5f9fe7039f889 > W> Author: Warner Losh > W> AuthorDate: 2023-05-11 20:03:17 +0000 > W> Commit: Warner Losh > W> CommitDate: 2023-05-11 20:06:03 +0000 > W> > W> stand: efi create eficom console device. > W> > W> Fix the 'renaming kludge' that we absolutely cannot do going forward > W> (it's cost us days of engineering time). > W> > W> console=comconsole talks to the hardware directly. This is available > W> only on amd64. It is not available anywhere else (and so requires > W> changes for people doing comconsole on aarch64) > W> > W> console=eficom talks to the console via EFI protocols. It's > available > W> on amd64, aarch64 and riscv64. It's the first port that we find, > though > W> it can be overriden by efi_com_port (which should be set to the UID > of > W> the serial port, not the I/O port, despite the name). devinfo -v > W> will give the UID to uartX mapping. > W> > W> This is an incompatible change for HYPER-V on amd64. It only works > with > W> eficom console, so you'll need to change your configuration in > W> loader.conf. No compatibility hack will ever be provided for this > (since > W> it requires renamig, which the loader cannot reliably do). > W> > W> It's also an incompatible change for aarch64. comconsole will need > to > W> change to eficom. There might be a comconsole "shim" for this. > W> > W> All the interlock to keep only eficom and comconsole from both > attaching > W> have been removed. > W> > W> RelNotes: Yes > W> Sponsored by: Netflix > W> Discussed with: kevans > W> Differential Revision: https://reviews.freebsd.org/D39982 > W> --- > W> stand/efi/loader/conf.c | 12 ++---- > W> stand/efi/loader/efiserialio.c | 85 > +++++++++++++++++------------------------ > W> stand/i386/libi386/comconsole.c | 14 ------- > W> 3 files changed, 39 insertions(+), 72 deletions(-) > W> > W> diff --git a/stand/efi/loader/conf.c b/stand/efi/loader/conf.c > W> index 051e1a3381d1..e9ae01d19270 100644 > W> --- a/stand/efi/loader/conf.c > W> +++ b/stand/efi/loader/conf.c > W> @@ -80,22 +80,18 @@ struct netif_driver *netif_drivers[] = { > W> }; > W> > W> extern struct console efi_console; > W> -extern struct console comconsole; > W> -#if defined(__amd64__) > W> -extern struct console eficomconsole; > W> -#endif > W> +extern struct console eficom; > W> #if defined(__amd64__) || defined(__i386__) > W> +extern struct console comconsole; > W> extern struct console nullconsole; > W> extern struct console spinconsole; > W> #endif > W> > W> struct console *consoles[] = { > W> &efi_console, > W> -#if defined(__amd64__) > W> - &eficomconsole, > W> -#endif > W> - &comconsole, > W> + &eficom, > W> #if defined(__amd64__) || defined(__i386__) > W> + &comconsole, > W> &nullconsole, > W> &spinconsole, > W> #endif > W> diff --git a/stand/efi/loader/efiserialio.c > b/stand/efi/loader/efiserialio.c > W> index 0f37ef8b87dd..de4d6b3e34c1 100644 > W> --- a/stand/efi/loader/efiserialio.c > W> +++ b/stand/efi/loader/efiserialio.c > W> @@ -69,14 +69,9 @@ static int comc_speed_set(struct env_var *, > int, const void *); > W> > W> static struct serial *comc_port; > W> extern struct console efi_console; > W> -bool efi_comconsole_avail = false; > W> > W> -#if defined(__amd64__) > W> -#define comconsole eficomconsole > W> -#endif > W> - > W> -struct console comconsole = { > W> - .c_name = "comconsole", > W> +struct console eficom = { > W> + .c_name = "eficom", > W> .c_desc = "serial port", > W> .c_flags = 0, > W> .c_probe = comc_probe, > W> @@ -259,18 +254,6 @@ comc_probe(struct console *sc) > W> char *env, *buf, *ep; > W> size_t sz; > W> > W> -#if defined(__amd64__) > W> - /* > W> - * For x86-64, don't use this driver if not running in Hyper-V. > W> - */ > W> - env = getenv("smbios.bios.version"); > W> - if (env == NULL || strncmp(env, "Hyper-V", 7) != 0) { > W> - /* Disable being seen as "comconsole". */ > W> - comconsole.c_name = "efiserialio"; > W> - return; > W> - } > W> -#endif > W> - > W> if (comc_port == NULL) { > W> comc_port = calloc(1, sizeof (struct serial)); > W> if (comc_port == NULL) > W> @@ -339,13 +322,9 @@ comc_probe(struct console *sc) > W> env_setenv("efi_com_speed", EV_VOLATILE, value, > W> comc_speed_set, env_nounset); > W> > W> - comconsole.c_flags = 0; > W> + eficom.c_flags = 0; > W> if (comc_setup()) { > W> sc->c_flags = C_PRESENTIN | C_PRESENTOUT; > W> - efi_comconsole_avail = true; > W> - } else { > W> - /* disable being seen as "comconsole" */ > W> - comconsole.c_name = "efiserialio"; > W> } > W> } > W> > W> @@ -356,7 +335,7 @@ comc_init(int arg __unused) > W> if (comc_setup()) > W> return (CMD_OK); > W> > W> - comconsole.c_flags = 0; > W> + eficom.c_flags = 0; > W> return (CMD_ERROR); > W> } > W> > W> @@ -522,35 +501,41 @@ comc_setup(void) > W> if (comc_port->sio == NULL) > W> return (false); > W> > W> - status = comc_port->sio->Reset(comc_port->sio); > W> - if (EFI_ERROR(status)) > W> - return (false); > W> - > W> - ev = getenv("smbios.bios.version"); > W> - if (ev != NULL && strncmp(ev, "Hyper-V", 7) == 0) { > W> - status = comc_port->sio->SetAttributes(comc_port->sio, > W> - 0, 0, 0, DefaultParity, 0, DefaultStopBits); > W> - } else { > W> - status = comc_port->sio->SetAttributes(comc_port->sio, > W> - comc_port->baudrate, comc_port->receivefifodepth, > W> - comc_port->timeout, comc_port->parity, > W> - comc_port->databits, comc_port->stopbits); > W> + if (comc_port->sio->Reset != NULL) { > W> + status = comc_port->sio->Reset(comc_port->sio); > W> + if (EFI_ERROR(status)) > W> + return (false); > W> } > W> > W> - if (EFI_ERROR(status)) > W> - return (false); > W> + if (comc_port->sio->SetAttributes != NULL) { > W> + ev = getenv("smbios.bios.version"); > W> + if (ev != NULL && strncmp(ev, "Hyper-V", 7) == 0) { > W> + status = > comc_port->sio->SetAttributes(comc_port->sio, > W> + 0, 0, 0, DefaultParity, 0, DefaultStopBits); > W> + } else { > W> + status = > comc_port->sio->SetAttributes(comc_port->sio, > W> + comc_port->baudrate, > comc_port->receivefifodepth, > W> + comc_port->timeout, comc_port->parity, > W> + comc_port->databits, comc_port->stopbits); > W> + } > W> > W> - status = comc_port->sio->GetControl(comc_port->sio, &control); > W> - if (EFI_ERROR(status)) > W> - return (false); > W> - if (comc_port->rtsdtr_off) { > W> - control &= ~(EFI_SERIAL_REQUEST_TO_SEND | > W> - EFI_SERIAL_DATA_TERMINAL_READY); > W> - } else { > W> - control |= EFI_SERIAL_REQUEST_TO_SEND; > W> + if (EFI_ERROR(status)) > W> + return (false); > W> + } > W> + > W> + if (comc_port->sio->GetControl != NULL && > comc_port->sio->SetControl != NULL) { > W> + status = comc_port->sio->GetControl(comc_port->sio, > &control); > W> + if (EFI_ERROR(status)) > W> + return (false); > W> + if (comc_port->rtsdtr_off) { > W> + control &= ~(EFI_SERIAL_REQUEST_TO_SEND | > W> + EFI_SERIAL_DATA_TERMINAL_READY); > W> + } else { > W> + control |= EFI_SERIAL_REQUEST_TO_SEND; > W> + } > W> + (void) comc_port->sio->SetControl(comc_port->sio, control); > W> } > W> - (void) comc_port->sio->SetControl(comc_port->sio, control); > W> /* Mark this port usable. */ > W> - comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); > W> + eficom.c_flags |= (C_PRESENTIN | C_PRESENTOUT); > W> return (true); > W> } > W> diff --git a/stand/i386/libi386/comconsole.c > b/stand/i386/libi386/comconsole.c > W> index 507cd0ec922f..6d48e876fa37 100644 > W> --- a/stand/i386/libi386/comconsole.c > W> +++ b/stand/i386/libi386/comconsole.c > W> @@ -85,20 +85,6 @@ comc_probe(struct console *cp) > W> int speed, port; > W> uint32_t locator; > W> > W> -#if defined(__amd64__) > W> - extern bool efi_comconsole_avail; > W> - > W> - if (efi_comconsole_avail) { > W> - /* > W> - * If EFI provides serial I/O, then don't use this legacy > W> - * com driver to avoid conflicts with the firmware's > driver. > W> - * Change c_name so that it cannot be found in the lookup. > W> - */ > W> - comconsole.c_name = "xcomconsole"; > W> - return; > W> - } > W> -#endif > W> - > W> if (comc_curspeed == 0) { > W> comc_curspeed = COMSPEED; > W> /* > > -- > Gleb Smirnoff > --000000000000bbea4f05fbda5104 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, May 16, 2023, 10:12 PM Gleb Smirnoff <glebius@freebsd.org> wrote:
=C2=A0 Hi,

this commit breaks boot on some machines with EFI. Warner already knows and= he
provided a quick hack to make it bootable. The proper fix will be available= later.

Meanwhile you are advised to not update your loader past 2f131435bc22, or <= br> use the patch (attached).
It breaks dual console loaders. I should have a fi= x in the morning. Too much bsdcan cheer tonight to think straight.=C2=A0

Warner=C2=A0

On Thu, May 11, 2023 at 08:06:46PM +0000, Warner Losh wrote:
W> The branch main has been updated by imp:
W>
W> URL: https://cgit.FreeBSD.org/src/commit/?id=3D2f131435bc22540db2d3f6bf97e5f= 9fe7039f889
W>
W> commit 2f131435bc22540db2d3f6bf97e5f9fe7039f889
W> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
W> AuthorDate: 2023-05-11 20:03:17 +0000
W> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
W> CommitDate: 2023-05-11 20:06:03 +0000
W>
W>=C2=A0 =C2=A0 =C2=A0stand: efi create eficom console device.
W>=C2=A0 =C2=A0 =C2=A0
W>=C2=A0 =C2=A0 =C2=A0Fix the 'renaming kludge' that we absolute= ly cannot do going forward
W>=C2=A0 =C2=A0 =C2=A0(it's cost us days of engineering time).
W>=C2=A0 =C2=A0 =C2=A0
W>=C2=A0 =C2=A0 =C2=A0console=3Dcomconsole talks to the hardware directl= y. This is available
W>=C2=A0 =C2=A0 =C2=A0only on amd64. It is not available anywhere else (= and so requires
W>=C2=A0 =C2=A0 =C2=A0changes for people doing comconsole on aarch64) W>=C2=A0 =C2=A0 =C2=A0
W>=C2=A0 =C2=A0 =C2=A0console=3Deficom talks to the console via EFI prot= ocols.=C2=A0 It's available
W>=C2=A0 =C2=A0 =C2=A0on amd64, aarch64 and riscv64. It's the first = port that we find, though
W>=C2=A0 =C2=A0 =C2=A0it can be overriden by efi_com_port (which should = be set to the UID of
W>=C2=A0 =C2=A0 =C2=A0the serial port, not the I/O port, despite the nam= e). devinfo -v
W>=C2=A0 =C2=A0 =C2=A0will give the UID to uartX mapping.
W>=C2=A0 =C2=A0 =C2=A0
W>=C2=A0 =C2=A0 =C2=A0This is an incompatible change for HYPER-V on amd6= 4. It only works with
W>=C2=A0 =C2=A0 =C2=A0eficom console, so you'll need to change your = configuration in
W>=C2=A0 =C2=A0 =C2=A0loader.conf. No compatibility hack will ever be pr= ovided for this (since
W>=C2=A0 =C2=A0 =C2=A0it requires renamig, which the loader cannot relia= bly do).
W>=C2=A0 =C2=A0 =C2=A0
W>=C2=A0 =C2=A0 =C2=A0It's also an incompatible change for aarch64. = comconsole will need to
W>=C2=A0 =C2=A0 =C2=A0change to eficom. There might be a comconsole &quo= t;shim" for this.
W>=C2=A0 =C2=A0 =C2=A0
W>=C2=A0 =C2=A0 =C2=A0All the interlock to keep only eficom and comconso= le from both attaching
W>=C2=A0 =C2=A0 =C2=A0have been removed.
W>=C2=A0 =C2=A0 =C2=A0
W>=C2=A0 =C2=A0 =C2=A0RelNotes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0Yes
W>=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Netflix
W>=C2=A0 =C2=A0 =C2=A0Discussed with:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0k= evans
W>=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 h= ttps://reviews.freebsd.org/D39982
W> ---
W>=C2=A0 stand/efi/loader/conf.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 12 += +----
W>=C2=A0 stand/efi/loader/efiserialio.c=C2=A0 | 85 +++++++++++++++++----= --------------------
W>=C2=A0 stand/i386/libi386/comconsole.c | 14 -------
W>=C2=A0 3 files changed, 39 insertions(+), 72 deletions(-)
W>
W> diff --git a/stand/efi/loader/conf.c b/stand/efi/loader/conf.c
W> index 051e1a3381d1..e9ae01d19270 100644
W> --- a/stand/efi/loader/conf.c
W> +++ b/stand/efi/loader/conf.c
W> @@ -80,22 +80,18 @@ struct netif_driver *netif_drivers[] =3D {
W>=C2=A0 };
W>=C2=A0
W>=C2=A0 extern struct console efi_console;
W> -extern struct console comconsole;
W> -#if defined(__amd64__)
W> -extern struct console eficomconsole;
W> -#endif
W> +extern struct console eficom;
W>=C2=A0 #if defined(__amd64__) || defined(__i386__)
W> +extern struct console comconsole;
W>=C2=A0 extern struct console nullconsole;
W>=C2=A0 extern struct console spinconsole;
W>=C2=A0 #endif
W>=C2=A0
W>=C2=A0 struct console *consoles[] =3D {
W>=C2=A0 =C2=A0 =C2=A0 &efi_console,
W> -#if defined(__amd64__)
W> -=C2=A0 =C2=A0 &eficomconsole,
W> -#endif
W> -=C2=A0 =C2=A0 &comconsole,
W> +=C2=A0 =C2=A0 &eficom,
W>=C2=A0 #if defined(__amd64__) || defined(__i386__)
W> +=C2=A0 =C2=A0 &comconsole,
W>=C2=A0 =C2=A0 =C2=A0 &nullconsole,
W>=C2=A0 =C2=A0 =C2=A0 &spinconsole,
W>=C2=A0 #endif
W> diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loader/efiser= ialio.c
W> index 0f37ef8b87dd..de4d6b3e34c1 100644
W> --- a/stand/efi/loader/efiserialio.c
W> +++ b/stand/efi/loader/efiserialio.c
W> @@ -69,14 +69,9 @@ static int=C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_speed_s= et(struct env_var *, int, const void *);
W>=C2=A0
W>=C2=A0 static struct serial=C2=A0 =C2=A0 =C2=A0 =C2=A0 *comc_port;
W>=C2=A0 extern struct console efi_console;
W> -bool efi_comconsole_avail =3D false;
W>=C2=A0
W> -#if defined(__amd64__)
W> -#define comconsole eficomconsole
W> -#endif
W> -
W> -struct console comconsole =3D {
W> -=C2=A0 =C2=A0 .c_name =3D "comconsole",
W> +struct console eficom =3D {
W> +=C2=A0 =C2=A0 .c_name =3D "eficom",
W>=C2=A0 =C2=A0 =C2=A0 .c_desc =3D "serial port",
W>=C2=A0 =C2=A0 =C2=A0 .c_flags =3D 0,
W>=C2=A0 =C2=A0 =C2=A0 .c_probe =3D comc_probe,
W> @@ -259,18 +254,6 @@ comc_probe(struct console *sc)
W>=C2=A0 =C2=A0 =C2=A0 char *env, *buf, *ep;
W>=C2=A0 =C2=A0 =C2=A0 size_t sz;
W>=C2=A0
W> -#if defined(__amd64__)
W> -=C2=A0 =C2=A0 /*
W> -=C2=A0 =C2=A0 =C2=A0* For x86-64, don't use this driver if not r= unning in Hyper-V.
W> -=C2=A0 =C2=A0 =C2=A0*/
W> -=C2=A0 =C2=A0 env =3D getenv("smbios.bios.version");
W> -=C2=A0 =C2=A0 if (env =3D=3D NULL || strncmp(env, "Hyper-V"= ;, 7) !=3D 0) {
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Disable being seen as &= quot;comconsole". */
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comconsole.c_name =3D &quo= t;efiserialio";
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return;
W> -=C2=A0 =C2=A0 }
W> -#endif
W> -
W>=C2=A0 =C2=A0 =C2=A0 if (comc_port =3D=3D NULL) {
W>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port =3D calloc(= 1, sizeof (struct serial));
W>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (comc_port =3D=3D = NULL)
W> @@ -339,13 +322,9 @@ comc_probe(struct console *sc)
W>=C2=A0 =C2=A0 =C2=A0 env_setenv("efi_com_speed", EV_VOLATILE= , value,
W>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_speed_set, env_nounset);
W>=C2=A0
W> -=C2=A0 =C2=A0 comconsole.c_flags =3D 0;
W> +=C2=A0 =C2=A0 eficom.c_flags =3D 0;
W>=C2=A0 =C2=A0 =C2=A0 if (comc_setup()) {
W>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sc->c_flags =3D C_= PRESENTIN | C_PRESENTOUT;
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 efi_comconsole_avail =3D t= rue;
W> -=C2=A0 =C2=A0 } else {
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* disable being seen as &= quot;comconsole" */
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comconsole.c_name =3D &quo= t;efiserialio";
W>=C2=A0 =C2=A0 =C2=A0 }
W>=C2=A0 }
W>=C2=A0
W> @@ -356,7 +335,7 @@ comc_init(int arg __unused)
W>=C2=A0 =C2=A0 =C2=A0 if (comc_setup())
W>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (CMD_OK);
W>=C2=A0
W> -=C2=A0 =C2=A0 comconsole.c_flags =3D 0;
W> +=C2=A0 =C2=A0 eficom.c_flags =3D 0;
W>=C2=A0 =C2=A0 =C2=A0 return (CMD_ERROR);
W>=C2=A0 }
W>=C2=A0
W> @@ -522,35 +501,41 @@ comc_setup(void)
W>=C2=A0 =C2=A0 =C2=A0 if (comc_port->sio =3D=3D NULL)
W>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (false);
W>=C2=A0
W> -=C2=A0 =C2=A0 status =3D comc_port->sio->Reset(comc_port->s= io);
W> -=C2=A0 =C2=A0 if (EFI_ERROR(status))
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (false);
W> -
W> -=C2=A0 =C2=A0 ev =3D getenv("smbios.bios.version");
W> -=C2=A0 =C2=A0 if (ev !=3D NULL && strncmp(ev, "Hyper-V&= quot;, 7) =3D=3D 0) {
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D comc_port->s= io->SetAttributes(comc_port->sio,
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0, 0, 0, Def= aultParity, 0, DefaultStopBits);
W> -=C2=A0 =C2=A0 } else {
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D comc_port->s= io->SetAttributes(comc_port->sio,
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port-&g= t;baudrate, comc_port->receivefifodepth,
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port-&g= t;timeout, comc_port->parity,
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port-&g= t;databits, comc_port->stopbits);
W> +=C2=A0 =C2=A0 if (comc_port->sio->Reset !=3D NULL) {
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D comc_port->s= io->Reset(comc_port->sio);
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (EFI_ERROR(status))
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 return (false);
W>=C2=A0 =C2=A0 =C2=A0 }
W>=C2=A0
W> -=C2=A0 =C2=A0 if (EFI_ERROR(status))
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (false);
W> +=C2=A0 =C2=A0 if (comc_port->sio->SetAttributes !=3D NULL) { W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ev =3D getenv("smbios= .bios.version");
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ev !=3D NULL &&= ; strncmp(ev, "Hyper-V", 7) =3D=3D 0) {
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 status =3D comc_port->sio->SetAttributes(comc_port->sio,
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 0, 0, 0, DefaultParity, 0, DefaultStopBits);
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else {
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 status =3D comc_port->sio->SetAttributes(comc_port->sio,
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 comc_port->baudrate, comc_port->receivefifodepth, W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 comc_port->timeout, comc_port->parity,
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 comc_port->databits, comc_port->stopbits);
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
W>=C2=A0
W> -=C2=A0 =C2=A0 status =3D comc_port->sio->GetControl(comc_port-= >sio, &control);
W> -=C2=A0 =C2=A0 if (EFI_ERROR(status))
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (false);
W> -=C2=A0 =C2=A0 if (comc_port->rtsdtr_off) {
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 control &=3D ~(EFI_SER= IAL_REQUEST_TO_SEND |
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 EFI_SERIAL_D= ATA_TERMINAL_READY);
W> -=C2=A0 =C2=A0 } else {
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 control |=3D EFI_SERIAL_RE= QUEST_TO_SEND;
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (EFI_ERROR(status))
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 return (false);
W> +=C2=A0 =C2=A0 }
W> +
W> +=C2=A0 =C2=A0 if (comc_port->sio->GetControl !=3D NULL &&a= mp; comc_port->sio->SetControl !=3D NULL) {
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D comc_port->s= io->GetControl(comc_port->sio, &control);
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (EFI_ERROR(status))
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 return (false);
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (comc_port->rtsdtr_o= ff) {
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 control &=3D ~(EFI_SERIAL_REQUEST_TO_SEND |
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 EFI_SERIAL_DATA_TERMINAL_READY);
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else {
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 control |=3D EFI_SERIAL_REQUEST_TO_SEND;
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
W> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (void) comc_port->sio-&= gt;SetControl(comc_port->sio, control);
W>=C2=A0 =C2=A0 =C2=A0 }
W> -=C2=A0 =C2=A0 (void) comc_port->sio->SetControl(comc_port->= sio, control);
W>=C2=A0 =C2=A0 =C2=A0 /* Mark this port usable. */
W> -=C2=A0 =C2=A0 comconsole.c_flags |=3D (C_PRESENTIN | C_PRESENTOUT);<= br> W> +=C2=A0 =C2=A0 eficom.c_flags |=3D (C_PRESENTIN | C_PRESENTOUT);
W>=C2=A0 =C2=A0 =C2=A0 return (true);
W>=C2=A0 }
W> diff --git a/stand/i386/libi386/comconsole.c b/stand/i386/libi386/com= console.c
W> index 507cd0ec922f..6d48e876fa37 100644
W> --- a/stand/i386/libi386/comconsole.c
W> +++ b/stand/i386/libi386/comconsole.c
W> @@ -85,20 +85,6 @@ comc_probe(struct console *cp)
W>=C2=A0 =C2=A0 =C2=A0 int speed, port;
W>=C2=A0 =C2=A0 =C2=A0 uint32_t locator;
W>=C2=A0
W> -#if defined(__amd64__)
W> -=C2=A0 =C2=A0 extern bool efi_comconsole_avail;
W> -
W> -=C2=A0 =C2=A0 if (efi_comconsole_avail) {
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* If EFI provides se= rial I/O, then don't use this legacy
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* com driver to avoi= d conflicts with the firmware's driver.
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Change c_name so t= hat it cannot be found in the lookup.
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comconsole.c_name =3D &quo= t;xcomconsole";
W> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return;
W> -=C2=A0 =C2=A0 }
W> -#endif
W> -
W>=C2=A0 =C2=A0 =C2=A0 if (comc_curspeed =3D=3D 0) {
W>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_curspeed =3D COM= SPEED;
W>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*

--
Gleb Smirnoff
--000000000000bbea4f05fbda5104--