From owner-svn-src-head@freebsd.org Wed Mar 18 16:40:24 2020 Return-Path: Delivered-To: svn-src-head@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 D3E80265ABC for ; Wed, 18 Mar 2020 16:40:24 +0000 (UTC) (envelope-from brigadir15@gmail.com) Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48jG476N6Mz4LWf for ; Wed, 18 Mar 2020 16:40:23 +0000 (UTC) (envelope-from brigadir15@gmail.com) Received: by mail-lf1-x143.google.com with SMTP id a28so9135111lfr.13 for ; Wed, 18 Mar 2020 09:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zcMoG5SoQahuJXSm7g8N5b9udySZW5gdI+5/OMeMUac=; b=hx7zfdjsjZ8jlgDUoaQP+fAk0Y27OBcH0QxNyh47BpWpD61mbP+TLKkXI+rQg+q7HZ JYJJVYmbOMKaUwRR10jUbTKP2+WQ3igLs//PyOoV/7D2Wdhqmk4fQTTmsima9Pg3QzSF hlsCD86NNjBbK8ny74FnipqQUiB5cPMBqCU3dX/jC8isHTjFRcrhiWDBgaRGgChDzFHO Z/fvy9JRHjj1RfLdOBjuDR+OayxpRa7ft2SvaRGtogJ5H3DL2U7Oh+DhVTN5IgGDvJSe sRU/KoQmUrZsTJWTa3dXeDUI5/j9ClbUBCFDV6wH7g29GzhlRtXxtVSs/9FpQM0P+5Ww jrUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zcMoG5SoQahuJXSm7g8N5b9udySZW5gdI+5/OMeMUac=; b=az6slZnINZjUYHJuWUX+WzVHn9XXWoWWc9mGh+eNps4U2jzEGhPcuESZqr22RdmEIU JwzaR+Ax4sOBcvEegki9f8TlppBCI2lYY8PydcOktIDKB1vyvZhywnOZDi3TxtYt7n4k DRt+G+09IYOt078pTKBxKoKA45VwRvUZ9Y7ENnWrbpFsq2GwD8TDxcv7uPg4OSSiUS9M Ne9AxalyNMzfqx+Tppu7AmzHUm3zOvJJBfW/heT1QjpjQoMZCQi2UY8k5+WdXuTKa+mx 0ILsdpoYEI7vuotGGl8K94TS5QG4HGQb52bH+1q91yE1UJPGfKYL8IsFWe+g6/w723iV 2J1Q== X-Gm-Message-State: ANhLgQ0WISUavfIDc8omWEp+hko+ThCm8iNAutAIP8oylp+XeC9QUr3N quyhBBKZu+Ncn7hxU96deMI4LJFrYFM= X-Google-Smtp-Source: ADFU+vvEak/FjTHSLwVuITFPG0oaP5M9/BB9amyGHtkgWpJ5vpMzS10aR/teCifrnhjIfbqu750NSg== X-Received: by 2002:ac2:4565:: with SMTP id k5mr3453276lfm.8.1584549621156; Wed, 18 Mar 2020 09:40:21 -0700 (PDT) Received: from [192.168.1.3] ([46.48.69.183]) by smtp.gmail.com with ESMTPSA id i18sm5078571lfe.15.2020.03.18.09.40.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Mar 2020 09:40:20 -0700 (PDT) Subject: Re: svn commit: r358989 - in head/stand/efi: libefi loader loader/arch/arm loader/arch/arm64 To: junchoon@dec.sakura.ne.jp, Toomas Soome Cc: svn-src-head@freebsd.org References: <20200316001745.07df62f72d647b924b657d86@dec.sakura.ne.jp> <746EE981-536F-49AD-9B76-F9F103ECB1F9@me.com> <20200317211614.bbe1b18a32d7863941fffbe8@dec.sakura.ne.jp> From: Ruslan Garipov Message-ID: <55b1f91b-6157-bfee-cd74-124ed50bc663@gmail.com> Date: Wed, 18 Mar 2020 21:40:17 +0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200317211614.bbe1b18a32d7863941fffbe8@dec.sakura.ne.jp> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48jG476N6Mz4LWf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=hx7zfdjs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of brigadir15@gmail.com designates 2a00:1450:4864:20::143 as permitted sender) smtp.mailfrom=brigadir15@gmail.com X-Spamd-Result: default: False [-2.84 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (2.63), ipnet: 2a00:1450::/32(-2.39), asn: 15169(-1.65), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.84)[-0.844,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2020 16:40:24 -0000 On 3/17/2020 5:16 PM, Tomoaki AOKI wrote: > Hi! Thanks for your respond. > > Unfortunately, no. > I'm running on ThinkPad P52, which has no com connector installed. > No USB serial interface connected. > > `efi-show -g global -v ConOut` on loader prompt shows > > global NV,BS,RS ConOut = > PciRoot(0,0)/Pci((0x1,oxo)/Pci(0x0,0x0)/AcpiAdr(0x80010100) > > Moreover, my previous idea didn't help. > > Neither > console="vidconsole" > console="eficonsole" > console="efi_console" > nor > console="efi" > in /boot/loader.conf works. > > Defining / undefining TERM_EMU on build are untested. > > Is there any setting for /boot/loader.conf to control the behavior? > > > Regards. > > > On Mon, 16 Mar 2020 08:26:56 +0200 > Toomas Soome wrote: > >> Hi! >> >> This means, your system has UART serial device 〓 you can check this from loader prompt: efi-show -g global -v ConOut or with efivar from running system. This w ould trigger efi console driver to use TERM_EMU, which can be turned off by user and doing that would cause ESC sequences to be passed directly to console. Might that be true in your case? >> >> rgds, >> toomas >> >>> On 15. Mar 2020, at 17:17, Tomoaki AOKI wrote: >>> >>> Hi. >>> >>> This broke loader menu display on efifb. At least on amd64. >>> ESC sequences without ESC character are shown. >>> Key input (at least 1, 2 and enter) works OK. >>> I suspect outputs for SIO is sent to efifb and ESC codes are ignored. >>> >>> Reverting this fixes the issue. I got the same issue with loader menu when was upgrading from r358827 to r359028 (x86-64). But unfortunately the broken menu is just a part of my problem. The real pain is that a FreeBSD 13.0-CURRENT system hosted by VMware ESXi or Workstation doesn't boot anymore after r358989. An ugly workaround[1] (exiting from the loader menu into the loader prompt, running ls or show, scrolling the result down and then executing boot) I found some time ago doesn't work anymore. After running boot/boot -s/selecting menu item, a hypervisor just shuts session down with the following message: ``The firmware encountered an unexpected exception. The virtual machine cannot boot.'' The virtual guests don't have any UART (even USB) serial devices in their settings. efi-show prints result similar to what Tomoaki got: OK efi-show -g global -v CounOut global NV,BS,RS ConOut = PciRoot(0x0)/Pci(0x2,0x0)/AcpiAdr(0x80014310) Undefining TERM_EMU doesn't help. I had completely removed CFLAGS assignment with TERM_EMU from stand/efi/libefi/Makefile and rebuilt kernel/world -- nothing changed. I don't define TERM_EMU in my make.conf or/and src.conf. Reverting this revision fix booting (and menu, of course). FreeBSD on physical hardware boots just fine with this revision, but has corrupted loader menu. Toomas, please help us to fix this. I can live with the broken menu, but I don't want to revert this revision every time I will upgrade my virtual machines after r359028 now. [1] https://old.reddit.com/r/freebsd/comments/drxqlm/failed_to_do_efi_boot_on_a_vmware_virtual_machine/f6om6p2/ >>> >>> Not tried (not enough time for now as I'm mainly using stable/12), >>> but possibly calling efi_cons_probe() from efi_cons_init() would be >>> needed, as ome codes are moved from the latter to the former. >>> >>> >>>> Author: tsoome >>>> Date: Sat Mar 14 06:36:03 2020 >>>> New Revision: 358989 >>>> URL: https://svnweb.freebsd.org/changeset/base/358989 >>>> >>>> Log: >>>> loader: add comconsole implementation on top of SIO protocol >>>> >>>> Provide comconsole on top of SIO for arm platforms (x86 does use bios >>> version). >>>> >>>> Added: >>>> head/stand/efi/loader/efiserialio.c (contents, props changed) >>>> Modified: >>>> head/stand/efi/libefi/efi_console.c >>>> head/stand/efi/loader/arch/arm/Makefile.inc >>>> head/stand/efi/loader/arch/arm64/Makefile.inc >>>> head/stand/efi/loader/conf.c >>>> head/stand/efi/loader/main.c >>>> >>>> Modified: head/stand/efi/libefi/efi_console.c >>>> ============================================================================== >>>> --- head/stand/efi/libefi/efi_console.c Sat Mar 14 05:57:22 >>> 2020 (r358988) >>>> +++ head/stand/efi/libefi/efi_console.c >>> Sat Mar 14 06:36:03 2020 (r358989) >>>> @@ -377,9 +377,22 @@ efi_cons_respond(void *s __unused, const void *buf __u >>>> { >>>> } >>>> >>>> +/* >>>> + * Set up conin/conout/coninex to make sure we have input ready. >>>> + */ >>>> static void >>>> efi_cons_probe(struct console *cp) >>>> { >>>> + EFI_STATUS status; >>>> + >>>> + conout = ST->ConOut; >>>> + conin = ST->ConIn; >>>> + >>>> + status = BS->OpenProtocol(ST->ConsoleInHandle, >>> &simple_input_ex_guid, >>>> + (void **)&coninex, IH, NULL, >>> EFI_OPEN_PROTOCOL_GET_PROTOCOL); >>>> + if (status != EFI_SUCCESS) >>>> + coninex = NULL; >>>> + >>>> cp->c_flags |= C_PRESENTIN | C_PRESENTOUT; >>>> } >>>> >>>> @@ -889,15 +902,7 @@ efi_cons_init(int arg) >>>> if (conin != NULL) >>>> return (0); >>>> >>>> - conout = ST->ConOut; >>>> - conin = ST->ConIn; >>>> - >>>> conout->EnableCursor(conout, TRUE); >>>> - status = BS->OpenProtocol(ST->ConsoleInHandle, >>> &simple_input_ex_guid, >>>> - (void **)&coninex, IH, NULL, >>> EFI_OPEN_PROTOCOL_GET_PROTOCOL); >>>> - if (status != EFI_SUCCESS) >>>> - coninex = NULL; >>>> - >>>> if (efi_cons_update_mode()) >>>> return (0); >>>> >>>> >>>> Modified: head/stand/efi/loader/arch/arm/Makefile.inc >>>> ============================================================================== >>>> --- head/stand/efi/loader/arch/arm/Makefile.inc Sat Mar 14 >>> 05:57:22 2020 (r358988) >>>> +++ head/stand/efi/loader/arch/arm/Makefile.inc Sat Mar 14 06:36:03 >>> 2020 (r358989) >>>> @@ -1,6 +1,7 @@ >>>> # $FreeBSD$ >>>> >>>> SRCS+= exec.c \ >>>> + efiserialio.c \ >>>> start.S >>>> >>>> HAVE_FDT=yes >>> >>> (Snip) >>> >>>> @@ -930,7 +936,6 @@ main(int argc, CHAR16 *argv[]) >>>> if (!has_kbd && (howto & RB_PROBE)) >>>> howto |= RB_SERIAL | RB_MULTIPLE; >>>> howto &= ~RB_PROBE; >>>> - uhowto = parse_uefi_con_out(); >>>> >>>> /* >>>> * Read additional environment variables from the boot device's >>> >>> -- >>> Tomoaki AOKI >> >> > >